@revibase/core 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,3 +1,3 @@
1
- 'use strict';var gill=require('gill'),ir=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'),server=require('@simplewebauthn/server');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var ir__default=/*#__PURE__*/_interopDefault(ir);var Kn=new Uint8Array([201,232,212,229,59,241,106,197]);function qI(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Kn)}function tu(){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:Kn}))}function Jn(){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 XI(){return gill.combineCodec(tu(),Jn())}function jn(e){return gill.decodeAccount(e,Jn())}async function Yn(e,n,r){let s=await ru(e,n,r);return gill.assertAccountExists(s),s}async function ru(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return jn(s)}async function $I(e,n,r){let s=await nu(e,n,r);return gill.assertAccountsExist(s),s}async function nu(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>jn(t))}function QI(){return 846}var Xn=new Uint8Array([42,206,176,58,175,129,130,233]);function rC(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Xn)}function lu(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()]]),e=>({...e,discriminator:Xn}))}function $n(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()]])}function nC(){return gill.combineCodec(lu(),$n())}function Qn(e){return gill.decodeAccount(e,$n())}async function sC(e,n,r){let s=await fu(e,n,r);return gill.assertAccountExists(s),s}async function fu(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Qn(s)}async function oC(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=>Qn(t))}function cC(){return 24}function yr(){return gill.getStructEncoder([["memberKey",z()],["permissions",be()],["verifyArgs",gill.getOptionEncoder(O())],["userArgs",$e()],["delegateOperation",Ee()]])}function mr(){return gill.getStructDecoder([["memberKey",K()],["permissions",ve()],["verifyArgs",gill.getOptionDecoder(L())],["userArgs",Qe()],["delegateOperation",Re()]])}function uC(){return gill.combineCodec(yr(),mr())}function pr(){return gill.getStructEncoder([["programAddressIndex",gill.getU8Encoder()],["accountIndices",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["data",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function Tr(){return gill.getStructDecoder([["programAddressIndex",gill.getU8Decoder()],["accountIndices",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["data",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function yC(){return gill.combineCodec(pr(),Tr())}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 lC(){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 IC(){return gill.combineCodec(st(),ot())}function Ir(){return gill.getStructEncoder([["a",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["b",gill.fixEncoderSize(gill.getBytesEncoder(),64)],["c",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function Cr(){return gill.getStructDecoder([["a",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["b",gill.fixDecoderSize(gill.getBytesDecoder(),64)],["c",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function MC(){return gill.combineCodec(Ir(),Cr())}function ct(){return gill.getStructEncoder([["data",gill.getOptionEncoder(at())]])}function j(){return gill.getStructDecoder([["data",gill.getOptionDecoder(it())]])}function RC(){return gill.combineCodec(ct(),j())}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 WC(){return gill.combineCodec(at(),it())}function At(){return gill.getDiscriminatedUnionEncoder([["EditPermissions",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(hr())])]])],["AddMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(yr())])]])],["RemoveMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Er())])]])],["SetThreshold",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getU8Encoder()])]])]])}function gt(){return gill.getDiscriminatedUnionDecoder([["EditPermissions",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(Pr())])]])],["AddMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(mr())])]])],["RemoveMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(Rr())])]])],["SetThreshold",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getU8Decoder()])]])]])}function BC(){return gill.combineCodec(At(),gt())}function wC(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function kC(e,n){return n.__kind===e}function br(){return gill.getStructEncoder([["member",gill.getAddressEncoder()],["role",Ue()],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userCreationArgs",de()]])}function vr(){return gill.getStructDecoder([["member",gill.getAddressDecoder()],["role",We()],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userCreationArgs",ue()]])}function GC(){return gill.combineCodec(br(),vr())}var Ht=(s=>(s[s.Add=0]="Add",s[s.Remove=1]="Remove",s[s.Ignore=2]="Ignore",s))(Ht||{});function Ee(){return gill.getEnumEncoder(Ht)}function Re(){return gill.getEnumDecoder(Ht)}function KC(){return gill.combineCodec(Ee(),Re())}function hr(){return gill.getStructEncoder([["memberKey",z()],["permissions",be()],["userArgs",gill.getOptionEncoder(Ae())],["delegateOperation",Ee()]])}function Pr(){return gill.getStructDecoder([["memberKey",K()],["permissions",ve()],["userArgs",gill.getOptionDecoder(ge())],["delegateOperation",Re()]])}function ZC(){return gill.combineCodec(hr(),Pr())}function Ur(){return gill.getStructEncoder([["settingsMutArgs",fe()],["transactionManager",gill.getOptionEncoder(Ae())]])}function Wr(){return gill.getStructDecoder([["settingsMutArgs",Se()],["transactionManager",gill.getOptionDecoder(ge())]])}function QC(){return gill.combineCodec(Ur(),Wr())}function dt(){return gill.getStructEncoder([["pubkey",z()],["permissions",be()],["role",gill.getU8Encoder()],["userAddressTreeIndex",gill.getU8Encoder()]])}function ut(){return gill.getStructDecoder([["pubkey",K()],["permissions",ve()],["role",gill.getU8Decoder()],["userAddressTreeIndex",gill.getU8Decoder()]])}function nD(){return gill.combineCodec(dt(),ut())}function z(){return gill.getStructEncoder([["keyType",gill.getU8Encoder()],["key",gill.fixEncoderSize(gill.getBytesEncoder(),33)]])}function K(){return gill.getStructDecoder([["keyType",gill.getU8Decoder()],["key",gill.fixDecoderSize(gill.getBytesDecoder(),33)]])}function cD(){return gill.combineCodec(z(),K())}function _r(){return gill.getStructEncoder([["authorityCreationArgs",de()],["compressedProofArgs",D()]])}function Or(){return gill.getStructDecoder([["authorityCreationArgs",ue()],["compressedProofArgs",M()]])}function uD(){return gill.combineCodec(_r(),Or())}function yt(){return gill.getStructEncoder([["addressMerkleTreePubkeyIndex",gill.getU8Encoder()],["addressQueuePubkeyIndex",gill.getU8Encoder()],["rootIndex",gill.getU16Encoder()]])}function mt(){return gill.getStructDecoder([["addressMerkleTreePubkeyIndex",gill.getU8Decoder()],["addressQueuePubkeyIndex",gill.getU8Decoder()],["rootIndex",gill.getU16Decoder()]])}function yD(){return gill.combineCodec(yt(),mt())}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 TD(){return gill.combineCodec(rt(),nt())}function be(){return gill.getStructEncoder([["mask",gill.getU8Encoder()]])}function ve(){return gill.getStructDecoder([["mask",gill.getU8Decoder()]])}function SD(){return gill.combineCodec(be(),ve())}function D(){return gill.getStructEncoder([["proof",gill.getOptionEncoder(Ir())],["lightCpiAccountsStartIndex",gill.getU8Encoder()]])}function M(){return gill.getStructDecoder([["proof",gill.getOptionDecoder(Cr())],["lightCpiAccountsStartIndex",gill.getU8Decoder()]])}function DD(){return gill.combineCodec(D(),M())}function Er(){return gill.getStructEncoder([["memberKey",z()],["userArgs",$e()]])}function Rr(){return gill.getStructDecoder([["memberKey",K()],["userArgs",Qe()]])}function ED(){return gill.combineCodec(Er(),Rr())}function Lr(){return gill.getTupleEncoder([gill.fixEncoderSize(gill.getBytesEncoder(),33)])}function pt(){return gill.getTupleDecoder([gill.fixDecoderSize(gill.getBytesDecoder(),33)])}function vD(){return gill.combineCodec(Lr(),pt())}function O(){return gill.getStructEncoder([["signedMessageIndex",gill.getU8Encoder()],["slotNumber",gill.getU64Encoder()],["originIndex",gill.getU8Encoder()],["crossOrigin",gill.getBooleanEncoder()],["truncatedClientDataJson",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function L(){return gill.getStructDecoder([["signedMessageIndex",gill.getU8Decoder()],["slotNumber",gill.getU64Decoder()],["originIndex",gill.getU8Decoder()],["crossOrigin",gill.getBooleanDecoder()],["truncatedClientDataJson",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function _D(){return gill.combineCodec(O(),L())}function Y(){return gill.getStructEncoder([["domainConfigKey",gill.getAddressEncoder()],["verifyArgs",O()]])}function Z(){return gill.getStructDecoder([["domainConfigKey",gill.getAddressDecoder()],["verifyArgs",L()]])}function wD(){return gill.combineCodec(Y(),Z())}function Tt(){return gill.getStructEncoder([["addressTreeInfo",yt()],["outputStateTreeIndex",gill.getU8Encoder()]])}function lt(){return gill.getStructDecoder([["addressTreeInfo",mt()],["outputStateTreeIndex",gill.getU8Decoder()]])}function VD(){return gill.combineCodec(Tt(),lt())}function Br(){return gill.getStructEncoder([["index",gill.getU128Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()]])}function wr(){return gill.getStructDecoder([["index",gill.getU128Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()]])}function zD(){return gill.combineCodec(Br(),wr())}function fe(){return gill.getStructEncoder([["accountMeta",et()],["data",ct()]])}function Se(){return gill.getStructDecoder([["accountMeta",tt()],["data",j()]])}function YD(){return gill.combineCodec(fe(),Se())}function X(){return gill.getStructEncoder([["accountMeta",st()],["data",ct()]])}function $(){return gill.getStructDecoder([["accountMeta",ot()],["data",j()]])}function $D(){return gill.combineCodec(X(),$())}function ft(){return gill.getStructEncoder([["bufferIndex",gill.getU8Encoder()],["preauthorizeExecution",gill.getBooleanEncoder()],["bufferExtendHashes",gill.getArrayEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))],["finalBufferHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["finalBufferSize",gill.getU16Encoder()],["expectedSigners",gill.getArrayEncoder(z())]])}function St(){return gill.getStructDecoder([["bufferIndex",gill.getU8Decoder()],["preauthorizeExecution",gill.getBooleanDecoder()],["bufferExtendHashes",gill.getArrayDecoder(gill.fixDecoderSize(gill.getBytesDecoder(),32))],["finalBufferHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["finalBufferSize",gill.getU16Decoder()],["expectedSigners",gill.getArrayDecoder(K())]])}function rM(){return gill.combineCodec(ft(),St())}function xt(){return gill.getStructEncoder([["numSigners",gill.getU8Encoder()],["numWritableSigners",gill.getU8Encoder()],["numWritableNonSigners",gill.getU8Encoder()],["numAccountKeys",gill.getU8Encoder()],["instructions",gill.getArrayEncoder(pr())],["addressTableLookups",gill.getArrayEncoder(kr())]])}function It(){return gill.getStructDecoder([["numSigners",gill.getU8Decoder()],["numWritableSigners",gill.getU8Decoder()],["numWritableNonSigners",gill.getU8Decoder()],["numAccountKeys",gill.getU8Decoder()],["instructions",gill.getArrayDecoder(Tr())],["addressTableLookups",gill.getArrayDecoder(Nr())]])}function cM(){return gill.combineCodec(xt(),It())}function kr(){return gill.getStructEncoder([["lookupTableAddressIndex",gill.getU8Encoder()],["writableIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["readonlyIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function Nr(){return gill.getStructDecoder([["lookupTableAddressIndex",gill.getU8Decoder()],["writableIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["readonlyIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function dM(){return gill.combineCodec(kr(),Nr())}function _e(){return gill.getStructEncoder([["member",z()],["domainConfig",gill.getOptionEncoder(gill.getAddressEncoder())],["role",Ue()],["delegatedTo",gill.getOptionEncoder(Br())],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userAddressTreeIndex",gill.getU8Encoder()]])}function q(){return gill.getStructDecoder([["member",K()],["domainConfig",gill.getOptionDecoder(gill.getAddressDecoder())],["role",We()],["delegatedTo",gill.getOptionDecoder(wr())],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userAddressTreeIndex",gill.getU8Decoder()]])}function yM(){return gill.combineCodec(_e(),q())}function de(){return gill.getStructEncoder([["addressTreeInfo",yt()],["outputStateTreeIndex",gill.getU8Encoder()]])}function ue(){return gill.getStructDecoder([["addressTreeInfo",mt()],["outputStateTreeIndex",gill.getU8Decoder()]])}function lM(){return gill.combineCodec(de(),ue())}function Ae(){return gill.getStructEncoder([["accountMeta",et()],["data",_e()]])}function ge(){return gill.getStructDecoder([["accountMeta",tt()],["data",q()]])}function IM(){return gill.combineCodec(Ae(),ge())}function Gr(){return gill.getStructEncoder([["accountMeta",st()],["data",_e()]])}function Fr(){return gill.getStructDecoder([["accountMeta",ot()],["data",q()]])}function hM(){return gill.combineCodec(Gr(),Fr())}function $e(){return gill.getDiscriminatedUnionEncoder([["Read",gill.getStructEncoder([["fields",gill.getTupleEncoder([Gr()])]])],["Mutate",gill.getStructEncoder([["fields",gill.getTupleEncoder([Ae()])]])]])}function Qe(){return gill.getDiscriminatedUnionDecoder([["Read",gill.getStructDecoder([["fields",gill.getTupleDecoder([Fr()])]])],["Mutate",gill.getStructDecoder([["fields",gill.getTupleDecoder([ge()])]])]])}function bM(){return gill.combineCodec($e(),Qe())}function vM(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function UM(e,n){return n.__kind===e}var Ve=(t=>(t[t.Member=0]="Member",t[t.PermanentMember=1]="PermanentMember",t[t.TransactionManager=2]="TransactionManager",t[t.Administrator=3]="Administrator",t))(Ve||{});function Ue(){return gill.getEnumEncoder(Ve)}function We(){return gill.getEnumDecoder(Ve)}function OM(){return gill.combineCodec(Ue(),We())}var Os=new Uint8Array([223,179,163,190,177,224,67,173]);function Ih(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Os)}function Dy(){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:Os}))}function Ls(){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 Ch(){return gill.combineCodec(Dy(),Ls())}function Bs(e){return gill.decodeAccount(e,Ls())}async function Dh(e,n,r){let s=await Jr(e,n,r);return gill.assertAccountExists(s),s}async function Jr(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Bs(s)}async function Mh(e,n,r){let s=await My(e,n,r);return gill.assertAccountsExist(s),s}async function My(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Bs(t))}function hh(){return 184}var Vs=new Uint8Array([90,36,35,219,93,225,110,96]);function bh(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Vs)}function Gy(){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",z()],["executor",z()],["bufferExtendHashes",gill.getArrayEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))],["voters",gill.getArrayEncoder(z())],["expectedSigners",gill.getArrayEncoder(z())],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:Vs}))}function Gs(){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",K()],["executor",K()],["bufferExtendHashes",gill.getArrayDecoder(gill.fixDecoderSize(gill.getBytesDecoder(),32))],["voters",gill.getArrayDecoder(K())],["expectedSigners",gill.getArrayDecoder(K())],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function vh(){return gill.combineCodec(Gy(),Gs())}function Fs(e){return gill.decodeAccount(e,Gs())}async function zs(e,n,r){let s=await Fy(e,n,r);return gill.assertAccountExists(s),s}async function Fy(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Fs(s)}async function Uh(e,n,r){let s=await zy(e,n,r);return gill.assertAccountsExist(s),s}async function zy(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Fs(t))}var js=new Uint8Array([105,23,173,2,197,255,80,87]);function Oh(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(js)}function im(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["whitelistedAddressTrees",gill.getArrayEncoder(gill.getAddressEncoder())],["bump",gill.getU8Encoder()]]),e=>({...e,discriminator:js}))}function Ys(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["whitelistedAddressTrees",gill.getArrayDecoder(gill.getAddressDecoder())],["bump",gill.getU8Decoder()]])}function Lh(){return gill.combineCodec(im(),Ys())}function Zs(e){return gill.decodeAccount(e,Ys())}async function qs(e,n,r){let s=await dm(e,n,r);return gill.assertAccountExists(s),s}async function dm(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Zs(s)}async function Bh(e,n,r){let s=await um(e,n,r);return gill.assertAccountsExist(s),s}async function um(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Zs(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 $s(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}function V(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:V(r.value),role:Xs(r.value)?gill.upgradeRoleToSigner(s):s,...Xs(r.value)?{signer:r.value}:{}})}}function Xs(e){return !!e&&typeof e=="object"&&"address"in e&&gill.isTransactionSigner(e)}var eo=new Uint8Array([7]);function Qh(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(eo)}function en(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["addressTree",gill.getAddressEncoder()]]),e=>({...e,discriminator:eo}))}function to(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["addressTree",gill.getAddressDecoder()]])}function eP(){return gill.combineCodec(en(),to())}async function ro(e,n){let r=n?.programAddress??u,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:en().encode(c),programAddress:r})}function tP(e,n){let r=n?.programAddress??u,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:en().encode(c),programAddress:r})}function rP(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:to().decode(e.data)}}var co=new Uint8Array([8]);function dP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(co)}function tn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsIndex",gill.getU128Encoder()],["configActions",gill.getArrayEncoder(At())],["compressedProofArgs",gill.getOptionEncoder(D())]]),e=>({...e,discriminator:co}))}function ao(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsIndex",gill.getU128Decoder()],["configActions",gill.getArrayDecoder(gt())],["compressedProofArgs",gill.getOptionDecoder(M())]])}function uP(){return gill.combineCodec(tn(),ao())}async function io(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.settings.value||(t.settings.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getU128Encoder().encode($s(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(V(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:tn().encode(c),programAddress:r})}function AP(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=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:tn().encode(c),programAddress:r})}function gP(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),authority:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:ao().decode(e.data)}}var go=new Uint8Array([19]);function SP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(go)}function yo(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["configActions",gill.getArrayEncoder(At())],["settingsMut",fe()],["compressedProofArgs",D()]]),e=>({...e,discriminator:go}))}function mo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["configActions",gill.getArrayDecoder(gt())],["settingsMut",Se()],["compressedProofArgs",M()]])}function xP(){return gill.combineCodec(yo(),mo())}function po(e,n){let r=n?.programAddress??u,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:yo().encode(c),programAddress:r})}function IP(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===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),authority:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:mo().decode(e.data)}}var fo=new Uint8Array([16]);function RP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(fo)}function So(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",D()],["settingsMutArgs",fe()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())]]),e=>({...e,discriminator:fo}))}function xo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",M()],["settingsMutArgs",Se()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())]])}function bP(){return gill.combineCodec(So(),xo())}function Io(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},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:So().encode(c),programAddress:r})}function vP(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===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:xo().decode(e.data)}}var Do=new Uint8Array([0]);function wP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Do)}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()))],["metadataUrl",gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())],["authorityCreationArgs",de()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Do}))}function Mo(){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",ue()],["compressedProofArgs",M()]])}function kP(){return gill.combineCodec(un(),Mo())}async function ho(e,n){let r=n?.programAddress??u,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=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:un().encode(c),programAddress:r})}function NP(e,n){let r=n?.programAddress??u,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=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:un().encode(c),programAddress:r})}function HP(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:Mo().decode(e.data)}}var Eo=new Uint8Array([4]);function jP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Eo)}function gn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",D()],["member",Lr()],["role",Ue()],["userAccountCreationArgs",de()],["linkWalletArgs",gill.getOptionEncoder(Ur())]]),e=>({...e,discriminator:Eo}))}function Ro(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",M()],["member",pt()],["role",We()],["userAccountCreationArgs",ue()],["linkWalletArgs",gill.getOptionDecoder(Wr())]])}function YP(){return gill.combineCodec(gn(),Ro())}async function bo(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:gn().encode(c),programAddress:r})}function ZP(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:gn().encode(c),programAddress:r})}function qP(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:Ro().decode(e.data)}}var Uo=new Uint8Array([3]);function rE(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Uo)}function mn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:Uo}))}function Wo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function nE(){return gill.combineCodec(mn(),Wo())}async function _o(e,n){let r=n?.programAddress??u,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(c),i=p(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:mn().encode({}),programAddress:r})}function sE(e,n){let r=n?.programAddress??u,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(c),i=p(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:mn().encode({}),programAddress:r})}function oE(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 Bo=new Uint8Array([18]);function gE(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Bo)}function pn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(O())],["compressedProofArgs",D()],["settingsCreation",Tt()],["userMutArgs",Ae()],["settingsIndex",gill.getU128Encoder()],["delegateOperation",Ee()]]),e=>({...e,discriminator:Bo}))}function wo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(L())],["compressedProofArgs",M()],["settingsCreation",lt()],["userMutArgs",ge()],["settingsIndex",gill.getU128Decoder()],["delegateOperation",Re()]])}function yE(){return gill.combineCodec(pn(),wo())}async function ko(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},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:pn().encode(c),programAddress:r})}function mE(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},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:pn().encode(c),programAddress:r})}function pE(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s(),globalCounter:r(),whitelistedAddressTrees:r()},data:wo().decode(e.data)}}var Ho=new Uint8Array([5]);function CE(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ho)}function ln(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",D()],["createUserArgs",gill.getArrayEncoder(br())]]),e=>({...e,discriminator:Ho}))}function Vo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",M()],["createUserArgs",gill.getArrayDecoder(vr())]])}function DE(){return gill.combineCodec(ln(),Vo())}async function Go(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:ln().encode(c),programAddress:r})}function ME(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:ln().encode(c),programAddress:r})}function hE(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:Vo().decode(e.data)}}var Ko=new Uint8Array([17]);function WE(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ko)}function Jo(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsMut",fe()],["compressedProofArgs",D()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())]]),e=>({...e,discriminator:Ko}))}function jo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsMut",Se()],["compressedProofArgs",M()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())]])}function _E(){return gill.combineCodec(Jo(),jo())}function Yo(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=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:Jo().encode(c),programAddress:r})}function OE(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:jo().decode(e.data)}}var Xo=new Uint8Array([2]);function HE(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Xo)}function $o(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["disable",gill.getBooleanEncoder()]]),e=>({...e,discriminator:Xo}))}function Qo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["disable",gill.getBooleanDecoder()]])}function VE(){return gill.combineCodec($o(),Qo())}function ec(e,n){let r=n?.programAddress??u,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},i=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),...i],data:$o().encode(c),programAddress:r})}function GE(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:Qo().decode(e.data)}}var ic=new Uint8Array([1]);function ZE(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ic)}function In(){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(_r())],["newMetadataUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))]]),e=>({...e,discriminator:ic}))}function dc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["newOrigins",gill.getOptionDecoder(gill.getArrayDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())))],["newAuthorityArgs",gill.getOptionDecoder(Or())],["newMetadataUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))]])}function qE(){return gill.combineCodec(In(),dc())}async function XE(e,n){let r=n?.programAddress??u,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=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:In().encode(c),programAddress:r})}function uc(e,n){let r=n?.programAddress??u,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=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:In().encode(c),programAddress:r})}function $E(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:s(),whitelistedAddressTrees:s(),systemProgram:r()},data:dc().decode(e.data)}}var yc=new Uint8Array([6]);function oR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(yc)}function mc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",Ae()],["transactionManagerUrl",gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())],["compressedProofArgs",D()]]),e=>({...e,discriminator:yc}))}function pc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",ge()],["transactionManagerUrl",gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())],["compressedProofArgs",M()]])}function cR(){return gill.combineCodec(mc(),pc())}function Tc(e,n){let r=n?.programAddress??u,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:mc().encode(c),programAddress:r})}function aR(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:pc().decode(e.data)}}var Sc=new Uint8Array([32]);function mR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Sc)}function xc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",at()],["compressedProofArgs",D()],["settingsCreationArgs",Tt()]]),e=>({...e,discriminator:Sc}))}function Ic(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",it()],["compressedProofArgs",M()],["settingsCreationArgs",lt()]])}function pR(){return gill.combineCodec(xc(),Ic())}function TR(e,n){let r=n?.programAddress??u,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.authority),...i],data:xc().encode(c),programAddress:r})}function lR(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:Ic().decode(e.data)}}var Mc=new Uint8Array([31]);function MR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Mc)}function hc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",_e()],["compressedProofArgs",D()],["userCreationArgs",de()]]),e=>({...e,discriminator:Mc}))}function Pc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",q()],["compressedProofArgs",M()],["userCreationArgs",ue()]])}function hR(){return gill.combineCodec(hc(),Pc())}function PR(e,n){let r=n?.programAddress??u,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.authority),...i],data:hc().encode(c),programAddress:r})}function ER(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:Pc().decode(e.data)}}var Rc=new Uint8Array([29]);function OR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Rc)}function Cn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())]]),e=>({...e,discriminator:Rc}))}function bc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())]])}function LR(){return gill.combineCodec(Cn(),bc())}async function BR(e,n){let r=n?.programAddress??u,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(V(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:Cn().encode(c),programAddress:r})}function vc(e,n){let r=n?.programAddress??u,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:Cn().encode(c),programAddress:r})}function wR(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:bc().decode(e.data)}}var _c=new Uint8Array([27]);function zR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(_c)}function Oc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())],["settingsReadonlyArgs",X()],["compressedProofArgs",D()]]),e=>({...e,discriminator:_c}))}function Lc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())],["settingsReadonlyArgs",$()],["compressedProofArgs",M()]])}function KR(){return gill.combineCodec(Oc(),Lc())}function Bc(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=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:Oc().encode(c),programAddress:r})}function JR(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Lc().decode(e.data)}}var kc=new Uint8Array([30]);function QR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(kc)}function Mn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())]]),e=>({...e,discriminator:kc}))}function Nc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())]])}function eb(){return gill.combineCodec(Mn(),Nc())}async function tb(e,n){let r=n?.programAddress??u,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(V(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(V(t.source.value)),gill.getAddressEncoder().encode(V(t.tokenProgram.value)),gill.getAddressEncoder().encode(V(t.mint.value))]})),t.destinationTokenAccount.value||(t.destinationTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(V(t.destination.value)),gill.getAddressEncoder().encode(V(t.tokenProgram.value)),gill.getAddressEncoder().encode(V(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:Mn().encode(c),programAddress:r})}function Hc(e,n){let r=n?.programAddress??u,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:Mn().encode(c),programAddress:r})}function rb(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===u?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:Nc().decode(e.data)}}var zc=new Uint8Array([28]);function db(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(zc)}function hn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())],["settingsReadonlyArgs",X()],["compressedProofArgs",D()]]),e=>({...e,discriminator:zc}))}function Kc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())],["settingsReadonlyArgs",$()],["compressedProofArgs",M()]])}function ub(){return gill.combineCodec(hn(),Kc())}async function Ab(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},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(V(t.source.value)),gill.getAddressEncoder().encode(V(t.tokenProgram.value)),gill.getAddressEncoder().encode(V(t.mint.value))]})),t.destinationTokenAccount.value||(t.destinationTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(V(t.destination.value)),gill.getAddressEncoder().encode(V(t.tokenProgram.value)),gill.getAddressEncoder().encode(V(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:hn().encode(c),programAddress:r})}function Jc(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},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:hn().encode(c),programAddress:r})}function gb(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===u?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:Kc().decode(e.data)}}var Zc=new Uint8Array([12]);function Sb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Zc)}function qc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(O())]]),e=>({...e,discriminator:Zc}))}function Xc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(L())]])}function xb(){return gill.combineCodec(qc(),Xc())}function $c(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},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:qc().encode(c),programAddress:r})}function Ib(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:Xc().decode(e.data)}}var ta=new Uint8Array([23]);function Rb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ta)}function ra(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(O())],["settingsReadonlyArgs",X()],["compressedProofArgs",D()]]),e=>({...e,discriminator:ta}))}function na(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(L())],["settingsReadonlyArgs",$()],["compressedProofArgs",M()]])}function bb(){return gill.combineCodec(ra(),na())}function sa(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=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:ra().encode(c),programAddress:r})}function vb(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:na().decode(e.data)}}var aa=new Uint8Array([9]);function wb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(aa)}function ia(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",ft()],["secp256r1VerifyArgs",gill.getOptionEncoder(O())]]),e=>({...e,discriminator:aa}))}function da(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",St()],["secp256r1VerifyArgs",gill.getOptionDecoder(L())]])}function kb(){return gill.combineCodec(ia(),da())}function ua(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=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:ia().encode(c),programAddress:r})}function Nb(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:da().decode(e.data)}}var ya=new Uint8Array([20]);function Jb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ya)}function ma(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",ft()],["secp256r1VerifyArgs",gill.getOptionEncoder(O())],["settingsReadonlyArgs",X()],["compressedProofArgs",D()]]),e=>({...e,discriminator:ya}))}function pa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",St()],["secp256r1VerifyArgs",gill.getOptionDecoder(L())],["settingsReadonlyArgs",$()],["compressedProofArgs",M()]])}function jb(){return gill.combineCodec(ma(),pa())}function Ta(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=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:ma().encode(c),programAddress:r})}function Yb(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:pa().decode(e.data)}}var Sa=new Uint8Array([13]);function tv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Sa)}function xa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(O())]]),e=>({...e,discriminator:Sa}))}function Ia(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(L())]])}function rv(){return gill.combineCodec(xa(),Ia())}function Ca(e,n){let r=n?.programAddress??u,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:xa().encode(c),programAddress:r})}function nv(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ia().decode(e.data)}}var ha=new Uint8Array([24]);function uv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ha)}function Pa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(O())],["settingsReadonlyArgs",X()],["compressedProofArgs",D()]]),e=>({...e,discriminator:ha}))}function Ea(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(L())],["settingsReadonlyArgs",$()],["compressedProofArgs",M()]])}function Av(){return gill.combineCodec(Pa(),Ea())}function Ra(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=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:Pa().encode(c),programAddress:r})}function gv(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ea().decode(e.data)}}var Ua=new Uint8Array([11]);function fv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ua)}function Wa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:Ua}))}function _a(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function Sv(){return gill.combineCodec(Wa(),_a())}function Oa(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.transactionBuffer),...i],data:Wa().encode(c),programAddress:r})}function xv(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:_a().decode(e.data)}}var wa=new Uint8Array([22]);function Pv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(wa)}function ka(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:wa}))}function Na(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["settingsKey",gill.getAddressDecoder()]])}function Ev(){return gill.combineCodec(ka(),Na())}function Ha(e,n){let r=n?.programAddress??u,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:ka().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:{transactionBuffer:r()},data:Na().decode(e.data)}}var Fa=new Uint8Array([10]);function Lv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Fa)}function za(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(O())]]),e=>({...e,discriminator:Fa}))}function Ka(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(L())]])}function Bv(){return gill.combineCodec(za(),Ka())}function Ja(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=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:za().encode(c),programAddress:r})}function wv(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ka().decode(e.data)}}var Za=new Uint8Array([21]);function zv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Za)}function qa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(O())],["settingsReadonlyArgs",X()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Za}))}function Xa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(L())],["settingsReadonlyArgs",$()],["compressedProofArgs",M()]])}function Kv(){return gill.combineCodec(qa(),Xa())}function $a(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=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:qa().encode(c),programAddress:r})}function Jv(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Xa().decode(e.data)}}var ti=new Uint8Array([14]);function $v(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ti)}function ri(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:ti}))}function ni(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function Qv(){return gill.combineCodec(ri(),ni())}function si(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},a=m({}),i=p(r);return Object.freeze({accounts:[i(t.settings),i(t.payer),i(t.transactionBuffer),...a],data:ri().encode({}),programAddress:r})}function eU(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:ni().decode(e.data)}}var ai=new Uint8Array([25]);function cU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ai)}function ii(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:ai}))}function di(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsKey",gill.getAddressDecoder()]])}function aU(){return gill.combineCodec(ii(),di())}function ui(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.transactionBuffer),...i],data:ii().encode(c),programAddress:r})}function iU(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:di().decode(e.data)}}var yi=new Uint8Array([15]);function pU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(yi)}function mi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",xt()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())]]),e=>({...e,discriminator:yi}))}function pi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",It()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())]])}function TU(){return gill.combineCodec(mi(),pi())}function Ti(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:mi().encode(c),programAddress:r})}function lU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:pi().decode(e.data)}}var Si=new Uint8Array([26]);function MU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Si)}function xi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",xt()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())],["settingsReadonlyArgs",X()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Si}))}function Ii(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",It()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())],["settingsReadonlyArgs",$()],["compressedProofArgs",M()]])}function hU(){return gill.combineCodec(xi(),Ii())}function Ci(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:xi().encode(c),programAddress:r})}function PU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Ii().decode(e.data)}}var u="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",vS=(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))(vS||{});function uW(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 US=(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))(US||{});function AW(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 _S=6e3,OS=6001,LS=6002,BS=6003,wS=6004,kS=6005,NS=6006,HS=6007,VS=6008,GS=6009,FS=6010,zS=6011,KS=6012,JS=6013,jS=6014,YS=6015,ZS=6016,qS=6017,XS=6018,$S=6019,QS=6020,ex=6021,tx=6022,rx=6023,nx=6024,sx=6025,ox=6026,cx=6027,ax=6028,ix=6029,dx=6030,ux=6031,Ax=6032,gx=6033,yx=6034,mx=6035,px=6036,Tx=6037,lx=6038,fx=6039,Sx=6040,xx=6041,Di;process.env.NODE_ENV!=="production"&&(Di={[XS]:"This member is already delegated to another wallet.",[px]:"The domain configuration account is disabled. Please contact support or try again later.",[Tx]:"Missing domain configuration account.",[BS]:"Duplicate public keys detected among members. Each member must have a unique key.",[LS]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[GS]:"No members provided. A multisig wallet must contain at least one member.",[ox]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[cx]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[ax]:"Declared buffer size does not match the actual serialized size.",[ex]:"Not enough members with vote permission to meet the approval threshold.",[$S]:"At least one signer with execute permission is required to proceed.",[QS]:"At least one signer with initiate permission is required to perform this action.",[jS]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[xx]:"Address Tree supplied is not part of the whitelisted address trees",[YS]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[sx]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[JS]:"Unexpected number of accounts provided for this instruction.",[OS]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[_S]:"Invalid signature: the provided signature does not match the expected message payload.",[yx]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[zS]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[KS]:"Malformed transaction message: structure or formatting does not match the expected layout.",[Ax]:"An input string exceeds the maximum allowed character length.",[lx]:"This member is not registered under the provided domain configuration.",[ZS]:"A required account is missing from the instruction context.",[gx]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[qS]:"User mutation arguments are required when performing add or remove delegate operations.",[rx]:"No valid signer found in this transaction.",[NS]:"Only one permanent member is allowed per wallet.",[HS]:"Only one transaction manager is allowed per wallet.",[Sx]:"The given origin index is not in the whitelisted origins.",[wS]:"Permanent members cannot be removed from a wallet.",[kS]:"This operation cannot assign a permanent member.",[ux]:"Writable CPI calls to protected accounts are not permitted.",[fx]:"The relying party ID hash does not match the one defined in the domain configuration.",[mx]:"The specified slot number was not found in the provided slot history.",[FS]:"Too many members: a maximum of 4 members are supported.",[ix]:"This transaction has expired. It must be executed within 3 minutes of approval.",[VS]:"Unable to assign a transaction manager.",[dx]:"This transaction has not yet reached the required approval threshold.",[nx]:"Only the transaction creator or rent payer may close this transaction buffer.",[tx]:"Member is not part of the expected signers for this transaction."});function lW(e){return process.env.NODE_ENV!=="production"?Di[e]:"Error message not available in production bundles."}function fW(e,n,r){return gill.isProgramError(e,n,u,r)}var Pt={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 Rn=33,ae=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!==Rn)throw new Error(`Invalid public key length, expected ${Rn} 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===Rn)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()}},h=class extends ae{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 Dx(){return gill.getStructCodec([["programAddressIndex",gill.getU8Codec()],["accountIndices",gill.getArrayCodec(gill.getU8Codec())],["data",gill.getArrayCodec(gill.getU8Codec())]])}function Mx(){return gill.getStructCodec([["lookupTableAddress",gill.getAddressCodec()],["writableIndexes",gill.getArrayCodec(gill.getU8Codec())],["readonlyIndexes",gill.getArrayCodec(gill.getU8Codec())]])}var hi=gill.getStructCodec([["numSigners",gill.getU8Codec()],["numWritableSigners",gill.getU8Codec()],["numWritableNonSigners",gill.getU8Codec()],["accountKeys",gill.getArrayCodec(gill.getAddressCodec())],["instructions",gill.getArrayCodec(Dx())],["addressTableLookups",gill.getArrayCodec(Mx())]]);function Pi(e){return hi.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 Ei(e){let n=hi.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})),staticAccounts:n.accountKeys,version:0}}stateless_js.featureFlags.version=stateless_js.VERSION.V2;var Ri="revibase.com",bi="https://auth.revibase.com",vi="https://api.revibase.com";async function Un(e,n=false){let r=n?{blockhash:gill.getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await Q().getLatestBlockhash().send()).value;return await Promise.all(e.map(async 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 _i(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 Oi(e,n){if(e.length===0)throw new Error("Bundle is empty.");for(let c=0;c<e.length;c++){if(e[c].length>1644)throw new Error(`Transaction ${c} exceeds maximum length, ${e[c].length}. Retry again.`);console.log(`Transaction ${c} length: ${e[c].length}`);}let r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:"2",method:"simulateBundle",params:[{encodedTransactions:e},{skipSigVerify:true,replaceRecentBlockhash:true,preExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]})),postExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]}))}]})});if(!r.ok)throw console.error(await r.json()),new Error("Failed to simulate bundle");let{result:s,error:t}=await r.json();if(!s||t)throw console.error(t??s),new Error(`Unable to simulate bundle: ${JSON.stringify(t??s)}`);if(typeof s.value.summary!="string"&&s.value.summary.failed){let{TransactionFailure:c}=s.value.summary.failed.error,[,a]=c;throw console.error(t??s),new Error(`Simulation failed: ${a}`)}return s.value.transactionResults.map(c=>c.unitsConsumed)}function k(e,n=0){let r=e instanceof h?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 Fe(e){if(e instanceof ae)return {keyType:Pt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:Pt.Ed25519,key:new Uint8Array([0,...gill.getAddressEncoder().encode(n)])}}}function Wi(e){return e instanceof h?e.toString():e.address.toString()}function ye(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 h).length>1)throw new Error("More than 1 Secp256r1 signers in an instruction is not supported.");return r}function Li({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 Bi(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 ze=null,Zt=null,qt=null,Xt=null,$t,Yt=null,Wn=null,Qt=null,_n=null,On=null,Ln=null,wi=null;function ki(){if(!ze)throw new Error("Rpc is not initialized yet.");return ze}function Et(){if(!Zt)throw new Error("Rpc is not initialized yet");return Zt}function Q(){if(!qt)throw new Error("Rpc is not initialized yet");return qt}function Ni(){if(!Xt)throw new Error("Rpc is not initialized yet.");return Xt}function Hi(){if(!$t)throw new Error("Rpc is not initialized yet");return $t}async function c_(){return Yt||(Yt=await Bi(Wn??vi)),Yt}function Bn(){if(!Qt)throw new Error("Jito Bundle Config is not set.");return Qt}function he(){return _n??bi}function Vi(){return On??Ri}function Gi(){return Ln}function er(){return wi}function a_(){Zt=null,qt=null,ze=null,Yt=null,Wn=null,Qt=null,_n=null,On=null,Xt=null,$t=null,Ln=null;}function i_({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s,apiEndpoint:t,authEndpoint:c,rpId:a,authorizedClient:i,additionalInfo:o}){ze=e,Zt=stateless_js.createRpc(ze,r,n);let{rpc:d,sendAndConfirmTransaction:A}=gill.createSolanaClient({urlOrMoniker:ze});Xt=A,$t=programs.estimateComputeUnitLimitFactory({rpc:d}),qt=d,Wn=t??null,Qt=s??null,_n=c??null,On=a??null,Ln=i??null,wi=o??null;}var N=class{preAccounts;systemAccounts;nextIndex;map;outputTreeIndex;constructor(){this.preAccounts=[],this.systemAccounts=[],this.nextIndex=0,this.map=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){this.preAccounts.push(...n);}getAccountRole(n,r){return n?r?gill.AccountRole.WRITABLE_SIGNER:gill.AccountRole.READONLY_SIGNER:r?gill.AccountRole.WRITABLE:gill.AccountRole.READONLY}async addSystemAccounts(){this.systemAccounts.push(...stateless_js.getLightSystemAccountMetasV2({selfProgram:new web3_js.PublicKey(u.toString())}).map(n=>({address:gill.address(n.pubkey.toString()),role:this.getAccountRole(n.isSigner,n.isWritable)})));}insertOrGet(n){return this.insertOrGetConfig(n,gill.AccountRole.WRITABLE)}insertOrGetConfig(n,r){if(!this.map.has(n)){let s=this.nextIndex++,t={address:gill.address(n),role:r};this.map.set(n,{index:s,accountMeta:t});}return this.map.get(n).index}packOutputTreeIndex(n){if(n.treeType===stateless_js.TreeType.StateV1)return this.insertOrGet(n.tree.toString());if(n.treeType===stateless_js.TreeType.StateV2)return this.insertOrGet(n.queue.toString());throw new Error("Tree type not supported")}async getOutputTreeIndex(){if(this.outputTreeIndex!==-1)return this.outputTreeIndex;let n=await Et().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 tr(e,n){let r=n?.get(e.toString());if(r)return r;{let s=await Et().getCompressedAccount(e);return s&&n?.set(e.toString(),s),s}}async function se(e,n){let s=(await Promise.all(e.map(async t=>tr(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 me(e,n,r,s,t){if(t.length===0)return [];let c=t.map((d,A)=>({treeInfo:n[A],root:r[A],rootIndex:s[A],address:d.address.toArray()})),{addressTrees:a}=e.packTreeInfos([],c),i=await e.getOutputTreeIndex();return t.map((d,A)=>({addressTreeInfo:a[A],outputStateTreeIndex:i,address:d.address,type:d.type}))}function te(e,n,r,s,t,c,a){let i=[];for(let A=0;A<n.length;A++)i.push({treeInfo:n[A],rootIndex:s[A],leafIndex:r[A],proveByIndex:t[A],hash:c[A].hash});let o=e.packTreeInfos(i,[]).stateTrees;if(!o)throw new Error("Unable to parsed data.");return c.map((A,g)=>({data:a.decode(A.data.data),accountMeta:{treeInfo:o.packedTreeInfos[g],address:new Uint8Array(A.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function pe(e,n,r,s,t){let c=null,a=null,i=new N;if(e){await i.addSystemAccounts();let{address:o}=await re(n,r),d=(await se([{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 F([d],[]);let A=i.packTreeInfos([{treeInfo:a.treeInfos[0],rootIndex:a.rootIndices[0],leafIndex:a.leafIndices[0],proveByIndex:a.proveByIndices[0],hash:d.hash}],[]).stateTrees;if(!A)throw new Error("Unable to parsed data.");c={accountMeta:{address:new Uint8Array(d.address),treeInfo:A.packedTreeInfos[0]},data:j().decode(d.data?.data)};}return {settingsReadonlyArgs:c,proof:a,packedAccounts:i}}async function F(e,n,r=10,s=400){let t=1;for(;t<r;)try{return await Et().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 rr()).length-1}var wn;async function rr(){if(!wn){let{data:e}=await qs(Q(),await Ki());wn=e.whitelistedAddressTrees;}return wn}async function Ji(e,n,r){let s=await $x(e,n,r);if(!s)throw new Error("User cannot be found.");return s}async function $x(e,n,r){let{address:s}=await B(e,n),t=await tr(s,r);return t?.data?.data?q().decode(t.data.data):null}async function ji(e,n,r){let s=await Qx(e,n,r);if(!s)throw new Error("Settings cannot be found.");return s}async function Qx(e,n,r){try{let{address:s}=await re(e,n),t=await tr(s,r);if(!t?.data?.data)return null;let c=j().decode(t.data.data);return c.data.__option==="None"?null:{...c.data.value,isCompressed:!0}}catch{let s=await Jr(Q(),await ee(e));return s.exists?{...s.data,members:s.data.members.slice(0,s.data.membersLen),isCompressed:false}:null}}async function kn(e){let n=await rr();if(e<0||e>=n.length)throw new Error(`Invalid address tree index: ${e}`);return n[e]}async function nr(e){let r=(await rr()).findIndex(s=>s===e);if(r===-1)throw new Error(`Address tree not found: ${e}`);return r}async function re(e,n=0){let r=await kn(n),s=stateless_js.deriveAddressSeedV2([new Uint8Array(gill.getUtf8Encoder().encode("multi_wallet")),new Uint8Array(gill.getU128Encoder().encode(e))]);return {address:stateless_js.createBN254(stateless_js.deriveAddressV2(s,new web3_js.PublicKey(r),new web3_js.PublicKey(u)).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function B(e,n=0){let r=await kn(n),s=stateless_js.deriveAddressSeedV2([new Uint8Array(gill.getUtf8Encoder().encode("user")),e instanceof ae?e.toTruncatedBuffer():new Uint8Array(gill.getAddressEncoder().encode(e))]);return {address:stateless_js.createBN254(stateless_js.deriveAddressV2(s,new web3_js.PublicKey(r),new web3_js.PublicKey(u.toString())).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function 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:u,seeds:[gill.getUtf8Encoder().encode("domain_config"),e]});return r}async function $i(){let[e]=await gill.getProgramDerivedAddress({programAddress:u,seeds:[gill.getUtf8Encoder().encode("global_counter")]});return e}async function Ki(){let[e]=await gill.getProgramDerivedAddress({programAddress:u,seeds:[gill.getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function Qi(e,n,r){if(r>255)throw new Error("Index cannot be greater than 255.");let[s]=await gill.getProgramDerivedAddress({programAddress:u,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("transaction_buffer"),n instanceof ae?n.toTruncatedBuffer():gill.getAddressEncoder().encode(n),gill.getU8Encoder().encode(r)]});return s}async function Ie(e){let[n]=await gill.getProgramDerivedAddress({programAddress:u,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("vault")]});return n}async function ee(e){let[n]=await gill.getProgramDerivedAddress({programAddress:u,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getU128Encoder().encode(e)]});return n}async function ed(e){let n=await ee(e);return await Ie(n)}async function k_(){let[e]=await gill.getProgramDerivedAddress({programAddress:u,seeds:[gill.getUtf8Encoder().encode("cpi_authority")]});return e}var je=null,rd=2e3,nd=3e3,rI=300*1e3;async function or({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),A=setTimeout(()=>{y("Authentication timeout."),g(),a(new Error("Authentication timed out"));},rI);function g(){clearInterval(d),clearTimeout(A),o&&clearTimeout(o),je&&window.removeEventListener("message",je),s&&s.close();}if(s?s.location.replace(e):s=ad(e),!s){a(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===i,C=l.source===s;if(!I||!C||!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}},i),o=setTimeout(()=>{g(),a(new Error("User closed the authentication window"));},rd+nd);break;case "popup-complete":y("Received completion message");try{let b=JSON.parse(l.data.payload);g(),c(b);}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"));},rd+nd));break;case "popup-closed":y("Popup explicitly closed"),g(),a(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 cr(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function bt(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 ar(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function nI(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 sd(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 od(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 cd(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 a=e[r+1],i=r+2,o=e.slice(i,i+a),d=c[0]===0&&c.length>32?c.slice(1):c,A=o[0]===0&&o.length>32?o.slice(1):o;if(d.length>32||A.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(d,32-d.length);let y=p256.p256.Point.CURVE().n>>1n,f=BigInt("0x"+ar(A)),I=(f>y?p256.p256.Point.CURVE().n-f:f).toString(16).padStart(64,"0"),C=nI(I);return new Uint8Array([...g,...C])}function ad(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 A=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=A+(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 tO(e){let n=tinyCbor.decodeCBOR(e),r=p256.p256.Point.fromAffine({x:BigInt("0x"+ar(n.get(-2))),y:BigInt("0x"+ar(n.get(-3)))});return gill.getBase58Decoder().decode(r.toBytes(true))}function ud(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 rO(e,n=0,r=false){let{authenticatorData:s,clientDataJSON:t,signature:c}=e.authResponse.response,a=new Uint8Array(bt(s)),i=JSON.parse(new TextDecoder().decode(bt(t))),o=sd(i),d=cd(new Uint8Array(bt(c))),A=await Je({rpIdHash:a.subarray(0,32)});return new h(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(bt(t)),truncatedClientDataJson:o,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(gill.getBase58Encoder().encode(e.slotHash))},domainConfig:A,authData:a,signature:d,originIndex:n,crossOrigin:r})}async function nO(e,n){let{data:r}=await Yn(Q(),e),t=od(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 pO(e){let n=await Un(e,true),r=await Oi(n.map(gill.getBase64EncodedWireTransaction),ki()),s=await Un(e.map((c,a)=>({...c,unitsConsumed:r[a]})));return await II(s.map(gill.getBase64EncodedWireTransaction))}async function TO({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await Q().getLatestBlockhash().send(),t=await gill.pipe(gill.createTransactionMessage({version:0}),c=>gill.appendTransactionMessageInstructions([...e],c),c=>gill.setTransactionMessageFeePayerSigner(n,c),c=>gill.setTransactionMessageLifetimeUsingBlockhash(s.value,c),c=>r?gill.compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[a,i]=await Promise.all([Hi()(c),_i(Q(),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 Ni()(t,{commitment:"confirmed",skipPreflight:true}),gill.getSignatureFromTransaction(t)}async function II(e,n=10,r=1e3,s=Bn()){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=Bn()){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 fO({signer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){let c=await ji(n,r,t);if(c.threshold>1)throw new Error("Multi-signature transactions with threshold > 1 are not supported yet.");let{permissions:a}=c.members.find(f=>gd(f.pubkey)===e.toString())??{};if(!a)throw new Error("No permissions found for the current member.");let i=De.has(a,xe.InitiateTransaction),o=De.has(a,xe.VoteTransaction),d=De.has(a,xe.ExecuteTransaction);if(i&&o&&d)return null;if(!o||!d)throw new Error("Signer lacks the required Vote/Execute permissions.");let A=c.members.find(f=>f.role===2);if(!A)throw new Error("No transaction manager available in wallet.");let g=gill.address(gd(A.pubkey)),y=await Ji(g,A.userAddressTreeIndex,t);if(y.transactionManagerUrl.__option==="None")throw new Error("Transaction manager endpoint is missing for this account.");return CI(g,y.transactionManagerUrl.value,s)}function CI(e,n,r){return {address:e,async signTransactions(s){let t={publicKey:e.toString(),transactions:s.map(gill.getBase64EncodedWireTransaction)};r&&(t.transactionMessageBytes=gill.getBase64Decoder().decode(r));let c=Gi();if(c){let{url:o,publicKey:d}=c,g=await(await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({transactions:t.transactions,publicKey:d})})).json();if("error"in g)throw new Error(g.error);t.authorizedClient={publicKey:d,signatures:g.signatures};}let i=await(await fetch(n,{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(o=>({[e]:gill.getBase58Encoder().encode(o)}))}}}function gd(e){return e.keyType===Pt.Ed25519?gill.getBase58Decoder().decode(e.key.subarray(1,33)):gill.getBase58Decoder().decode(e.key)}async function wO({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,payer:s,compressed:t=false,cachedAccounts:c}){let{addDelegates:a,removeDelegates:i}=await MI(r),o=new N,d=null,A=null,g=[];if(a.length||i.length||t){let S=await hI({packedAccounts:o,addDelegates:a,removeDelegates:i,compressed:t,index:e,settingsAddressTreeIndex:n,cachedAccounts:c});d=S.proof,A=S.settingsMutArgs??null,g=S.userMutArgs??[];}let{configActions:y,secp256r1VerifyInput:f}=await PI({configActionsArgs:r,packedAccounts:o,userMutArgs:g}),{remainingAccounts:l,systemOffset:I}=o.toAccountMetas(),C=v(d,I);return {instructions:t?[po({configActions:y,payer:s,authority:gill.createNoopSigner(await ed(e)),compressedProofArgs:C,settingsMut:A,remainingAccounts:l})]:[await io({settingsIndex:e,configActions:y,payer:s,compressedProofArgs:C,remainingAccounts:l})],secp256r1VerifyInput:f}}async function MI(e){let n=[],r=[];for(let s of e)switch(s.type){case "AddMembers":{let t=s.members.map(a=>B(a.member instanceof h?a.member:"address"in a.member?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=>B(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):B(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 hI({packedAccounts:e,addDelegates:n,removeDelegates:r,compressed:s,index:t,settingsAddressTreeIndex:c,cachedAccounts:a}){await e.addSystemAccounts();let i=[];if(s){let l=(await re(t,c)).address;i.push({address:l,type:"Settings"});}r.length&&i.push(...r),n.length&&i.push(...n);let o=i.length?await se(i,a):[];if(!o.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let d=await F(o,[]),A=[],g=[];for(let l of o)l.type==="Settings"?A.push(l):l.type==="User"&&g.push(l);let y,f=[];if(s&&d&&(y=te(e,d.treeInfos.slice(0,1),d.leafIndices.slice(0,1),d.rootIndices.slice(0,1),d.proveByIndices.slice(0,1),A,j())[0]),g.length&&d){let l=s?1:0;f=te(e,d.treeInfos.slice(l),d.leafIndices.slice(l),d.rootIndices.slice(l),d.proveByIndices.slice(l),g,q());}return {proof:d,settingsMutArgs:y,userMutArgs:f}}async function PI({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 h){let o=s.length,{message:d,signature:A,publicKey:g,domainConfig:y}=k(i.member,o);d&&A&&g&&s.push({message:d,signature:A,publicKey:g}),y&&n.addPreAccounts([{address:y,role:gill.AccountRole.READONLY}]);let f=await B(i.member,i.userAddressTreeIndex).then(l=>r.find(I=>new ir__default.default(new Uint8Array(I.accountMeta.address)).eq(l.address)));if(!f)throw new Error("Unable to find user account");a.push(md({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 B(o,i.userAddressTreeIndex).then(A=>r.find(g=>new ir__default.default(new Uint8Array(g.accountMeta.address)).eq(A.address)));if(!d)throw new Error("Unable to find user account");a.push(md({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=>B(o.member,o.userAddressTreeIndex).then(d=>{let A=r.find(g=>new ir__default.default(new Uint8Array(g.accountMeta.address)).eq(d.address));if(!A)throw new Error("Unable to find user account");return RI({pubkey:o.member,userMutArgs:A})})),i=await Promise.all(a);t.push({__kind:c.type,fields:[i]});break}case "EditPermissions":{let a=c.members.map(o=>(o.delegateOperation!==2?B(o.member,o.userAddressTreeIndex).then(d=>r.find(A=>new ir__default.default(new Uint8Array(A.accountMeta.address)).eq(d.address))):Promise.resolve(void 0)).then(d=>EI({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 EI({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:Fe(e),permissions:ld(n),userArgs:r?gill.some(r):gill.none(),delegateOperation:s}}function RI({pubkey:e,userMutArgs:n}){if(n.data.role===1)throw new Error("Permanent Member cannot be removed from the wallet.");return {memberKey:Fe(e),userArgs:n.data.delegatedTo.__option==="Some"?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function md({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:Fe(e),permissions:ld(n),verifyArgs:e instanceof h&&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 ld(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,Fn=14,LI=2,BI=gill.address("Secp256r1SigVerify1111111111111111111111111");function wI(){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 kI(){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 Id(){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=kI();for(let i=0;i<r;i++)t.push(c.decode(e,n)),n+=Fn;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 A=t[i].messageDataSize,g=gill.fixDecoderSize(gill.getBytesDecoder(),A).decode(e,n);n+=A,a.push({publicKey:o,signature:d,message:g});}return [{numSignatures:r,padding:s,offsets:t,payload:a},n]}})}function Cd(){return gill.createEncoder({getSizeFromValue:e=>{let n=Fn*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=wI();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 HO(){return gill.combineCodec(Cd(),Id())}function G(e,n){let r=e.length,s=LI+r*Fn,t=[];for(let o=0;o<r;o++){let{message:d}=e[o],A=s,g=A+Ye,y=g+Ze;t.push({publicKeyOffset:A,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:y,messageDataSize:d.length,messageInstructionIndex:65535}),s+=Ye+Ze+d.length;}let c=n?.programAddress??BI,a={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:Cd().encode(a)}}function VO(e){return {programAddress:e.programAddress,accounts:{},data:Id().decode(e.data)}}async function XO({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let c=new N;await c.addSystemAccounts();let a=await ee(e),{address:i}=await re(e,n),o=await se([{address:i,type:"Settings"}],t),d=await F(o,[]),A=te(c,d.treeInfos,d.leafIndices,d.rootIndices,d.proveByIndices,o.filter(x=>x.type==="Settings"),j())[0],g=ye(s),y=g.filter(x=>x instanceof h),f=[],l=[];for(let x of y){let W=f.length,{domainConfig:w,verifyArgs:H,signature:U,publicKey:J,message:_}=k(x,W);_&&U&&J&&f.push({message:_,signature:U,publicKey:J}),w&&(c.addPreAccounts([{address:w,role:gill.AccountRole.READONLY}]),H?.__option==="Some"&&l.push({domainConfigKey:w,verifyArgs:H.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:C}=c.toAccountMetas(),b=v(d,C),S=[];return f.length>0&&S.push(G(f)),S.push(Io({settings:a,settingsMutArgs:A,compressedProofArgs:b,payer:r,secp256r1VerifyArgs:l,remainingAccounts:I})),S}async function eL({admin:e,addressTree:n}){return ro({payer:e,addressTree:n,remainingAccounts:[]})}async function aL({payer:e,rpId:n,origins:r,authority:s,metadataUrl:t}){let c=await Je({rpId:n}),a=new N;await a.addSystemAccounts();let i=await Te(),{address:o,addressTree:d}=await B(s.address,i),A=[{address:o,tree:d,queue:d,type:"User"}],g=await F([],A),y=(await me(a,g.treeInfos,g.roots,g.rootIndices,A))[0],{remainingAccounts:f,systemOffset:l}=a.toAccountMetas(),I=v(g,l);return await ho({origins:r,authorityCreationArgs:y,authority:s,compressedProofArgs:I,payer:e,domainConfig:c,rpId:n,metadataUrl:t,remainingAccounts:f})}async function lL({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new N;await c.addSystemAccounts();let a=[];r.index&&(a.push({address:(await re(r.index,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&a.push({address:(await B(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let i=a.length?await se(a,t):[],o=await Te(),{address:d,addressTree:A}=await B(r.member,o),g=[{address:d,type:"User",tree:A,queue:A}],y=await F(i,g),f=null,l=null,I=i.filter(w=>w.type==="Settings"),C=i.filter(w=>w.type==="User");I.length&&(f=te(c,y.treeInfos.slice(0,1),y.leafIndices.slice(0,1),y.rootIndices.slice(0,1),y.proveByIndices.slice(0,1),I,j())[0]),C.length&&(l=te(c,y.treeInfos.slice(1,2),y.leafIndices.slice(1,2),y.rootIndices.slice(1,2),y.proveByIndices.slice(1,2),C,q())[0]);let b=await me(c,y.treeInfos.slice(i.length),y.roots.slice(i.length),y.rootIndices.slice(i.length),g),{remainingAccounts:S,systemOffset:x}=c.toAccountMetas(),W=v(y,x);return await bo({payer:n,authority:e,compressedProofArgs:W,member:pt().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 IL({payer:e}){let n=await $i();return _o({payer:e,globalCounter:n})}async function RL({createUserArgs:e,payer:n}){let r=new N;await r.addSystemAccounts(),r.addPreAccounts(e.map(A=>({address:A.member.address,role:gill.AccountRole.READONLY_SIGNER,signer:A.member})));let s=await Te(),t=await Promise.all(e.map(async A=>{let{address:g,addressTree:y}=await B(A.member.address,s);return {address:g,tree:y,queue:y,type:"User"}})),c=await F([],t),a=await me(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:i,systemOffset:o}=r.toAccountMetas(),d=v(c,o);return await Go({compressedProofArgs:d,payer:n,createUserArgs:e.map((A,g)=>({member:A.member.address,role:A.role,userCreationArgs:a[g],transactionManagerUrl:A.role===2?A.transactionManagerUrl:null})),remainingAccounts:i})}async function WL({admin:e,rpId:n,disable:r}){let s=await Je({rpId:n});return ec({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function NL({authority:e,domainConfig:n,newAuthority:r,newOrigins:s,newMetadataUrl:t}){let c=null,a=[];if(r){let i=new N;await i.addSystemAccounts();let o=await Te(),{address:d,addressTree:A}=await B(r.address,o),g=[{address:d,tree:A,queue:A,type:"User"}],y=await F([],g),f=(await me(i,y.treeInfos,y.roots,y.rootIndices,g))[0],l=i.toAccountMetas();a=l.remainingAccounts,c={compressedProofArgs:v(y,l.systemOffset),authorityCreationArgs:f};}return uc({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 KL({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new N;await s.addSystemAccounts();let t=await se([{address:(await B(e.address,n)).address,type:"User"}]),c=await F(t,[]),a=te(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,q())[0],{remainingAccounts:i,systemOffset:o}=s.toAccountMetas(),d=v(c,o);return Tc({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:a,remainingAccounts:i})}async function uB({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,delegateOperation:t,cachedAccounts:c}){let{domainConfig:a,verifyArgs:i,message:o,signature:d,publicKey:A}=k(r),g=[];o&&d&&A&&g.push({message:o,signature:d,publicKey:A});let y=new N;await y.addSystemAccounts();let f=[],l=[];l.push(...await se([{address:(await B("address"in r?r.address:r,s)).address,type:"User"}],c));let I=await Te(),{address:C,addressTree:b}=await re(e,I);f.push({address:C,queue:b,tree:b,type:"Settings"});let S=l.length,x=await F(l,f),W=te(y,x.treeInfos.slice(0,S),x.leafIndices.slice(0,S),x.rootIndices.slice(0,S),x.proveByIndices.slice(0,S),l.filter(oe=>oe.type==="User"),q())[0],H=(await me(y,x.treeInfos.slice(S),x.roots.slice(S),x.rootIndices.slice(S),f)).find(oe=>oe.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:U,systemOffset:J}=y.toAccountMetas(),_=v(x,J),le=[];if(!H)throw new Error("Settings creation args is missing.");return le.push(await ko({settingsIndex:e,payer:n,initialMember:r instanceof h?void 0:r,secp256r1VerifyArgs:i,domainConfig:a,userMutArgs:W,compressedProofArgs:_,settingsCreation:H,delegateOperation:t,remainingAccounts:U})),{instructions:le,secp256r1VerifyInput:g}}async function xB({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let c=new N;await c.addSystemAccounts();let a=await se([{address:(await re(e,n)).address,type:"Settings"}],t),i=await F(a,[]),o=te(c,i.treeInfos,i.leafIndices,i.rootIndices,i.proveByIndices,a.filter(S=>S.type==="Settings"),j())[0],d=ye(s),A=d.filter(S=>S instanceof h),g=[],y=[];for(let S of A){let x=g.length,{domainConfig:W,verifyArgs:w,signature:H,publicKey:U,message:J}=k(S,x);J&&H&&U&&g.push({message:J,signature:H,publicKey:U}),W&&(c.addPreAccounts([{address:W,role:gill.AccountRole.READONLY}]),w?.__option==="Some"&&y.push({domainConfigKey:W,verifyArgs:w.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(i,l),C=[];g.length>0&&C.push(G(g));let b=await ee(e);return C.push(Yo({settings:b,payer:r,settingsMut:o,compressedProofArgs:I,secp256r1VerifyArgs:y,remainingAccounts:f})),C}function VI(e,n,r,s){let t=GI(e,n),c=FI(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 GI(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 FI(e,n){return n<e.header.numSignerAccounts}async function dr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=Ei(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),Q()):{}),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:VI(t,i,o,e)});if(t.addressTableLookups)for(let i of t.addressTableLookups){let o=c[i.lookupTableAddress];if(!o)throw new Error(`Address lookup table account ${i.lookupTableAddress} not found`);for(let d of i.writableIndexes){let A=o[d];if(!A)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${d}`);a.push({address:A,role:gill.AccountRole.WRITABLE});}for(let d of i.readonlyIndexes){let A=o[d];if(!A)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${d}`);a.push({address:A,role:gill.AccountRole.READONLY});}}for(let i of s?.filter(o=>o.address!==e)??[]){let o=a.findIndex(d=>d.address===i.address);o===-1?a.push({address:i.address,role:gill.AccountRole.READONLY_SIGNER,signer:i}):a[o].role===gill.AccountRole.READONLY||a[o].role===gill.AccountRole.READONLY_SIGNER?a[o]={address:i.address,role:gill.AccountRole.READONLY_SIGNER,signer:i}:(a[o].role===gill.AccountRole.WRITABLE||a[o].role===gill.AccountRole.WRITABLE_SIGNER)&&(a[o]={address:i.address,role:gill.AccountRole.WRITABLE_SIGNER,signer:i});}return {accountMetas:a,addressLookupTableAccounts:c,transactionMessage:t}}async function vd({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:A,addressLookupTableAccounts:g}=await dr({transactionMessageBytes:r,walletAddress:d,additionalSigners:a,addressesByLookupTableAddress:t}),y=[];return c.length>0&&y.push(G(c)),y.push(o?ui({transactionBuffer:n,payer:s.address,remainingAccounts:A,settingsKey:e}):si({transactionBuffer:n,payer:s.address,settings:e})),i&&y.push(Li({payer:s,tipAmount:i})),{instructions:y,addressLookupTableAccounts:g}}async function Ud({index:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:a=[],compressed:i=false,simulateProof:o=false,cachedAccounts:d}){let A=ye(s),g=await ee(e),y=await Ie(g),[{accountMetas:f,addressLookupTableAccounts:l,transactionMessage:I},{settingsReadonlyArgs:C,proof:b,packedAccounts:S}]=await Promise.all([dr({transactionMessageBytes:r,walletAddress:y,additionalSigners:A.filter(_=>!(_ instanceof h)),addressesByLookupTableAddress:c}),pe(i,e,n,o,d)]);S.addPreAccounts(f);let x=A.filter(_=>_ instanceof h),W=[];for(let _ of x){let le=a.length,{domainConfig:oe,verifyArgs:Pe,signature:Ce,publicKey:vt,message:Ut}=k(_,le);Ut&&Ce&&vt&&a.push({message:Ut,signature:Ce,publicKey:vt}),oe&&(S.addPreAccounts([{address:oe,role:gill.AccountRole.READONLY}]),Pe?.__option==="Some"&&W.push({domainConfigKey:oe,verifyArgs:Pe.value}));}let{remainingAccounts:w,systemOffset:H}=S.toAccountMetas(),U=[];a.length>0&&U.push(G(a));let J=KI(I,f);if(i){if(!t||!C)throw new Error("Payer not found or proof args is missing.");let _=v(b,H);U.push(Ci({secp256r1VerifyArgs:W,transactionMessage:J,settingsReadonlyArgs:C,compressedProofArgs:_,payer:t,remainingAccounts:w}));}else U.push(Ti({secp256r1VerifyArgs:W,settings:g,transactionMessage:J,remainingAccounts:w}));return {instructions:U,addressLookupTableAccounts:l}}function KI(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 YB({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:a,compressed:i=false}){let o=ye(s),d=await ee(e),A=await Ie(d),{settingsReadonlyArgs:g,proof:y,packedAccounts:f}=await pe(i,e,n,false,t),l=[],I=[];for(let x of o)if(x instanceof h){let W=l.length,{domainConfig:w,verifyArgs:H,signature:U,publicKey:J,message:_}=k(x,W);_&&U&&J&&l.push({message:_,signature:U,publicKey:J}),w&&(f.addPreAccounts([{address:w,role:gill.AccountRole.READONLY}]),H?.__option==="Some"&&I.push({domainConfigKey:w,verifyArgs:H.value}));}else f.addPreAccounts([{address:x.address,role:gill.AccountRole.READONLY_SIGNER,signer:x}]);let{remainingAccounts:C,systemOffset:b}=f.toAccountMetas(),S=[];if(l.length>0&&S.push(G(l)),i){if(!a||!g)throw new Error("Payer not found or proof args is missing.");let x=v(y,b);S.push(Bc({amount:c,settingsReadonlyArgs:g,compressedProofArgs:x,payer:a,secp256r1VerifyArgs:I,source:A,destination:r,remainingAccounts:C}));}else S.push(vc({amount:c,secp256r1VerifyArgs:I,source:A,destination:r,settings:d,remainingAccounts:C}));return S}async function sw({index:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:a,payer:i,tokenProgram:o,compressed:d=false}){let A=ye(t),g=await ee(e),y=await Ie(g),[f,l]=await Promise.all([programs.getAssociatedTokenAccountAddress(s,y,o),programs.getAssociatedTokenAccountAddress(s,r,o)]),{settingsReadonlyArgs:I,proof:C,packedAccounts:b}=await pe(d,e,n,false,c),S=[],x=[];for(let U of A)if(U instanceof h){let J=S.length,{domainConfig:_,verifyArgs:le,signature:oe,publicKey:Pe,message:Ce}=k(U,J);Ce&&oe&&Pe&&S.push({message:Ce,signature:oe,publicKey:Pe}),_&&(b.addPreAccounts([{address:_,role:gill.AccountRole.READONLY}]),le?.__option==="Some"&&x.push({domainConfigKey:_,verifyArgs:le.value}));}else b.addPreAccounts([{address:U.address,role:gill.AccountRole.READONLY_SIGNER,signer:U}]);let{remainingAccounts:W,systemOffset:w}=b.toAccountMetas(),H=[];if(S.length>0&&H.push(G(S)),d){if(!i||!I)throw new Error("Payer not found or proof args is missing.");let U=v(C,w);H.push(Jc({amount:a,settingsReadonlyArgs:I,compressedProofArgs:U,payer:i,secp256r1VerifyArgs:x,source:y,sourceTokenAccount:f,destination:r,destinationTokenAccount:l,mint:s,tokenProgram:o,remainingAccounts:W}));}else H.push(Hc({amount:a,secp256r1VerifyArgs:x,source:y,sourceTokenAccount:f,destination:r,destinationTokenAccount:l,settings:g,mint:s,tokenProgram:o,remainingAccounts:W}));return H}async function pw({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:a}){let i=await zs(Q(),s),o=i.data.multiWalletSettings,{settingsReadonlyArgs:d,proof:A,packedAccounts:g}=await pe(c,e,n,false,a),{remainingAccounts:y,systemOffset:f}=g.toAccountMetas(),{domainConfig:l,verifyArgs:I,message:C,signature:b,publicKey:S}=k(r),x=[];if(C&&b&&S&&x.push(G([{message:C,signature:b,publicKey:S}])),c){if(!t||!d)throw new Error("Payer not found or proof args is missing.");let W=v(A,f);x.push(sa({transactionBuffer:s,domainConfig:l,closer:r instanceof h?void 0:r,rentCollector:i.data.payer,secp256r1VerifyArgs:I,settingsReadonlyArgs:d,payer:t,compressedProofArgs:W,remainingAccounts:y}));}else x.push($c({transactionBuffer:s,domainConfig:l,closer:r instanceof h?void 0:r,settings:o,payer:i.data.payer,secp256r1VerifyArgs:I,remainingAccounts:[]}));return x}function Ld({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:a,preauthorizeExecution:i,bufferExtendHashes:o,compressedArgs:d,expectedSigners:A}){let{domainConfig:g,verifyArgs:y,message:f,signature:l,publicKey:I}=k(n),C=[];if(f&&l&&I&&C.push(G([{message:f,signature:l,publicKey:I}])),d){let{settingsReadonlyArgs:b,compressedProofArgs:S,remainingAccounts:x}=d;C.push(Ta({transactionBuffer:t,payer:e,secp256r1VerifyArgs:y,creator:n instanceof h?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSigners:A},settingsReadonlyArgs:b,compressedProofArgs:S,remainingAccounts:x}));}else C.push(ua({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:y,creator:n instanceof h?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSigners:A},remainingAccounts:[]}));return C}function Bd({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,message:i,publicKey:o}=k(e),d=[];return i&&a&&o&&d.push(G([{message:i,signature:a,publicKey:o}])),s?d.push(Ra({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof h?void 0:e,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(Ca({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof h?void 0:e,remainingAccounts:[]})),d}function wd({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?Ha({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Oa({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function kd({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,publicKey:i,message:o}=k(n),d=[];return o&&a&&i&&d.push(G([{message:o,signature:a,publicKey:i}])),s?d.push($a({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof h?void 0:n,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(Ja({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof h?void 0:n,remainingAccounts:[]})),d}async function ek({message:e,signer:n,popUp:r}){let s=await or({authUrl:`${he()}/?redirectUrl=${encodeURIComponent(window.origin)}`,data:{type:"message",payload:e},signer:n,popUp:r,additionalInfo:er()});return {...s,signer:new ae(s.signer),userAddressTreeIndex:s.userAddressTree?await nr(s.userAddressTree):void 0}}async function ok({transactionActionType:e,transactionAddress:n,transactionMessageBytes:r,signer:s,popUp:t}){let c=await or({authUrl:`${he()}/?redirectUrl=${encodeURIComponent(window.origin)}`,data:{type:"transaction",payload:JSON.stringify({transactionActionType:e,transactionAddress:n,transactionMessageBytes:cr(r)})},additionalInfo:er(),signer:s,popUp:t});return {...c,signer:new ae(c.signer),userAddressTreeIndex:c.userAddressTree?await nr(c.userAddressTree):void 0}}async function uk({message:e,response:n,expectedRPID:r=Vi(),expectedOrigin:s=he()}){let{verified:t}=await server.verifyAuthenticationResponse({response:n.authResponse,expectedChallenge:cr(new TextEncoder().encode(e)),expectedOrigin:s,expectedRPID:r,requireUserVerification:false,credential:{id:n.authResponse.id,publicKey:ud(n.signer.toString()),counter:0}});return t}async function Ck({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o,compressed:d=false,bufferIndex:A=Math.floor(Math.random()*255),additionalVoters:g=[],additionalSigners:y=[],chunkSize:f=Math.ceil(s.length/2),cachedAccounts:l}){let I=await ee(n),C=await Qi(I,t instanceof h?t:t.address,A),b=[],S=[];for(let ce=0;ce<s.length;ce+=f){let zn=s.subarray(ce,ce+f);b.push(zn),S.push(sha256.sha256(zn));}let x=sha256.sha256(new Uint8Array(s)),{settingsReadonlyArgs:W,proof:w,packedAccounts:H}=await pe(d,n,r,false,l),{remainingAccounts:U,systemOffset:J}=H.toAccountMetas(),_=W?{settingsReadonlyArgs:W,compressedProofArgs:v(w,J),remainingAccounts:U,payer:e}:null,le=[t,...c?[c]:[],...g].map(Fe),oe=Ld({finalBufferHash:x,finalBufferSize:s.length,bufferIndex:A,payer:e,transactionBufferAddress:C,settings:I,creator:t,preauthorizeExecution:!c,bufferExtendHashes:S,compressedArgs:_,expectedSigners:le}),Pe=b.map(ce=>wd({transactionMessageBytes:ce,transactionBufferAddress:C,settings:I,compressed:d})),Ce=g.map(ce=>kd({voter:ce,transactionBufferAddress:C,settings:I,compressedArgs:_})),vt=Bd({compressedArgs:_,settings:I,executor:c,transactionBufferAddress:C}),{instructions:Ut,addressLookupTableAccounts:Vd}=await vd({compressed:d,settings:I,transactionMessageBytes:s,transactionBufferAddress:C,payer:e,additionalSigners:y,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o}),T=ce=>({payer:e,instructions:ce,addressesByLookupTableAddress:Vd});return [T(oe),...Pe.map(ce=>T([ce])),...Ce.length?[T(Ce.flat())]:[],T(vt),T(Ut)]}var Ar=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 gr=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let 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 Hd({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=Ar.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:l,drainedKeys:I}=f;c.push({readonlyIndexes:l.readonlyIndexes,readableIndices:l.readonlyIndexes,writableIndexes:l.writableIndexes,writableIndices:l.writableIndexes,lookupTableAddress:gill.address(l.lookupTableAddress)}),a.writable.push(...I.writable),a.readonly.push(...I.readonly);}}let[o,d]=t.getMessageComponents(),g=new gr(d,a).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function Lk({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=Hd({instructions:e,payer:n,recentBlockhash:u,addressesByLookupTableAddress:r});return Pi(s)}async function Hk({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:a,cachedAccounts:i,compressed:o=false,simulateProof:d=false}){let{instructions:A,addressLookupTableAccounts:g}=await Ud({index:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:a,simulateProof:d,cachedAccounts:i});return {payer:e,instructions:A,addressesByLookupTableAddress:g}}
2
- exports.ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR=eo;exports.CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR=go;exports.CHANGE_CONFIG_DISCRIMINATOR=co;exports.COMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR=fo;exports.CREATE_DOMAIN_CONFIG_DISCRIMINATOR=Do;exports.CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR=Eo;exports.CREATE_GLOBAL_COUNTER_DISCRIMINATOR=Uo;exports.CREATE_MULTI_WALLET_COMPRESSED_DISCRIMINATOR=Bo;exports.CREATE_USER_ACCOUNTS_DISCRIMINATOR=Ho;exports.DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR=Ko;exports.DISABLE_DOMAIN_CONFIG_DISCRIMINATOR=Xo;exports.DOMAIN_CONFIG_DISCRIMINATOR=Kn;exports.DelegateOp=Ht;exports.EDIT_DOMAIN_CONFIG_DISCRIMINATOR=ic;exports.EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR=yc;exports.GLOBAL_COUNTER_DISCRIMINATOR=Xn;exports.KeyType=Pt;exports.MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR=Sc;exports.MIGRATE_COMPRESSED_USERS_DISCRIMINATOR=Mc;exports.MULTI_WALLET_ERROR__ALREADY_DELEGATED=XS;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED=px;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING=Tx;exports.MULTI_WALLET_ERROR__DUPLICATE_MEMBER=BS;exports.MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED=LS;exports.MULTI_WALLET_ERROR__EMPTY_MEMBERS=GS;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH=ox;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED=cx;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH=ax;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION=ex;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION=$S;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION=QS;exports.MULTI_WALLET_ERROR__INVALID_ACCOUNT=jS;exports.MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE=xx;exports.MULTI_WALLET_ERROR__INVALID_ARGUMENTS=YS;exports.MULTI_WALLET_ERROR__INVALID_BUFFER=sx;exports.MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS=JS;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG=OS;exports.MULTI_WALLET_ERROR__INVALID_SIGNED_MESSAGE=_S;exports.MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT=yx;exports.MULTI_WALLET_ERROR__INVALID_THRESHOLD=zS;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE=KS;exports.MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED=Ax;exports.MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG=lx;exports.MULTI_WALLET_ERROR__MISSING_ACCOUNT=ZS;exports.MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY=gx;exports.MULTI_WALLET_ERROR__MISSING_USER_ARGS=qS;exports.MULTI_WALLET_ERROR__NO_SIGNER_FOUND=rx;exports.MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED=NS;exports.MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED=HS;exports.MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS=Sx;exports.MULTI_WALLET_ERROR__PERMANENT_MEMBER=wS;exports.MULTI_WALLET_ERROR__PERMANENT_MEMBER_NOT_ALLOWED=kS;exports.MULTI_WALLET_ERROR__PROTECTED_ACCOUNT=ux;exports.MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH=fx;exports.MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND=mx;exports.MULTI_WALLET_ERROR__TOO_MANY_MEMBERS=FS;exports.MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED=ix;exports.MULTI_WALLET_ERROR__TRANSACTION_MANAGER_NOT_ALLOWED=VS;exports.MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED=dx;exports.MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER=nx;exports.MULTI_WALLET_ERROR__UNEXPECTED_SIGNER=tx;exports.MULTI_WALLET_PROGRAM_ADDRESS=u;exports.MultiWalletAccount=vS;exports.MultiWalletInstruction=US;exports.NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=_c;exports.NATIVE_TRANSFER_INTENT_DISCRIMINATOR=Rc;exports.Permission=xe;exports.Permissions=De;exports.SETTINGS_DISCRIMINATOR=Os;exports.Secp256r1Key=ae;exports.SignedSecp256r1Key=h;exports.TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=zc;exports.TOKEN_TRANSFER_INTENT_DISCRIMINATOR=kc;exports.TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR=ta;exports.TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR=Zc;exports.TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR=ya;exports.TRANSACTION_BUFFER_CREATE_DISCRIMINATOR=aa;exports.TRANSACTION_BUFFER_DISCRIMINATOR=Vs;exports.TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR=ha;exports.TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR=Sa;exports.TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR=wa;exports.TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR=Ua;exports.TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR=Za;exports.TRANSACTION_BUFFER_VOTE_DISCRIMINATOR=Fa;exports.TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR=ai;exports.TRANSACTION_EXECUTE_DISCRIMINATOR=ti;exports.TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR=Si;exports.TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR=yi;exports.UserRole=Ve;exports.WHITELISTED_ADDRESS_TREE_DISCRIMINATOR=js;exports.addWhitelistedAddressTrees=eL;exports.changeConfig=wO;exports.closeTransactionBuffer=pw;exports.compressSettingsAccount=XO;exports.configAction=wC;exports.convertMemberKeyToString=gd;exports.convertPubkeyCompressedToCose=ud;exports.convertPubkeyCoseToCompressed=tO;exports.createDomainConfig=aL;exports.createDomainUserAccounts=lL;exports.createGlobalCounter=IL;exports.createPopUp=ad;exports.createTransactionBuffer=Ld;exports.createTransactionManagerSigner=CI;exports.createUserAccounts=RL;exports.createWallet=uB;exports.decodeDomainConfig=jn;exports.decodeGlobalCounter=Qn;exports.decodeSettings=Bs;exports.decodeTransactionBuffer=Fs;exports.decodeWhitelistedAddressTree=Zs;exports.decompressSettingsAccount=xB;exports.disableDomainConfig=WL;exports.editDomainConfig=NL;exports.editTransactionManagerUrl=KL;exports.executeTransaction=vd;exports.executeTransactionBuffer=Bd;exports.executeTransactionSync=Ud;exports.extendTransactionBuffer=wd;exports.fetchAllDomainConfig=$I;exports.fetchAllGlobalCounter=oC;exports.fetchAllMaybeDomainConfig=nu;exports.fetchAllMaybeGlobalCounter=Su;exports.fetchAllMaybeSettings=My;exports.fetchAllMaybeTransactionBuffer=zy;exports.fetchAllMaybeWhitelistedAddressTree=um;exports.fetchAllSettings=Mh;exports.fetchAllTransactionBuffer=Uh;exports.fetchAllWhitelistedAddressTree=Bh;exports.fetchDomainConfig=Yn;exports.fetchGlobalCounter=sC;exports.fetchMaybeDomainConfig=ru;exports.fetchMaybeGlobalCounter=fu;exports.fetchMaybeSettings=Jr;exports.fetchMaybeSettingsAccountData=Qx;exports.fetchMaybeTransactionBuffer=Fy;exports.fetchMaybeUserAccountData=$x;exports.fetchMaybeWhitelistedAddressTree=dm;exports.fetchSettings=Dh;exports.fetchSettingsAccountData=ji;exports.fetchTransactionBuffer=zs;exports.fetchUserAccountData=Ji;exports.fetchWhitelistedAddressTree=qs;exports.getAddMemberArgsCodec=uC;exports.getAddMemberArgsDecoder=mr;exports.getAddMemberArgsEncoder=yr;exports.getAddWhitelistedAddressTreesDiscriminatorBytes=Qh;exports.getAddWhitelistedAddressTreesInstruction=tP;exports.getAddWhitelistedAddressTreesInstructionAsync=ro;exports.getAddWhitelistedAddressTreesInstructionDataCodec=eP;exports.getAddWhitelistedAddressTreesInstructionDataDecoder=to;exports.getAddWhitelistedAddressTreesInstructionDataEncoder=en;exports.getAuthEndpoint=he;exports.getChangeConfigCompressedDiscriminatorBytes=SP;exports.getChangeConfigCompressedInstruction=po;exports.getChangeConfigCompressedInstructionDataCodec=xP;exports.getChangeConfigCompressedInstructionDataDecoder=mo;exports.getChangeConfigCompressedInstructionDataEncoder=yo;exports.getChangeConfigDiscriminatorBytes=dP;exports.getChangeConfigInstruction=AP;exports.getChangeConfigInstructionAsync=io;exports.getChangeConfigInstructionDataCodec=uP;exports.getChangeConfigInstructionDataDecoder=ao;exports.getChangeConfigInstructionDataEncoder=tn;exports.getCompiledInstructionCodec=yC;exports.getCompiledInstructionDecoder=Tr;exports.getCompiledInstructionEncoder=pr;exports.getCompressSettingsAccountDiscriminatorBytes=RP;exports.getCompressSettingsAccountInstruction=Io;exports.getCompressSettingsAccountInstructionDataCodec=bP;exports.getCompressSettingsAccountInstructionDataDecoder=xo;exports.getCompressSettingsAccountInstructionDataEncoder=So;exports.getCompressedAccountMetaCodec=lC;exports.getCompressedAccountMetaDecoder=tt;exports.getCompressedAccountMetaEncoder=et;exports.getCompressedAccountMetaReadOnlyCodec=IC;exports.getCompressedAccountMetaReadOnlyDecoder=ot;exports.getCompressedAccountMetaReadOnlyEncoder=st;exports.getCompressedProofCodec=MC;exports.getCompressedProofDecoder=Cr;exports.getCompressedProofEncoder=Ir;exports.getCompressedSettingsAddressFromIndex=re;exports.getCompressedSettingsCodec=RC;exports.getCompressedSettingsDataCodec=WC;exports.getCompressedSettingsDataDecoder=it;exports.getCompressedSettingsDataEncoder=at;exports.getCompressedSettingsDecoder=j;exports.getCompressedSettingsEncoder=ct;exports.getComputeBudgetEstimate=Hi;exports.getConfigActionCodec=BC;exports.getConfigActionDecoder=gt;exports.getConfigActionEncoder=At;exports.getCreateDomainConfigDiscriminatorBytes=wP;exports.getCreateDomainConfigInstruction=NP;exports.getCreateDomainConfigInstructionAsync=ho;exports.getCreateDomainConfigInstructionDataCodec=kP;exports.getCreateDomainConfigInstructionDataDecoder=Mo;exports.getCreateDomainConfigInstructionDataEncoder=un;exports.getCreateDomainUserAccountDiscriminatorBytes=jP;exports.getCreateDomainUserAccountInstruction=ZP;exports.getCreateDomainUserAccountInstructionAsync=bo;exports.getCreateDomainUserAccountInstructionDataCodec=YP;exports.getCreateDomainUserAccountInstructionDataDecoder=Ro;exports.getCreateDomainUserAccountInstructionDataEncoder=gn;exports.getCreateGlobalCounterDiscriminatorBytes=rE;exports.getCreateGlobalCounterInstruction=sE;exports.getCreateGlobalCounterInstructionAsync=_o;exports.getCreateGlobalCounterInstructionDataCodec=nE;exports.getCreateGlobalCounterInstructionDataDecoder=Wo;exports.getCreateGlobalCounterInstructionDataEncoder=mn;exports.getCreateMultiWalletCompressedDiscriminatorBytes=gE;exports.getCreateMultiWalletCompressedInstruction=mE;exports.getCreateMultiWalletCompressedInstructionAsync=ko;exports.getCreateMultiWalletCompressedInstructionDataCodec=yE;exports.getCreateMultiWalletCompressedInstructionDataDecoder=wo;exports.getCreateMultiWalletCompressedInstructionDataEncoder=pn;exports.getCreateUserAccountArgsCodec=GC;exports.getCreateUserAccountArgsDecoder=vr;exports.getCreateUserAccountArgsEncoder=br;exports.getCreateUserAccountsDiscriminatorBytes=CE;exports.getCreateUserAccountsInstruction=ME;exports.getCreateUserAccountsInstructionAsync=Go;exports.getCreateUserAccountsInstructionDataCodec=DE;exports.getCreateUserAccountsInstructionDataDecoder=Vo;exports.getCreateUserAccountsInstructionDataEncoder=ln;exports.getDecompressSettingsAccountDiscriminatorBytes=WE;exports.getDecompressSettingsAccountInstruction=Yo;exports.getDecompressSettingsAccountInstructionDataCodec=_E;exports.getDecompressSettingsAccountInstructionDataDecoder=jo;exports.getDecompressSettingsAccountInstructionDataEncoder=Jo;exports.getDelegateOpCodec=KC;exports.getDelegateOpDecoder=Re;exports.getDelegateOpEncoder=Ee;exports.getDisableDomainConfigDiscriminatorBytes=HE;exports.getDisableDomainConfigInstruction=ec;exports.getDisableDomainConfigInstructionDataCodec=VE;exports.getDisableDomainConfigInstructionDataDecoder=Qo;exports.getDisableDomainConfigInstructionDataEncoder=$o;exports.getDomainConfigAddress=Je;exports.getDomainConfigCodec=XI;exports.getDomainConfigDecoder=Jn;exports.getDomainConfigDiscriminatorBytes=qI;exports.getDomainConfigEncoder=tu;exports.getDomainConfigSize=QI;exports.getEditDomainConfigDiscriminatorBytes=ZE;exports.getEditDomainConfigInstruction=uc;exports.getEditDomainConfigInstructionAsync=XE;exports.getEditDomainConfigInstructionDataCodec=qE;exports.getEditDomainConfigInstructionDataDecoder=dc;exports.getEditDomainConfigInstructionDataEncoder=In;exports.getEditMemberArgsCodec=ZC;exports.getEditMemberArgsDecoder=Pr;exports.getEditMemberArgsEncoder=hr;exports.getEditTransactionManagerUrlDiscriminatorBytes=oR;exports.getEditTransactionManagerUrlInstruction=Tc;exports.getEditTransactionManagerUrlInstructionDataCodec=cR;exports.getEditTransactionManagerUrlInstructionDataDecoder=pc;exports.getEditTransactionManagerUrlInstructionDataEncoder=mc;exports.getFeePayer=c_;exports.getGlobalAdditonalInfo=er;exports.getGlobalAuthorizedClient=Gi;exports.getGlobalCounterAddress=$i;exports.getGlobalCounterCodec=nC;exports.getGlobalCounterDecoder=$n;exports.getGlobalCounterDiscriminatorBytes=rC;exports.getGlobalCounterEncoder=lu;exports.getGlobalCounterSize=cC;exports.getJitoTipsConfig=Bn;exports.getLightCpiSigner=k_;exports.getLightProtocolRpc=Et;exports.getLinkWalletArgsCodec=QC;exports.getLinkWalletArgsDecoder=Wr;exports.getLinkWalletArgsEncoder=Ur;exports.getMemberCodec=nD;exports.getMemberDecoder=ut;exports.getMemberEncoder=dt;exports.getMemberKeyCodec=cD;exports.getMemberKeyDecoder=K;exports.getMemberKeyEncoder=z;exports.getMigrateCompressedSettingsDiscriminatorBytes=mR;exports.getMigrateCompressedSettingsInstruction=TR;exports.getMigrateCompressedSettingsInstructionDataCodec=pR;exports.getMigrateCompressedSettingsInstructionDataDecoder=Ic;exports.getMigrateCompressedSettingsInstructionDataEncoder=xc;exports.getMigrateCompressedUsersDiscriminatorBytes=MR;exports.getMigrateCompressedUsersInstruction=PR;exports.getMigrateCompressedUsersInstructionDataCodec=hR;exports.getMigrateCompressedUsersInstructionDataDecoder=Pc;exports.getMigrateCompressedUsersInstructionDataEncoder=hc;exports.getMultiWalletErrorMessage=lW;exports.getNativeTransferIntentCompressedDiscriminatorBytes=zR;exports.getNativeTransferIntentCompressedInstruction=Bc;exports.getNativeTransferIntentCompressedInstructionDataCodec=KR;exports.getNativeTransferIntentCompressedInstructionDataDecoder=Lc;exports.getNativeTransferIntentCompressedInstructionDataEncoder=Oc;exports.getNativeTransferIntentDiscriminatorBytes=OR;exports.getNativeTransferIntentInstruction=vc;exports.getNativeTransferIntentInstructionAsync=BR;exports.getNativeTransferIntentInstructionDataCodec=LR;exports.getNativeTransferIntentInstructionDataDecoder=bc;exports.getNativeTransferIntentInstructionDataEncoder=Cn;exports.getNewAuthorityArgsCodec=uD;exports.getNewAuthorityArgsDecoder=Or;exports.getNewAuthorityArgsEncoder=_r;exports.getOriginIndex=nO;exports.getPackedAddressTreeInfoCodec=yD;exports.getPackedAddressTreeInfoDecoder=mt;exports.getPackedAddressTreeInfoEncoder=yt;exports.getPackedStateTreeInfoCodec=TD;exports.getPackedStateTreeInfoDecoder=nt;exports.getPackedStateTreeInfoEncoder=rt;exports.getPermissionsCodec=SD;exports.getPermissionsDecoder=ve;exports.getPermissionsEncoder=be;exports.getProofArgsCodec=DD;exports.getProofArgsDecoder=M;exports.getProofArgsEncoder=D;exports.getRemoveMemberArgsCodec=ED;exports.getRemoveMemberArgsDecoder=Rr;exports.getRemoveMemberArgsEncoder=Er;exports.getRpId=Vi;exports.getSecp256r1PubkeyCodec=vD;exports.getSecp256r1PubkeyDecoder=pt;exports.getSecp256r1PubkeyEncoder=Lr;exports.getSecp256r1SignatureOffsetsDataDecoder=kI;exports.getSecp256r1SignatureOffsetsDataEncoder=wI;exports.getSecp256r1VerifyArgsCodec=_D;exports.getSecp256r1VerifyArgsDecoder=L;exports.getSecp256r1VerifyArgsEncoder=O;exports.getSecp256r1VerifyArgsWithDomainAddressCodec=wD;exports.getSecp256r1VerifyArgsWithDomainAddressDecoder=Z;exports.getSecp256r1VerifyArgsWithDomainAddressEncoder=Y;exports.getSecp256r1VerifyInstruction=G;exports.getSecp256r1VerifyInstructionDataCodec=HO;exports.getSecp256r1VerifyInstructionDataDecoder=Id;exports.getSecp256r1VerifyInstructionDataEncoder=Cd;exports.getSendAndConfirmTransaction=Ni;exports.getSettingsCodec=Ch;exports.getSettingsCreationArgsCodec=VD;exports.getSettingsCreationArgsDecoder=lt;exports.getSettingsCreationArgsEncoder=Tt;exports.getSettingsDecoder=Ls;exports.getSettingsDiscriminatorBytes=Ih;exports.getSettingsEncoder=Dy;exports.getSettingsFromIndex=ee;exports.getSettingsIndexWithAddressCodec=zD;exports.getSettingsIndexWithAddressDecoder=wr;exports.getSettingsIndexWithAddressEncoder=Br;exports.getSettingsMutArgsCodec=YD;exports.getSettingsMutArgsDecoder=Se;exports.getSettingsMutArgsEncoder=fe;exports.getSettingsReadonlyArgsCodec=$D;exports.getSettingsReadonlyArgsDecoder=$;exports.getSettingsReadonlyArgsEncoder=X;exports.getSettingsSize=hh;exports.getSignedSecp256r1Key=rO;exports.getSolanaRpc=Q;exports.getSolanaRpcEndpoint=ki;exports.getTokenTransferIntentCompressedDiscriminatorBytes=db;exports.getTokenTransferIntentCompressedInstruction=Jc;exports.getTokenTransferIntentCompressedInstructionAsync=Ab;exports.getTokenTransferIntentCompressedInstructionDataCodec=ub;exports.getTokenTransferIntentCompressedInstructionDataDecoder=Kc;exports.getTokenTransferIntentCompressedInstructionDataEncoder=hn;exports.getTokenTransferIntentDiscriminatorBytes=QR;exports.getTokenTransferIntentInstruction=Hc;exports.getTokenTransferIntentInstructionAsync=tb;exports.getTokenTransferIntentInstructionDataCodec=eb;exports.getTokenTransferIntentInstructionDataDecoder=Nc;exports.getTokenTransferIntentInstructionDataEncoder=Mn;exports.getTransactionBufferAddress=Qi;exports.getTransactionBufferCloseCompressedDiscriminatorBytes=Rb;exports.getTransactionBufferCloseCompressedInstruction=sa;exports.getTransactionBufferCloseCompressedInstructionDataCodec=bb;exports.getTransactionBufferCloseCompressedInstructionDataDecoder=na;exports.getTransactionBufferCloseCompressedInstructionDataEncoder=ra;exports.getTransactionBufferCloseDiscriminatorBytes=Sb;exports.getTransactionBufferCloseInstruction=$c;exports.getTransactionBufferCloseInstructionDataCodec=xb;exports.getTransactionBufferCloseInstructionDataDecoder=Xc;exports.getTransactionBufferCloseInstructionDataEncoder=qc;exports.getTransactionBufferCodec=vh;exports.getTransactionBufferCreateArgsCodec=rM;exports.getTransactionBufferCreateArgsDecoder=St;exports.getTransactionBufferCreateArgsEncoder=ft;exports.getTransactionBufferCreateCompressedDiscriminatorBytes=Jb;exports.getTransactionBufferCreateCompressedInstruction=Ta;exports.getTransactionBufferCreateCompressedInstructionDataCodec=jb;exports.getTransactionBufferCreateCompressedInstructionDataDecoder=pa;exports.getTransactionBufferCreateCompressedInstructionDataEncoder=ma;exports.getTransactionBufferCreateDiscriminatorBytes=wb;exports.getTransactionBufferCreateInstruction=ua;exports.getTransactionBufferCreateInstructionDataCodec=kb;exports.getTransactionBufferCreateInstructionDataDecoder=da;exports.getTransactionBufferCreateInstructionDataEncoder=ia;exports.getTransactionBufferDecoder=Gs;exports.getTransactionBufferDiscriminatorBytes=bh;exports.getTransactionBufferEncoder=Gy;exports.getTransactionBufferExecuteCompressedDiscriminatorBytes=uv;exports.getTransactionBufferExecuteCompressedInstruction=Ra;exports.getTransactionBufferExecuteCompressedInstructionDataCodec=Av;exports.getTransactionBufferExecuteCompressedInstructionDataDecoder=Ea;exports.getTransactionBufferExecuteCompressedInstructionDataEncoder=Pa;exports.getTransactionBufferExecuteDiscriminatorBytes=tv;exports.getTransactionBufferExecuteInstruction=Ca;exports.getTransactionBufferExecuteInstructionDataCodec=rv;exports.getTransactionBufferExecuteInstructionDataDecoder=Ia;exports.getTransactionBufferExecuteInstructionDataEncoder=xa;exports.getTransactionBufferExtendCompressedDiscriminatorBytes=Pv;exports.getTransactionBufferExtendCompressedInstruction=Ha;exports.getTransactionBufferExtendCompressedInstructionDataCodec=Ev;exports.getTransactionBufferExtendCompressedInstructionDataDecoder=Na;exports.getTransactionBufferExtendCompressedInstructionDataEncoder=ka;exports.getTransactionBufferExtendDiscriminatorBytes=fv;exports.getTransactionBufferExtendInstruction=Oa;exports.getTransactionBufferExtendInstructionDataCodec=Sv;exports.getTransactionBufferExtendInstructionDataDecoder=_a;exports.getTransactionBufferExtendInstructionDataEncoder=Wa;exports.getTransactionBufferVoteCompressedDiscriminatorBytes=zv;exports.getTransactionBufferVoteCompressedInstruction=$a;exports.getTransactionBufferVoteCompressedInstructionDataCodec=Kv;exports.getTransactionBufferVoteCompressedInstructionDataDecoder=Xa;exports.getTransactionBufferVoteCompressedInstructionDataEncoder=qa;exports.getTransactionBufferVoteDiscriminatorBytes=Lv;exports.getTransactionBufferVoteInstruction=Ja;exports.getTransactionBufferVoteInstructionDataCodec=Bv;exports.getTransactionBufferVoteInstructionDataDecoder=Ka;exports.getTransactionBufferVoteInstructionDataEncoder=za;exports.getTransactionExecuteCompressedDiscriminatorBytes=cU;exports.getTransactionExecuteCompressedInstruction=ui;exports.getTransactionExecuteCompressedInstructionDataCodec=aU;exports.getTransactionExecuteCompressedInstructionDataDecoder=di;exports.getTransactionExecuteCompressedInstructionDataEncoder=ii;exports.getTransactionExecuteDiscriminatorBytes=$v;exports.getTransactionExecuteInstruction=si;exports.getTransactionExecuteInstructionDataCodec=Qv;exports.getTransactionExecuteInstructionDataDecoder=ni;exports.getTransactionExecuteInstructionDataEncoder=ri;exports.getTransactionExecuteSyncCompressedDiscriminatorBytes=MU;exports.getTransactionExecuteSyncCompressedInstruction=Ci;exports.getTransactionExecuteSyncCompressedInstructionDataCodec=hU;exports.getTransactionExecuteSyncCompressedInstructionDataDecoder=Ii;exports.getTransactionExecuteSyncCompressedInstructionDataEncoder=xi;exports.getTransactionExecuteSyncDiscriminatorBytes=pU;exports.getTransactionExecuteSyncInstruction=Ti;exports.getTransactionExecuteSyncInstructionDataCodec=TU;exports.getTransactionExecuteSyncInstructionDataDecoder=pi;exports.getTransactionExecuteSyncInstructionDataEncoder=mi;exports.getTransactionMessageAddressTableLookupCodec=dM;exports.getTransactionMessageAddressTableLookupDecoder=Nr;exports.getTransactionMessageAddressTableLookupEncoder=kr;exports.getTransactionMessageCodec=cM;exports.getTransactionMessageDecoder=It;exports.getTransactionMessageEncoder=xt;exports.getUserAccountAddress=B;exports.getUserCodec=yM;exports.getUserCreationArgsCodec=lM;exports.getUserCreationArgsDecoder=ue;exports.getUserCreationArgsEncoder=de;exports.getUserDecoder=q;exports.getUserEncoder=_e;exports.getUserMutArgsCodec=IM;exports.getUserMutArgsDecoder=ge;exports.getUserMutArgsEncoder=Ae;exports.getUserReadOnlyArgsCodec=hM;exports.getUserReadOnlyArgsDecoder=Fr;exports.getUserReadOnlyArgsEncoder=Gr;exports.getUserReadOnlyOrMutateArgsCodec=bM;exports.getUserReadOnlyOrMutateArgsDecoder=Qe;exports.getUserReadOnlyOrMutateArgsEncoder=$e;exports.getUserRoleCodec=OM;exports.getUserRoleDecoder=We;exports.getUserRoleEncoder=Ue;exports.getWalletAddressFromIndex=ed;exports.getWalletAddressFromSettings=Ie;exports.getWhitelistedAddressTreeCodec=Lh;exports.getWhitelistedAddressTreeDecoder=Ys;exports.getWhitelistedAddressTreeDiscriminatorBytes=Oh;exports.getWhitelistedAddressTreeEncoder=im;exports.getWhitelistedAddressTreeFromIndex=kn;exports.getWhitelistedAddressTreeIndexFromAddress=nr;exports.getWhitelistedAddressTreesAddress=Ki;exports.identifyMultiWalletAccount=uW;exports.identifyMultiWalletInstruction=AW;exports.initialize=i_;exports.isConfigAction=kC;exports.isMultiWalletError=fW;exports.isUserReadOnlyOrMutateArgs=UM;exports.nativeTransferIntent=YB;exports.parseAddWhitelistedAddressTreesInstruction=rP;exports.parseChangeConfigCompressedInstruction=IP;exports.parseChangeConfigInstruction=gP;exports.parseCompressSettingsAccountInstruction=vP;exports.parseCreateDomainConfigInstruction=HP;exports.parseCreateDomainUserAccountInstruction=qP;exports.parseCreateGlobalCounterInstruction=oE;exports.parseCreateMultiWalletCompressedInstruction=pE;exports.parseCreateUserAccountsInstruction=hE;exports.parseDecompressSettingsAccountInstruction=OE;exports.parseDisableDomainConfigInstruction=GE;exports.parseEditDomainConfigInstruction=$E;exports.parseEditTransactionManagerUrlInstruction=aR;exports.parseMigrateCompressedSettingsInstruction=lR;exports.parseMigrateCompressedUsersInstruction=ER;exports.parseNativeTransferIntentCompressedInstruction=JR;exports.parseNativeTransferIntentInstruction=wR;exports.parseSecp256r1VerifyInstruction=VO;exports.parseTokenTransferIntentCompressedInstruction=gb;exports.parseTokenTransferIntentInstruction=rb;exports.parseTransactionBufferCloseCompressedInstruction=vb;exports.parseTransactionBufferCloseInstruction=Ib;exports.parseTransactionBufferCreateCompressedInstruction=Yb;exports.parseTransactionBufferCreateInstruction=Nb;exports.parseTransactionBufferExecuteCompressedInstruction=gv;exports.parseTransactionBufferExecuteInstruction=nv;exports.parseTransactionBufferExtendCompressedInstruction=Rv;exports.parseTransactionBufferExtendInstruction=xv;exports.parseTransactionBufferVoteCompressedInstruction=Jv;exports.parseTransactionBufferVoteInstruction=wv;exports.parseTransactionExecuteCompressedInstruction=iU;exports.parseTransactionExecuteInstruction=eU;exports.parseTransactionExecuteSyncCompressedInstruction=PU;exports.parseTransactionExecuteSyncInstruction=lU;exports.pollJitoBundleConfirmation=lO;exports.prepareTransactionBundle=Ck;exports.prepareTransactionMessage=Lk;exports.prepareTransactionSync=Hk;exports.resolveTransactionManagerSigner=fO;exports.sendJitoBundle=II;exports.signAndSendBundledTransactions=pO;exports.signAndSendTransaction=TO;exports.signMessageWithPasskey=ek;exports.signTransactionWithPasskey=ok;exports.tokenTransferIntent=sw;exports.uninitialize=a_;exports.userReadOnlyOrMutateArgs=vM;exports.vaultTransactionMessageDeserialize=Ei;exports.vaultTransactionMessageSerialize=Pi;exports.verifyMessage=uk;exports.voteTransactionBuffer=kd;//# sourceMappingURL=index.cjs.map
1
+ 'use strict';var gill=require('gill'),ir=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'),server=require('@simplewebauthn/server');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var ir__default=/*#__PURE__*/_interopDefault(ir);var Kn=new Uint8Array([201,232,212,229,59,241,106,197]);function qI(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Kn)}function tu(){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:Kn}))}function Jn(){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 XI(){return gill.combineCodec(tu(),Jn())}function jn(e){return gill.decodeAccount(e,Jn())}async function Yn(e,n,r){let s=await ru(e,n,r);return gill.assertAccountExists(s),s}async function ru(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return jn(s)}async function $I(e,n,r){let s=await nu(e,n,r);return gill.assertAccountsExist(s),s}async function nu(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>jn(t))}function QI(){return 846}var Xn=new Uint8Array([42,206,176,58,175,129,130,233]);function rC(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Xn)}function lu(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()]]),e=>({...e,discriminator:Xn}))}function $n(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()]])}function nC(){return gill.combineCodec(lu(),$n())}function Qn(e){return gill.decodeAccount(e,$n())}async function sC(e,n,r){let s=await fu(e,n,r);return gill.assertAccountExists(s),s}async function fu(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Qn(s)}async function oC(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=>Qn(t))}function cC(){return 24}function yr(){return gill.getStructEncoder([["memberKey",z()],["permissions",be()],["verifyArgs",gill.getOptionEncoder(O())],["userArgs",$e()],["delegateOperation",Ee()]])}function mr(){return gill.getStructDecoder([["memberKey",K()],["permissions",ve()],["verifyArgs",gill.getOptionDecoder(L())],["userArgs",Qe()],["delegateOperation",Re()]])}function uC(){return gill.combineCodec(yr(),mr())}function pr(){return gill.getStructEncoder([["programAddressIndex",gill.getU8Encoder()],["accountIndices",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["data",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function Tr(){return gill.getStructDecoder([["programAddressIndex",gill.getU8Decoder()],["accountIndices",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["data",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function yC(){return gill.combineCodec(pr(),Tr())}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 lC(){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 IC(){return gill.combineCodec(st(),ot())}function Ir(){return gill.getStructEncoder([["a",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["b",gill.fixEncoderSize(gill.getBytesEncoder(),64)],["c",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function Cr(){return gill.getStructDecoder([["a",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["b",gill.fixDecoderSize(gill.getBytesDecoder(),64)],["c",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function MC(){return gill.combineCodec(Ir(),Cr())}function ct(){return gill.getStructEncoder([["data",gill.getOptionEncoder(at())]])}function j(){return gill.getStructDecoder([["data",gill.getOptionDecoder(it())]])}function RC(){return gill.combineCodec(ct(),j())}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 WC(){return gill.combineCodec(at(),it())}function At(){return gill.getDiscriminatedUnionEncoder([["EditPermissions",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(hr())])]])],["AddMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(yr())])]])],["RemoveMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Er())])]])],["SetThreshold",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getU8Encoder()])]])]])}function gt(){return gill.getDiscriminatedUnionDecoder([["EditPermissions",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(Pr())])]])],["AddMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(mr())])]])],["RemoveMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(Rr())])]])],["SetThreshold",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getU8Decoder()])]])]])}function BC(){return gill.combineCodec(At(),gt())}function wC(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function kC(e,n){return n.__kind===e}function br(){return gill.getStructEncoder([["member",gill.getAddressEncoder()],["role",Ue()],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userCreationArgs",de()]])}function vr(){return gill.getStructDecoder([["member",gill.getAddressDecoder()],["role",We()],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userCreationArgs",ue()]])}function GC(){return gill.combineCodec(br(),vr())}var Ht=(s=>(s[s.Add=0]="Add",s[s.Remove=1]="Remove",s[s.Ignore=2]="Ignore",s))(Ht||{});function Ee(){return gill.getEnumEncoder(Ht)}function Re(){return gill.getEnumDecoder(Ht)}function KC(){return gill.combineCodec(Ee(),Re())}function hr(){return gill.getStructEncoder([["memberKey",z()],["permissions",be()],["userArgs",gill.getOptionEncoder(Ae())],["delegateOperation",Ee()]])}function Pr(){return gill.getStructDecoder([["memberKey",K()],["permissions",ve()],["userArgs",gill.getOptionDecoder(ge())],["delegateOperation",Re()]])}function ZC(){return gill.combineCodec(hr(),Pr())}function Ur(){return gill.getStructEncoder([["settingsMutArgs",fe()],["transactionManager",gill.getOptionEncoder(Ae())]])}function Wr(){return gill.getStructDecoder([["settingsMutArgs",Se()],["transactionManager",gill.getOptionDecoder(ge())]])}function QC(){return gill.combineCodec(Ur(),Wr())}function dt(){return gill.getStructEncoder([["pubkey",z()],["permissions",be()],["role",gill.getU8Encoder()],["userAddressTreeIndex",gill.getU8Encoder()]])}function ut(){return gill.getStructDecoder([["pubkey",K()],["permissions",ve()],["role",gill.getU8Decoder()],["userAddressTreeIndex",gill.getU8Decoder()]])}function nD(){return gill.combineCodec(dt(),ut())}function z(){return gill.getStructEncoder([["keyType",gill.getU8Encoder()],["key",gill.fixEncoderSize(gill.getBytesEncoder(),33)]])}function K(){return gill.getStructDecoder([["keyType",gill.getU8Decoder()],["key",gill.fixDecoderSize(gill.getBytesDecoder(),33)]])}function cD(){return gill.combineCodec(z(),K())}function _r(){return gill.getStructEncoder([["authorityCreationArgs",de()],["compressedProofArgs",D()]])}function Or(){return gill.getStructDecoder([["authorityCreationArgs",ue()],["compressedProofArgs",M()]])}function uD(){return gill.combineCodec(_r(),Or())}function yt(){return gill.getStructEncoder([["addressMerkleTreePubkeyIndex",gill.getU8Encoder()],["addressQueuePubkeyIndex",gill.getU8Encoder()],["rootIndex",gill.getU16Encoder()]])}function mt(){return gill.getStructDecoder([["addressMerkleTreePubkeyIndex",gill.getU8Decoder()],["addressQueuePubkeyIndex",gill.getU8Decoder()],["rootIndex",gill.getU16Decoder()]])}function yD(){return gill.combineCodec(yt(),mt())}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 TD(){return gill.combineCodec(rt(),nt())}function be(){return gill.getStructEncoder([["mask",gill.getU8Encoder()]])}function ve(){return gill.getStructDecoder([["mask",gill.getU8Decoder()]])}function SD(){return gill.combineCodec(be(),ve())}function D(){return gill.getStructEncoder([["proof",gill.getOptionEncoder(Ir())],["lightCpiAccountsStartIndex",gill.getU8Encoder()]])}function M(){return gill.getStructDecoder([["proof",gill.getOptionDecoder(Cr())],["lightCpiAccountsStartIndex",gill.getU8Decoder()]])}function DD(){return gill.combineCodec(D(),M())}function Er(){return gill.getStructEncoder([["memberKey",z()],["userArgs",$e()]])}function Rr(){return gill.getStructDecoder([["memberKey",K()],["userArgs",Qe()]])}function ED(){return gill.combineCodec(Er(),Rr())}function Lr(){return gill.getTupleEncoder([gill.fixEncoderSize(gill.getBytesEncoder(),33)])}function pt(){return gill.getTupleDecoder([gill.fixDecoderSize(gill.getBytesDecoder(),33)])}function vD(){return gill.combineCodec(Lr(),pt())}function O(){return gill.getStructEncoder([["signedMessageIndex",gill.getU8Encoder()],["slotNumber",gill.getU64Encoder()],["originIndex",gill.getU8Encoder()],["crossOrigin",gill.getBooleanEncoder()],["truncatedClientDataJson",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function L(){return gill.getStructDecoder([["signedMessageIndex",gill.getU8Decoder()],["slotNumber",gill.getU64Decoder()],["originIndex",gill.getU8Decoder()],["crossOrigin",gill.getBooleanDecoder()],["truncatedClientDataJson",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function _D(){return gill.combineCodec(O(),L())}function Y(){return gill.getStructEncoder([["domainConfigKey",gill.getAddressEncoder()],["verifyArgs",O()]])}function Z(){return gill.getStructDecoder([["domainConfigKey",gill.getAddressDecoder()],["verifyArgs",L()]])}function wD(){return gill.combineCodec(Y(),Z())}function Tt(){return gill.getStructEncoder([["addressTreeInfo",yt()],["outputStateTreeIndex",gill.getU8Encoder()]])}function lt(){return gill.getStructDecoder([["addressTreeInfo",mt()],["outputStateTreeIndex",gill.getU8Decoder()]])}function VD(){return gill.combineCodec(Tt(),lt())}function Br(){return gill.getStructEncoder([["index",gill.getU128Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()]])}function wr(){return gill.getStructDecoder([["index",gill.getU128Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()]])}function zD(){return gill.combineCodec(Br(),wr())}function fe(){return gill.getStructEncoder([["accountMeta",et()],["data",ct()]])}function Se(){return gill.getStructDecoder([["accountMeta",tt()],["data",j()]])}function YD(){return gill.combineCodec(fe(),Se())}function X(){return gill.getStructEncoder([["accountMeta",st()],["data",ct()]])}function $(){return gill.getStructDecoder([["accountMeta",ot()],["data",j()]])}function $D(){return gill.combineCodec(X(),$())}function ft(){return gill.getStructEncoder([["bufferIndex",gill.getU8Encoder()],["preauthorizeExecution",gill.getBooleanEncoder()],["bufferExtendHashes",gill.getArrayEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))],["finalBufferHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["finalBufferSize",gill.getU16Encoder()],["expectedSigners",gill.getArrayEncoder(z())]])}function St(){return gill.getStructDecoder([["bufferIndex",gill.getU8Decoder()],["preauthorizeExecution",gill.getBooleanDecoder()],["bufferExtendHashes",gill.getArrayDecoder(gill.fixDecoderSize(gill.getBytesDecoder(),32))],["finalBufferHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["finalBufferSize",gill.getU16Decoder()],["expectedSigners",gill.getArrayDecoder(K())]])}function rM(){return gill.combineCodec(ft(),St())}function xt(){return gill.getStructEncoder([["numSigners",gill.getU8Encoder()],["numWritableSigners",gill.getU8Encoder()],["numWritableNonSigners",gill.getU8Encoder()],["numAccountKeys",gill.getU8Encoder()],["instructions",gill.getArrayEncoder(pr())],["addressTableLookups",gill.getArrayEncoder(kr())]])}function It(){return gill.getStructDecoder([["numSigners",gill.getU8Decoder()],["numWritableSigners",gill.getU8Decoder()],["numWritableNonSigners",gill.getU8Decoder()],["numAccountKeys",gill.getU8Decoder()],["instructions",gill.getArrayDecoder(Tr())],["addressTableLookups",gill.getArrayDecoder(Nr())]])}function cM(){return gill.combineCodec(xt(),It())}function kr(){return gill.getStructEncoder([["lookupTableAddressIndex",gill.getU8Encoder()],["writableIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["readonlyIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function Nr(){return gill.getStructDecoder([["lookupTableAddressIndex",gill.getU8Decoder()],["writableIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["readonlyIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function dM(){return gill.combineCodec(kr(),Nr())}function _e(){return gill.getStructEncoder([["member",z()],["domainConfig",gill.getOptionEncoder(gill.getAddressEncoder())],["role",Ue()],["delegatedTo",gill.getOptionEncoder(Br())],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userAddressTreeIndex",gill.getU8Encoder()]])}function q(){return gill.getStructDecoder([["member",K()],["domainConfig",gill.getOptionDecoder(gill.getAddressDecoder())],["role",We()],["delegatedTo",gill.getOptionDecoder(wr())],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userAddressTreeIndex",gill.getU8Decoder()]])}function yM(){return gill.combineCodec(_e(),q())}function de(){return gill.getStructEncoder([["addressTreeInfo",yt()],["outputStateTreeIndex",gill.getU8Encoder()]])}function ue(){return gill.getStructDecoder([["addressTreeInfo",mt()],["outputStateTreeIndex",gill.getU8Decoder()]])}function lM(){return gill.combineCodec(de(),ue())}function Ae(){return gill.getStructEncoder([["accountMeta",et()],["data",_e()]])}function ge(){return gill.getStructDecoder([["accountMeta",tt()],["data",q()]])}function IM(){return gill.combineCodec(Ae(),ge())}function Gr(){return gill.getStructEncoder([["accountMeta",st()],["data",_e()]])}function Fr(){return gill.getStructDecoder([["accountMeta",ot()],["data",q()]])}function hM(){return gill.combineCodec(Gr(),Fr())}function $e(){return gill.getDiscriminatedUnionEncoder([["Read",gill.getStructEncoder([["fields",gill.getTupleEncoder([Gr()])]])],["Mutate",gill.getStructEncoder([["fields",gill.getTupleEncoder([Ae()])]])]])}function Qe(){return gill.getDiscriminatedUnionDecoder([["Read",gill.getStructDecoder([["fields",gill.getTupleDecoder([Fr()])]])],["Mutate",gill.getStructDecoder([["fields",gill.getTupleDecoder([ge()])]])]])}function bM(){return gill.combineCodec($e(),Qe())}function vM(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function UM(e,n){return n.__kind===e}var Ve=(t=>(t[t.Member=0]="Member",t[t.PermanentMember=1]="PermanentMember",t[t.TransactionManager=2]="TransactionManager",t[t.Administrator=3]="Administrator",t))(Ve||{});function Ue(){return gill.getEnumEncoder(Ve)}function We(){return gill.getEnumDecoder(Ve)}function OM(){return gill.combineCodec(Ue(),We())}var Os=new Uint8Array([223,179,163,190,177,224,67,173]);function Ih(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Os)}function Dy(){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:Os}))}function Ls(){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 Ch(){return gill.combineCodec(Dy(),Ls())}function Bs(e){return gill.decodeAccount(e,Ls())}async function Dh(e,n,r){let s=await Jr(e,n,r);return gill.assertAccountExists(s),s}async function Jr(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Bs(s)}async function Mh(e,n,r){let s=await My(e,n,r);return gill.assertAccountsExist(s),s}async function My(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Bs(t))}function hh(){return 184}var Vs=new Uint8Array([90,36,35,219,93,225,110,96]);function bh(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Vs)}function Gy(){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",z()],["executor",z()],["bufferExtendHashes",gill.getArrayEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))],["voters",gill.getArrayEncoder(z())],["expectedSigners",gill.getArrayEncoder(z())],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:Vs}))}function Gs(){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",K()],["executor",K()],["bufferExtendHashes",gill.getArrayDecoder(gill.fixDecoderSize(gill.getBytesDecoder(),32))],["voters",gill.getArrayDecoder(K())],["expectedSigners",gill.getArrayDecoder(K())],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function vh(){return gill.combineCodec(Gy(),Gs())}function Fs(e){return gill.decodeAccount(e,Gs())}async function zs(e,n,r){let s=await Fy(e,n,r);return gill.assertAccountExists(s),s}async function Fy(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Fs(s)}async function Uh(e,n,r){let s=await zy(e,n,r);return gill.assertAccountsExist(s),s}async function zy(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Fs(t))}var js=new Uint8Array([105,23,173,2,197,255,80,87]);function Oh(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(js)}function im(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["whitelistedAddressTrees",gill.getArrayEncoder(gill.getAddressEncoder())],["bump",gill.getU8Encoder()]]),e=>({...e,discriminator:js}))}function Ys(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["whitelistedAddressTrees",gill.getArrayDecoder(gill.getAddressDecoder())],["bump",gill.getU8Decoder()]])}function Lh(){return gill.combineCodec(im(),Ys())}function Zs(e){return gill.decodeAccount(e,Ys())}async function qs(e,n,r){let s=await dm(e,n,r);return gill.assertAccountExists(s),s}async function dm(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Zs(s)}async function Bh(e,n,r){let s=await um(e,n,r);return gill.assertAccountsExist(s),s}async function um(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Zs(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 $s(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}function V(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:V(r.value),role:Xs(r.value)?gill.upgradeRoleToSigner(s):s,...Xs(r.value)?{signer:r.value}:{}})}}function Xs(e){return !!e&&typeof e=="object"&&"address"in e&&gill.isTransactionSigner(e)}var eo=new Uint8Array([7]);function Qh(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(eo)}function en(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["addressTree",gill.getAddressEncoder()]]),e=>({...e,discriminator:eo}))}function to(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["addressTree",gill.getAddressDecoder()]])}function eP(){return gill.combineCodec(en(),to())}async function ro(e,n){let r=n?.programAddress??u,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:en().encode(c),programAddress:r})}function tP(e,n){let r=n?.programAddress??u,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:en().encode(c),programAddress:r})}function rP(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:to().decode(e.data)}}var co=new Uint8Array([8]);function dP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(co)}function tn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsIndex",gill.getU128Encoder()],["configActions",gill.getArrayEncoder(At())],["compressedProofArgs",gill.getOptionEncoder(D())]]),e=>({...e,discriminator:co}))}function ao(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsIndex",gill.getU128Decoder()],["configActions",gill.getArrayDecoder(gt())],["compressedProofArgs",gill.getOptionDecoder(M())]])}function uP(){return gill.combineCodec(tn(),ao())}async function io(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.settings.value||(t.settings.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getU128Encoder().encode($s(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(V(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:tn().encode(c),programAddress:r})}function AP(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=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:tn().encode(c),programAddress:r})}function gP(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),authority:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:ao().decode(e.data)}}var go=new Uint8Array([19]);function SP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(go)}function yo(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["configActions",gill.getArrayEncoder(At())],["settingsMut",fe()],["compressedProofArgs",D()]]),e=>({...e,discriminator:go}))}function mo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["configActions",gill.getArrayDecoder(gt())],["settingsMut",Se()],["compressedProofArgs",M()]])}function xP(){return gill.combineCodec(yo(),mo())}function po(e,n){let r=n?.programAddress??u,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:yo().encode(c),programAddress:r})}function IP(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===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),authority:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:mo().decode(e.data)}}var fo=new Uint8Array([16]);function RP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(fo)}function So(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",D()],["settingsMutArgs",fe()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())]]),e=>({...e,discriminator:fo}))}function xo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",M()],["settingsMutArgs",Se()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())]])}function bP(){return gill.combineCodec(So(),xo())}function Io(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},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:So().encode(c),programAddress:r})}function vP(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===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:xo().decode(e.data)}}var Do=new Uint8Array([0]);function wP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Do)}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()))],["metadataUrl",gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())],["authorityCreationArgs",de()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Do}))}function Mo(){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",ue()],["compressedProofArgs",M()]])}function kP(){return gill.combineCodec(un(),Mo())}async function ho(e,n){let r=n?.programAddress??u,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=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:un().encode(c),programAddress:r})}function NP(e,n){let r=n?.programAddress??u,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=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:un().encode(c),programAddress:r})}function HP(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:Mo().decode(e.data)}}var Eo=new Uint8Array([4]);function jP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Eo)}function gn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",D()],["member",Lr()],["role",Ue()],["userAccountCreationArgs",de()],["linkWalletArgs",gill.getOptionEncoder(Ur())]]),e=>({...e,discriminator:Eo}))}function Ro(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",M()],["member",pt()],["role",We()],["userAccountCreationArgs",ue()],["linkWalletArgs",gill.getOptionDecoder(Wr())]])}function YP(){return gill.combineCodec(gn(),Ro())}async function bo(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:gn().encode(c),programAddress:r})}function ZP(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:gn().encode(c),programAddress:r})}function qP(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:Ro().decode(e.data)}}var Uo=new Uint8Array([3]);function rE(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Uo)}function mn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:Uo}))}function Wo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function nE(){return gill.combineCodec(mn(),Wo())}async function _o(e,n){let r=n?.programAddress??u,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(c),i=p(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:mn().encode({}),programAddress:r})}function sE(e,n){let r=n?.programAddress??u,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(c),i=p(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:mn().encode({}),programAddress:r})}function oE(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 Bo=new Uint8Array([18]);function gE(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Bo)}function pn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(O())],["compressedProofArgs",D()],["settingsCreation",Tt()],["userMutArgs",Ae()],["settingsIndex",gill.getU128Encoder()],["delegateOperation",Ee()]]),e=>({...e,discriminator:Bo}))}function wo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(L())],["compressedProofArgs",M()],["settingsCreation",lt()],["userMutArgs",ge()],["settingsIndex",gill.getU128Decoder()],["delegateOperation",Re()]])}function yE(){return gill.combineCodec(pn(),wo())}async function ko(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},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:pn().encode(c),programAddress:r})}function mE(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},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:pn().encode(c),programAddress:r})}function pE(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s(),globalCounter:r(),whitelistedAddressTrees:r()},data:wo().decode(e.data)}}var Ho=new Uint8Array([5]);function CE(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ho)}function ln(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",D()],["createUserArgs",gill.getArrayEncoder(br())]]),e=>({...e,discriminator:Ho}))}function Vo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",M()],["createUserArgs",gill.getArrayDecoder(vr())]])}function DE(){return gill.combineCodec(ln(),Vo())}async function Go(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:ln().encode(c),programAddress:r})}function ME(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:ln().encode(c),programAddress:r})}function hE(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:Vo().decode(e.data)}}var Ko=new Uint8Array([17]);function WE(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ko)}function Jo(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsMut",fe()],["compressedProofArgs",D()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())]]),e=>({...e,discriminator:Ko}))}function jo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsMut",Se()],["compressedProofArgs",M()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())]])}function _E(){return gill.combineCodec(Jo(),jo())}function Yo(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=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:Jo().encode(c),programAddress:r})}function OE(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:jo().decode(e.data)}}var Xo=new Uint8Array([2]);function HE(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Xo)}function $o(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["disable",gill.getBooleanEncoder()]]),e=>({...e,discriminator:Xo}))}function Qo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["disable",gill.getBooleanDecoder()]])}function VE(){return gill.combineCodec($o(),Qo())}function ec(e,n){let r=n?.programAddress??u,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},i=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),...i],data:$o().encode(c),programAddress:r})}function GE(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:Qo().decode(e.data)}}var ic=new Uint8Array([1]);function ZE(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ic)}function In(){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(_r())],["newMetadataUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))]]),e=>({...e,discriminator:ic}))}function dc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["newOrigins",gill.getOptionDecoder(gill.getArrayDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())))],["newAuthorityArgs",gill.getOptionDecoder(Or())],["newMetadataUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))]])}function qE(){return gill.combineCodec(In(),dc())}async function XE(e,n){let r=n?.programAddress??u,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=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:In().encode(c),programAddress:r})}function uc(e,n){let r=n?.programAddress??u,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=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:In().encode(c),programAddress:r})}function $E(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:s(),whitelistedAddressTrees:s(),systemProgram:r()},data:dc().decode(e.data)}}var yc=new Uint8Array([6]);function oR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(yc)}function mc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",Ae()],["transactionManagerUrl",gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())],["compressedProofArgs",D()]]),e=>({...e,discriminator:yc}))}function pc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",ge()],["transactionManagerUrl",gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())],["compressedProofArgs",M()]])}function cR(){return gill.combineCodec(mc(),pc())}function Tc(e,n){let r=n?.programAddress??u,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:mc().encode(c),programAddress:r})}function aR(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:pc().decode(e.data)}}var Sc=new Uint8Array([32]);function mR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Sc)}function xc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",at()],["compressedProofArgs",D()],["settingsCreationArgs",Tt()]]),e=>({...e,discriminator:Sc}))}function Ic(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",it()],["compressedProofArgs",M()],["settingsCreationArgs",lt()]])}function pR(){return gill.combineCodec(xc(),Ic())}function TR(e,n){let r=n?.programAddress??u,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.authority),...i],data:xc().encode(c),programAddress:r})}function lR(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:Ic().decode(e.data)}}var Mc=new Uint8Array([31]);function MR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Mc)}function hc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",_e()],["compressedProofArgs",D()],["userCreationArgs",de()]]),e=>({...e,discriminator:Mc}))}function Pc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",q()],["compressedProofArgs",M()],["userCreationArgs",ue()]])}function hR(){return gill.combineCodec(hc(),Pc())}function PR(e,n){let r=n?.programAddress??u,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.authority),...i],data:hc().encode(c),programAddress:r})}function ER(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:Pc().decode(e.data)}}var Rc=new Uint8Array([29]);function OR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Rc)}function Cn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())]]),e=>({...e,discriminator:Rc}))}function bc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())]])}function LR(){return gill.combineCodec(Cn(),bc())}async function BR(e,n){let r=n?.programAddress??u,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(V(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:Cn().encode(c),programAddress:r})}function vc(e,n){let r=n?.programAddress??u,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:Cn().encode(c),programAddress:r})}function wR(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:bc().decode(e.data)}}var _c=new Uint8Array([27]);function zR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(_c)}function Oc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())],["settingsReadonlyArgs",X()],["compressedProofArgs",D()]]),e=>({...e,discriminator:_c}))}function Lc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())],["settingsReadonlyArgs",$()],["compressedProofArgs",M()]])}function KR(){return gill.combineCodec(Oc(),Lc())}function Bc(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=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:Oc().encode(c),programAddress:r})}function JR(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Lc().decode(e.data)}}var kc=new Uint8Array([30]);function QR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(kc)}function Mn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())]]),e=>({...e,discriminator:kc}))}function Nc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())]])}function eb(){return gill.combineCodec(Mn(),Nc())}async function tb(e,n){let r=n?.programAddress??u,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(V(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(V(t.source.value)),gill.getAddressEncoder().encode(V(t.tokenProgram.value)),gill.getAddressEncoder().encode(V(t.mint.value))]})),t.destinationTokenAccount.value||(t.destinationTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(V(t.destination.value)),gill.getAddressEncoder().encode(V(t.tokenProgram.value)),gill.getAddressEncoder().encode(V(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:Mn().encode(c),programAddress:r})}function Hc(e,n){let r=n?.programAddress??u,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:Mn().encode(c),programAddress:r})}function rb(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===u?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:Nc().decode(e.data)}}var zc=new Uint8Array([28]);function db(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(zc)}function hn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())],["settingsReadonlyArgs",X()],["compressedProofArgs",D()]]),e=>({...e,discriminator:zc}))}function Kc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())],["settingsReadonlyArgs",$()],["compressedProofArgs",M()]])}function ub(){return gill.combineCodec(hn(),Kc())}async function Ab(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},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(V(t.source.value)),gill.getAddressEncoder().encode(V(t.tokenProgram.value)),gill.getAddressEncoder().encode(V(t.mint.value))]})),t.destinationTokenAccount.value||(t.destinationTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(V(t.destination.value)),gill.getAddressEncoder().encode(V(t.tokenProgram.value)),gill.getAddressEncoder().encode(V(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:hn().encode(c),programAddress:r})}function Jc(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},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:hn().encode(c),programAddress:r})}function gb(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===u?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:Kc().decode(e.data)}}var Zc=new Uint8Array([12]);function Sb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Zc)}function qc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(O())]]),e=>({...e,discriminator:Zc}))}function Xc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(L())]])}function xb(){return gill.combineCodec(qc(),Xc())}function $c(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},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:qc().encode(c),programAddress:r})}function Ib(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:Xc().decode(e.data)}}var ta=new Uint8Array([23]);function Rb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ta)}function ra(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(O())],["settingsReadonlyArgs",X()],["compressedProofArgs",D()]]),e=>({...e,discriminator:ta}))}function na(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(L())],["settingsReadonlyArgs",$()],["compressedProofArgs",M()]])}function bb(){return gill.combineCodec(ra(),na())}function sa(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=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:ra().encode(c),programAddress:r})}function vb(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:na().decode(e.data)}}var aa=new Uint8Array([9]);function wb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(aa)}function ia(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",ft()],["secp256r1VerifyArgs",gill.getOptionEncoder(O())]]),e=>({...e,discriminator:aa}))}function da(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",St()],["secp256r1VerifyArgs",gill.getOptionDecoder(L())]])}function kb(){return gill.combineCodec(ia(),da())}function ua(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=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:ia().encode(c),programAddress:r})}function Nb(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:da().decode(e.data)}}var ya=new Uint8Array([20]);function Jb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ya)}function ma(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",ft()],["secp256r1VerifyArgs",gill.getOptionEncoder(O())],["settingsReadonlyArgs",X()],["compressedProofArgs",D()]]),e=>({...e,discriminator:ya}))}function pa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",St()],["secp256r1VerifyArgs",gill.getOptionDecoder(L())],["settingsReadonlyArgs",$()],["compressedProofArgs",M()]])}function jb(){return gill.combineCodec(ma(),pa())}function Ta(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=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:ma().encode(c),programAddress:r})}function Yb(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:pa().decode(e.data)}}var Sa=new Uint8Array([13]);function tv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Sa)}function xa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(O())]]),e=>({...e,discriminator:Sa}))}function Ia(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(L())]])}function rv(){return gill.combineCodec(xa(),Ia())}function Ca(e,n){let r=n?.programAddress??u,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:xa().encode(c),programAddress:r})}function nv(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ia().decode(e.data)}}var ha=new Uint8Array([24]);function uv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ha)}function Pa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(O())],["settingsReadonlyArgs",X()],["compressedProofArgs",D()]]),e=>({...e,discriminator:ha}))}function Ea(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(L())],["settingsReadonlyArgs",$()],["compressedProofArgs",M()]])}function Av(){return gill.combineCodec(Pa(),Ea())}function Ra(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=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:Pa().encode(c),programAddress:r})}function gv(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ea().decode(e.data)}}var Ua=new Uint8Array([11]);function fv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ua)}function Wa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:Ua}))}function _a(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function Sv(){return gill.combineCodec(Wa(),_a())}function Oa(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.transactionBuffer),...i],data:Wa().encode(c),programAddress:r})}function xv(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:_a().decode(e.data)}}var wa=new Uint8Array([22]);function Pv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(wa)}function ka(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:wa}))}function Na(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["settingsKey",gill.getAddressDecoder()]])}function Ev(){return gill.combineCodec(ka(),Na())}function Ha(e,n){let r=n?.programAddress??u,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:ka().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:{transactionBuffer:r()},data:Na().decode(e.data)}}var Fa=new Uint8Array([10]);function Lv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Fa)}function za(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(O())]]),e=>({...e,discriminator:Fa}))}function Ka(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(L())]])}function Bv(){return gill.combineCodec(za(),Ka())}function Ja(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=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:za().encode(c),programAddress:r})}function wv(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ka().decode(e.data)}}var Za=new Uint8Array([21]);function zv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Za)}function qa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(O())],["settingsReadonlyArgs",X()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Za}))}function Xa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(L())],["settingsReadonlyArgs",$()],["compressedProofArgs",M()]])}function Kv(){return gill.combineCodec(qa(),Xa())}function $a(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=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:qa().encode(c),programAddress:r})}function Jv(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Xa().decode(e.data)}}var ti=new Uint8Array([14]);function $v(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ti)}function ri(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:ti}))}function ni(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function Qv(){return gill.combineCodec(ri(),ni())}function si(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},a=m({}),i=p(r);return Object.freeze({accounts:[i(t.settings),i(t.payer),i(t.transactionBuffer),...a],data:ri().encode({}),programAddress:r})}function eU(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:ni().decode(e.data)}}var ai=new Uint8Array([25]);function cU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ai)}function ii(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:ai}))}function di(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsKey",gill.getAddressDecoder()]])}function aU(){return gill.combineCodec(ii(),di())}function ui(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.transactionBuffer),...i],data:ii().encode(c),programAddress:r})}function iU(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:di().decode(e.data)}}var yi=new Uint8Array([15]);function pU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(yi)}function mi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",xt()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())]]),e=>({...e,discriminator:yi}))}function pi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",It()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())]])}function TU(){return gill.combineCodec(mi(),pi())}function Ti(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:mi().encode(c),programAddress:r})}function lU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:pi().decode(e.data)}}var Si=new Uint8Array([26]);function MU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Si)}function xi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",xt()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())],["settingsReadonlyArgs",X()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Si}))}function Ii(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",It()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())],["settingsReadonlyArgs",$()],["compressedProofArgs",M()]])}function hU(){return gill.combineCodec(xi(),Ii())}function Ci(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:xi().encode(c),programAddress:r})}function PU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Ii().decode(e.data)}}var u="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",vS=(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))(vS||{});function uW(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 US=(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))(US||{});function AW(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 _S=6e3,OS=6001,LS=6002,BS=6003,wS=6004,kS=6005,NS=6006,HS=6007,VS=6008,GS=6009,FS=6010,zS=6011,KS=6012,JS=6013,jS=6014,YS=6015,ZS=6016,qS=6017,XS=6018,$S=6019,QS=6020,ex=6021,tx=6022,rx=6023,nx=6024,sx=6025,ox=6026,cx=6027,ax=6028,ix=6029,dx=6030,ux=6031,Ax=6032,gx=6033,yx=6034,mx=6035,px=6036,Tx=6037,lx=6038,fx=6039,Sx=6040,xx=6041,Di;process.env.NODE_ENV!=="production"&&(Di={[XS]:"This member is already delegated to another wallet.",[px]:"The domain configuration account is disabled. Please contact support or try again later.",[Tx]:"Missing domain configuration account.",[BS]:"Duplicate public keys detected among members. Each member must have a unique key.",[LS]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[GS]:"No members provided. A multisig wallet must contain at least one member.",[ox]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[cx]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[ax]:"Declared buffer size does not match the actual serialized size.",[ex]:"Not enough members with vote permission to meet the approval threshold.",[$S]:"At least one signer with execute permission is required to proceed.",[QS]:"At least one signer with initiate permission is required to perform this action.",[jS]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[xx]:"Address Tree supplied is not part of the whitelisted address trees",[YS]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[sx]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[JS]:"Unexpected number of accounts provided for this instruction.",[OS]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[_S]:"Invalid signature: the provided signature does not match the expected message payload.",[yx]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[zS]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[KS]:"Malformed transaction message: structure or formatting does not match the expected layout.",[Ax]:"An input string exceeds the maximum allowed character length.",[lx]:"This member is not registered under the provided domain configuration.",[ZS]:"A required account is missing from the instruction context.",[gx]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[qS]:"User mutation arguments are required when performing add or remove delegate operations.",[rx]:"No valid signer found in this transaction.",[NS]:"Only one permanent member is allowed per wallet.",[HS]:"Only one transaction manager is allowed per wallet.",[Sx]:"The given origin index is not in the whitelisted origins.",[wS]:"Permanent members cannot be removed from a wallet.",[kS]:"This operation cannot assign a permanent member.",[ux]:"Writable CPI calls to protected accounts are not permitted.",[fx]:"The relying party ID hash does not match the one defined in the domain configuration.",[mx]:"The specified slot number was not found in the provided slot history.",[FS]:"Too many members: a maximum of 4 members are supported.",[ix]:"This transaction has expired. It must be executed within 3 minutes of approval.",[VS]:"Unable to assign a transaction manager.",[dx]:"This transaction has not yet reached the required approval threshold.",[nx]:"Only the transaction creator or rent payer may close this transaction buffer.",[tx]:"Member is not part of the expected signers for this transaction."});function lW(e){return process.env.NODE_ENV!=="production"?Di[e]:"Error message not available in production bundles."}function fW(e,n,r){return gill.isProgramError(e,n,u,r)}var Pt={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 Rn=33,ae=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!==Rn)throw new Error(`Invalid public key length, expected ${Rn} 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===Rn)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()}},h=class extends ae{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 Dx(){return gill.getStructCodec([["programAddressIndex",gill.getU8Codec()],["accountIndices",gill.getArrayCodec(gill.getU8Codec())],["data",gill.getArrayCodec(gill.getU8Codec())]])}function Mx(){return gill.getStructCodec([["lookupTableAddress",gill.getAddressCodec()],["writableIndexes",gill.getArrayCodec(gill.getU8Codec())],["readonlyIndexes",gill.getArrayCodec(gill.getU8Codec())]])}var hi=gill.getStructCodec([["numSigners",gill.getU8Codec()],["numWritableSigners",gill.getU8Codec()],["numWritableNonSigners",gill.getU8Codec()],["accountKeys",gill.getArrayCodec(gill.getAddressCodec())],["instructions",gill.getArrayCodec(Dx())],["addressTableLookups",gill.getArrayCodec(Mx())]]);function Pi(e){return hi.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 Ei(e){let n=hi.decode(e);return {header:{numSignerAccounts:n.numSigners,numReadonlySignerAccounts:n.numSigners-n.numWritableSigners,numReadonlyNonSignerAccounts:n.accountKeys.length-n.numSigners-n.numWritableNonSigners},addressTableLookups:n.addressTableLookups.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes.map(Number),writableIndexes:r.writableIndexes.map(Number),readableIndices:r.readonlyIndexes.map(Number),writableIndices:r.writableIndexes.map(Number)})),instructions:n.instructions.map(r=>({accountIndices:r.accountIndices.map(Number),data:new Uint8Array(r.data),programAddressIndex:r.programAddressIndex})),lifetimeToken:u,staticAccounts:n.accountKeys,version:0}}stateless_js.featureFlags.version=stateless_js.VERSION.V2;var Ri="revibase.com",bi="https://auth.revibase.com",vi="https://api.revibase.com";async function Un(e,n=false){let r=n?{blockhash:gill.getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await Q().getLatestBlockhash().send()).value;return await Promise.all(e.map(async 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 _i(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 Oi(e,n){if(e.length===0)throw new Error("Bundle is empty.");for(let c=0;c<e.length;c++){if(e[c].length>1644)throw new Error(`Transaction ${c} exceeds maximum length, ${e[c].length}. Retry again.`);console.log(`Transaction ${c} length: ${e[c].length}`);}let r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:"2",method:"simulateBundle",params:[{encodedTransactions:e},{skipSigVerify:true,replaceRecentBlockhash:true,preExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]})),postExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]}))}]})});if(!r.ok)throw console.error(await r.json()),new Error("Failed to simulate bundle");let{result:s,error:t}=await r.json();if(!s||t)throw console.error(t??s),new Error(`Unable to simulate bundle: ${JSON.stringify(t??s)}`);if(typeof s.value.summary!="string"&&s.value.summary.failed){let{TransactionFailure:c}=s.value.summary.failed.error,[,a]=c;throw console.error(t??s),new Error(`Simulation failed: ${a}`)}return s.value.transactionResults.map(c=>c.unitsConsumed)}function k(e,n=0){let r=e instanceof h?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 Fe(e){if(e instanceof ae)return {keyType:Pt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:Pt.Ed25519,key:new Uint8Array([0,...gill.getAddressEncoder().encode(n)])}}}function Wi(e){return e instanceof h?e.toString():e.address.toString()}function ye(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 h).length>1)throw new Error("More than 1 Secp256r1 signers in an instruction is not supported.");return r}function Li({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 Bi(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 ze=null,Zt=null,qt=null,Xt=null,$t,Yt=null,Wn=null,Qt=null,_n=null,On=null,Ln=null,wi=null;function ki(){if(!ze)throw new Error("Rpc is not initialized yet.");return ze}function Et(){if(!Zt)throw new Error("Rpc is not initialized yet");return Zt}function Q(){if(!qt)throw new Error("Rpc is not initialized yet");return qt}function Ni(){if(!Xt)throw new Error("Rpc is not initialized yet.");return Xt}function Hi(){if(!$t)throw new Error("Rpc is not initialized yet");return $t}async function a_(){return Yt||(Yt=await Bi(Wn??vi)),Yt}function Bn(){if(!Qt)throw new Error("Jito Bundle Config is not set.");return Qt}function he(){return _n??bi}function Vi(){return On??Ri}function Gi(){return Ln}function er(){return wi}function i_(){Zt=null,qt=null,ze=null,Yt=null,Wn=null,Qt=null,_n=null,On=null,Xt=null,$t=null,Ln=null;}function d_({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s,apiEndpoint:t,authEndpoint:c,rpId:a,authorizedClient:i,additionalInfo:o}){ze=e,Zt=stateless_js.createRpc(ze,r,n);let{rpc:d,sendAndConfirmTransaction:A}=gill.createSolanaClient({urlOrMoniker:ze});Xt=A,$t=programs.estimateComputeUnitLimitFactory({rpc:d}),qt=d,Wn=t??null,Qt=s??null,_n=c??null,On=a??null,Ln=i??null,wi=o??null;}var N=class{preAccounts;systemAccounts;nextIndex;map;outputTreeIndex;constructor(){this.preAccounts=[],this.systemAccounts=[],this.nextIndex=0,this.map=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){this.preAccounts.push(...n);}getAccountRole(n,r){return n?r?gill.AccountRole.WRITABLE_SIGNER:gill.AccountRole.READONLY_SIGNER:r?gill.AccountRole.WRITABLE:gill.AccountRole.READONLY}async addSystemAccounts(){this.systemAccounts.push(...stateless_js.getLightSystemAccountMetasV2({selfProgram:new web3_js.PublicKey(u.toString())}).map(n=>({address:gill.address(n.pubkey.toString()),role:this.getAccountRole(n.isSigner,n.isWritable)})));}insertOrGet(n){return this.insertOrGetConfig(n,gill.AccountRole.WRITABLE)}insertOrGetConfig(n,r){if(!this.map.has(n)){let s=this.nextIndex++,t={address:gill.address(n),role:r};this.map.set(n,{index:s,accountMeta:t});}return this.map.get(n).index}packOutputTreeIndex(n){if(n.treeType===stateless_js.TreeType.StateV1)return this.insertOrGet(n.tree.toString());if(n.treeType===stateless_js.TreeType.StateV2)return this.insertOrGet(n.queue.toString());throw new Error("Tree type not supported")}async getOutputTreeIndex(){if(this.outputTreeIndex!==-1)return this.outputTreeIndex;let n=await Et().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 tr(e,n){let r=n?.get(e.toString());if(r)return r;{let s=await Et().getCompressedAccount(e);return s&&n?.set(e.toString(),s),s}}async function se(e,n){let s=(await Promise.all(e.map(async t=>tr(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 me(e,n,r,s,t){if(t.length===0)return [];let c=t.map((d,A)=>({treeInfo:n[A],root:r[A],rootIndex:s[A],address:d.address.toArray()})),{addressTrees:a}=e.packTreeInfos([],c),i=await e.getOutputTreeIndex();return t.map((d,A)=>({addressTreeInfo:a[A],outputStateTreeIndex:i,address:d.address,type:d.type}))}function te(e,n,r,s,t,c,a){let i=[];for(let A=0;A<n.length;A++)i.push({treeInfo:n[A],rootIndex:s[A],leafIndex:r[A],proveByIndex:t[A],hash:c[A].hash});let o=e.packTreeInfos(i,[]).stateTrees;if(!o)throw new Error("Unable to parsed data.");return c.map((A,g)=>({data:a.decode(A.data.data),accountMeta:{treeInfo:o.packedTreeInfos[g],address:new Uint8Array(A.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function pe(e,n,r,s,t){let c=null,a=null,i=new N;if(e){await i.addSystemAccounts();let{address:o}=await re(n,r),d=(await se([{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 F([d],[]);let A=i.packTreeInfos([{treeInfo:a.treeInfos[0],rootIndex:a.rootIndices[0],leafIndex:a.leafIndices[0],proveByIndex:a.proveByIndices[0],hash:d.hash}],[]).stateTrees;if(!A)throw new Error("Unable to parsed data.");c={accountMeta:{address:new Uint8Array(d.address),treeInfo:A.packedTreeInfos[0]},data:j().decode(d.data?.data)};}return {settingsReadonlyArgs:c,proof:a,packedAccounts:i}}async function F(e,n,r=10,s=400){let t=1;for(;t<r;)try{return await Et().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 rr()).length-1}var wn;async function rr(){if(!wn){let{data:e}=await qs(Q(),await Ki());wn=e.whitelistedAddressTrees;}return wn}async function Ji(e,n,r){let s=await $x(e,n,r);if(!s)throw new Error("User cannot be found.");return s}async function $x(e,n,r){let{address:s}=await B(e,n),t=await tr(s,r);return t?.data?.data?q().decode(t.data.data):null}async function ji(e,n,r){let s=await Qx(e,n,r);if(!s)throw new Error("Settings cannot be found.");return s}async function Qx(e,n,r){try{let{address:s}=await re(e,n),t=await tr(s,r);if(!t?.data?.data)return null;let c=j().decode(t.data.data);return c.data.__option==="None"?null:{...c.data.value,isCompressed:!0}}catch{let s=await Jr(Q(),await ee(e));return s.exists?{...s.data,members:s.data.members.slice(0,s.data.membersLen),isCompressed:false}:null}}async function kn(e){let n=await rr();if(e<0||e>=n.length)throw new Error(`Invalid address tree index: ${e}`);return n[e]}async function nr(e){let r=(await rr()).findIndex(s=>s===e);if(r===-1)throw new Error(`Address tree not found: ${e}`);return r}async function re(e,n=0){let r=await kn(n),s=stateless_js.deriveAddressSeedV2([new Uint8Array(gill.getUtf8Encoder().encode("multi_wallet")),new Uint8Array(gill.getU128Encoder().encode(e))]);return {address:stateless_js.createBN254(stateless_js.deriveAddressV2(s,new web3_js.PublicKey(r),new web3_js.PublicKey(u)).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function B(e,n=0){let r=await kn(n),s=stateless_js.deriveAddressSeedV2([new Uint8Array(gill.getUtf8Encoder().encode("user")),e instanceof ae?e.toTruncatedBuffer():new Uint8Array(gill.getAddressEncoder().encode(e))]);return {address:stateless_js.createBN254(stateless_js.deriveAddressV2(s,new web3_js.PublicKey(r),new web3_js.PublicKey(u.toString())).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function 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:u,seeds:[gill.getUtf8Encoder().encode("domain_config"),e]});return r}async function $i(){let[e]=await gill.getProgramDerivedAddress({programAddress:u,seeds:[gill.getUtf8Encoder().encode("global_counter")]});return e}async function Ki(){let[e]=await gill.getProgramDerivedAddress({programAddress:u,seeds:[gill.getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function Qi(e,n,r){if(r>255)throw new Error("Index cannot be greater than 255.");let[s]=await gill.getProgramDerivedAddress({programAddress:u,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("transaction_buffer"),n instanceof ae?n.toTruncatedBuffer():gill.getAddressEncoder().encode(n),gill.getU8Encoder().encode(r)]});return s}async function Ie(e){let[n]=await gill.getProgramDerivedAddress({programAddress:u,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("vault")]});return n}async function ee(e){let[n]=await gill.getProgramDerivedAddress({programAddress:u,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getU128Encoder().encode(e)]});return n}async function ed(e){let n=await ee(e);return await Ie(n)}async function N_(){let[e]=await gill.getProgramDerivedAddress({programAddress:u,seeds:[gill.getUtf8Encoder().encode("cpi_authority")]});return e}var je=null,rd=2e3,nd=3e3,rI=300*1e3;async function or({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),A=setTimeout(()=>{y("Authentication timeout."),g(),a(new Error("Authentication timed out"));},rI);function g(){clearInterval(d),clearTimeout(A),o&&clearTimeout(o),je&&window.removeEventListener("message",je),s&&s.close();}if(s?s.location.replace(e):s=ad(e),!s){a(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===i,C=l.source===s;if(!I||!C||!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}},i),o=setTimeout(()=>{g(),a(new Error("User closed the authentication window"));},rd+nd);break;case "popup-complete":y("Received completion message");try{let b=JSON.parse(l.data.payload);g(),c(b);}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"));},rd+nd));break;case "popup-closed":y("Popup explicitly closed"),g(),a(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 cr(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function bt(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 ar(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function nI(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 sd(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 od(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 cd(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 a=e[r+1],i=r+2,o=e.slice(i,i+a),d=c[0]===0&&c.length>32?c.slice(1):c,A=o[0]===0&&o.length>32?o.slice(1):o;if(d.length>32||A.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(d,32-d.length);let y=p256.p256.Point.CURVE().n>>1n,f=BigInt("0x"+ar(A)),I=(f>y?p256.p256.Point.CURVE().n-f:f).toString(16).padStart(64,"0"),C=nI(I);return new Uint8Array([...g,...C])}function ad(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 A=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=A+(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 rO(e){let n=tinyCbor.decodeCBOR(e),r=p256.p256.Point.fromAffine({x:BigInt("0x"+ar(n.get(-2))),y:BigInt("0x"+ar(n.get(-3)))});return gill.getBase58Decoder().decode(r.toBytes(true))}function ud(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 nO(e,n=0,r=false){let{authenticatorData:s,clientDataJSON:t,signature:c}=e.authResponse.response,a=new Uint8Array(bt(s)),i=JSON.parse(new TextDecoder().decode(bt(t))),o=sd(i),d=cd(new Uint8Array(bt(c))),A=await Je({rpIdHash:a.subarray(0,32)});return new h(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(bt(t)),truncatedClientDataJson:o,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(gill.getBase58Encoder().encode(e.slotHash))},domainConfig:A,authData:a,signature:d,originIndex:n,crossOrigin:r})}async function sO(e,n){let{data:r}=await Yn(Q(),e),t=od(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 TO(e){let n=await Un(e,true),r=await Oi(n.map(gill.getBase64EncodedWireTransaction),ki()),s=await Un(e.map((c,a)=>({...c,unitsConsumed:r[a]})));return await II(s.map(gill.getBase64EncodedWireTransaction))}async function lO({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await Q().getLatestBlockhash().send(),t=await gill.pipe(gill.createTransactionMessage({version:0}),c=>gill.appendTransactionMessageInstructions([...e],c),c=>gill.setTransactionMessageFeePayerSigner(n,c),c=>gill.setTransactionMessageLifetimeUsingBlockhash(s.value,c),c=>r?gill.compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[a,i]=await Promise.all([Hi()(c),_i(Q(),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 Ni()(t,{commitment:"confirmed",skipPreflight:true}),gill.getSignatureFromTransaction(t)}async function II(e,n=10,r=1e3,s=Bn()){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 fO(e,n=30,r=3e3,s=Bn()){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 SO({signer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){let c=await ji(n,r,t);if(c.threshold>1)throw new Error("Multi-signature transactions with threshold > 1 are not supported yet.");let{permissions:a}=c.members.find(f=>gd(f.pubkey)===e.toString())??{};if(!a)throw new Error("No permissions found for the current member.");let i=De.has(a,xe.InitiateTransaction),o=De.has(a,xe.VoteTransaction),d=De.has(a,xe.ExecuteTransaction);if(i&&o&&d)return null;if(!o||!d)throw new Error("Signer lacks the required Vote/Execute permissions.");let A=c.members.find(f=>f.role===2);if(!A)throw new Error("No transaction manager available in wallet.");let g=gill.address(gd(A.pubkey)),y=await Ji(g,A.userAddressTreeIndex,t);if(y.transactionManagerUrl.__option==="None")throw new Error("Transaction manager endpoint is missing for this account.");return CI(g,y.transactionManagerUrl.value,s)}function CI(e,n,r){return {address:e,async signTransactions(s){let t={publicKey:e.toString(),transactions:s.map(gill.getBase64EncodedWireTransaction)};r&&(t.transactionMessageBytes=gill.getBase64Decoder().decode(r));let c=Gi();if(c){let{url:o,publicKey:d}=c,g=await(await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({transactions:t.transactions,publicKey:d})})).json();if("error"in g)throw new Error(g.error);t.authorizedClient={publicKey:d,signatures:g.signatures};}let i=await(await fetch(n,{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(o=>({[e]:gill.getBase58Encoder().encode(o)}))}}}function gd(e){return e.keyType===Pt.Ed25519?gill.getBase58Decoder().decode(e.key.subarray(1,33)):gill.getBase58Decoder().decode(e.key)}async function kO({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,payer:s,compressed:t=false,cachedAccounts:c}){let{addDelegates:a,removeDelegates:i}=await MI(r),o=new N,d=null,A=null,g=[];if(a.length||i.length||t){let S=await hI({packedAccounts:o,addDelegates:a,removeDelegates:i,compressed:t,index:e,settingsAddressTreeIndex:n,cachedAccounts:c});d=S.proof,A=S.settingsMutArgs??null,g=S.userMutArgs??[];}let{configActions:y,secp256r1VerifyInput:f}=await PI({configActionsArgs:r,packedAccounts:o,userMutArgs:g}),{remainingAccounts:l,systemOffset:I}=o.toAccountMetas(),C=v(d,I);return {instructions:t?[po({configActions:y,payer:s,authority:gill.createNoopSigner(await ed(e)),compressedProofArgs:C,settingsMut:A,remainingAccounts:l})]:[await io({settingsIndex:e,configActions:y,payer:s,compressedProofArgs:C,remainingAccounts:l})],secp256r1VerifyInput:f}}async function MI(e){let n=[],r=[];for(let s of e)switch(s.type){case "AddMembers":{let t=s.members.map(a=>B(a.member instanceof h?a.member:"address"in a.member?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=>B(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):B(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 hI({packedAccounts:e,addDelegates:n,removeDelegates:r,compressed:s,index:t,settingsAddressTreeIndex:c,cachedAccounts:a}){await e.addSystemAccounts();let i=[];if(s){let l=(await re(t,c)).address;i.push({address:l,type:"Settings"});}r.length&&i.push(...r),n.length&&i.push(...n);let o=i.length?await se(i,a):[];if(!o.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let d=await F(o,[]),A=[],g=[];for(let l of o)l.type==="Settings"?A.push(l):l.type==="User"&&g.push(l);let y,f=[];if(s&&d&&(y=te(e,d.treeInfos.slice(0,1),d.leafIndices.slice(0,1),d.rootIndices.slice(0,1),d.proveByIndices.slice(0,1),A,j())[0]),g.length&&d){let l=s?1:0;f=te(e,d.treeInfos.slice(l),d.leafIndices.slice(l),d.rootIndices.slice(l),d.proveByIndices.slice(l),g,q());}return {proof:d,settingsMutArgs:y,userMutArgs:f}}async function PI({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 h){let o=s.length,{message:d,signature:A,publicKey:g,domainConfig:y}=k(i.member,o);d&&A&&g&&s.push({message:d,signature:A,publicKey:g}),y&&n.addPreAccounts([{address:y,role:gill.AccountRole.READONLY}]);let f=await B(i.member,i.userAddressTreeIndex).then(l=>r.find(I=>new ir__default.default(new Uint8Array(I.accountMeta.address)).eq(l.address)));if(!f)throw new Error("Unable to find user account");a.push(md({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 B(o,i.userAddressTreeIndex).then(A=>r.find(g=>new ir__default.default(new Uint8Array(g.accountMeta.address)).eq(A.address)));if(!d)throw new Error("Unable to find user account");a.push(md({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=>B(o.member,o.userAddressTreeIndex).then(d=>{let A=r.find(g=>new ir__default.default(new Uint8Array(g.accountMeta.address)).eq(d.address));if(!A)throw new Error("Unable to find user account");return RI({pubkey:o.member,userMutArgs:A})})),i=await Promise.all(a);t.push({__kind:c.type,fields:[i]});break}case "EditPermissions":{let a=c.members.map(o=>(o.delegateOperation!==2?B(o.member,o.userAddressTreeIndex).then(d=>r.find(A=>new ir__default.default(new Uint8Array(A.accountMeta.address)).eq(d.address))):Promise.resolve(void 0)).then(d=>EI({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 EI({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:Fe(e),permissions:ld(n),userArgs:r?gill.some(r):gill.none(),delegateOperation:s}}function RI({pubkey:e,userMutArgs:n}){if(n.data.role===1)throw new Error("Permanent Member cannot be removed from the wallet.");return {memberKey:Fe(e),userArgs:n.data.delegatedTo.__option==="Some"?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function md({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:Fe(e),permissions:ld(n),verifyArgs:e instanceof h&&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 ld(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,Fn=14,LI=2,BI=gill.address("Secp256r1SigVerify1111111111111111111111111");function wI(){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 kI(){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 Id(){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=kI();for(let i=0;i<r;i++)t.push(c.decode(e,n)),n+=Fn;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 A=t[i].messageDataSize,g=gill.fixDecoderSize(gill.getBytesDecoder(),A).decode(e,n);n+=A,a.push({publicKey:o,signature:d,message:g});}return [{numSignatures:r,padding:s,offsets:t,payload:a},n]}})}function Cd(){return gill.createEncoder({getSizeFromValue:e=>{let n=Fn*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=wI();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 VO(){return gill.combineCodec(Cd(),Id())}function G(e,n){let r=e.length,s=LI+r*Fn,t=[];for(let o=0;o<r;o++){let{message:d}=e[o],A=s,g=A+Ye,y=g+Ze;t.push({publicKeyOffset:A,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:y,messageDataSize:d.length,messageInstructionIndex:65535}),s+=Ye+Ze+d.length;}let c=n?.programAddress??BI,a={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:Cd().encode(a)}}function GO(e){return {programAddress:e.programAddress,accounts:{},data:Id().decode(e.data)}}async function $O({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let c=new N;await c.addSystemAccounts();let a=await ee(e),{address:i}=await re(e,n),o=await se([{address:i,type:"Settings"}],t),d=await F(o,[]),A=te(c,d.treeInfos,d.leafIndices,d.rootIndices,d.proveByIndices,o.filter(x=>x.type==="Settings"),j())[0],g=ye(s),y=g.filter(x=>x instanceof h),f=[],l=[];for(let x of y){let W=f.length,{domainConfig:w,verifyArgs:H,signature:U,publicKey:J,message:_}=k(x,W);_&&U&&J&&f.push({message:_,signature:U,publicKey:J}),w&&(c.addPreAccounts([{address:w,role:gill.AccountRole.READONLY}]),H?.__option==="Some"&&l.push({domainConfigKey:w,verifyArgs:H.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:C}=c.toAccountMetas(),b=v(d,C),S=[];return f.length>0&&S.push(G(f)),S.push(Io({settings:a,settingsMutArgs:A,compressedProofArgs:b,payer:r,secp256r1VerifyArgs:l,remainingAccounts:I})),S}async function tL({admin:e,addressTree:n}){return ro({payer:e,addressTree:n,remainingAccounts:[]})}async function iL({payer:e,rpId:n,origins:r,authority:s,metadataUrl:t}){let c=await Je({rpId:n}),a=new N;await a.addSystemAccounts();let i=await Te(),{address:o,addressTree:d}=await B(s.address,i),A=[{address:o,tree:d,queue:d,type:"User"}],g=await F([],A),y=(await me(a,g.treeInfos,g.roots,g.rootIndices,A))[0],{remainingAccounts:f,systemOffset:l}=a.toAccountMetas(),I=v(g,l);return await ho({origins:r,authorityCreationArgs:y,authority:s,compressedProofArgs:I,payer:e,domainConfig:c,rpId:n,metadataUrl:t,remainingAccounts:f})}async function fL({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new N;await c.addSystemAccounts();let a=[];r.index&&(a.push({address:(await re(r.index,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&a.push({address:(await B(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let i=a.length?await se(a,t):[],o=await Te(),{address:d,addressTree:A}=await B(r.member,o),g=[{address:d,type:"User",tree:A,queue:A}],y=await F(i,g),f=null,l=null,I=i.filter(w=>w.type==="Settings"),C=i.filter(w=>w.type==="User");I.length&&(f=te(c,y.treeInfos.slice(0,1),y.leafIndices.slice(0,1),y.rootIndices.slice(0,1),y.proveByIndices.slice(0,1),I,j())[0]),C.length&&(l=te(c,y.treeInfos.slice(1,2),y.leafIndices.slice(1,2),y.rootIndices.slice(1,2),y.proveByIndices.slice(1,2),C,q())[0]);let b=await me(c,y.treeInfos.slice(i.length),y.roots.slice(i.length),y.rootIndices.slice(i.length),g),{remainingAccounts:S,systemOffset:x}=c.toAccountMetas(),W=v(y,x);return await bo({payer:n,authority:e,compressedProofArgs:W,member:pt().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 CL({payer:e}){let n=await $i();return _o({payer:e,globalCounter:n})}async function bL({createUserArgs:e,payer:n}){let r=new N;await r.addSystemAccounts(),r.addPreAccounts(e.map(A=>({address:A.member.address,role:gill.AccountRole.READONLY_SIGNER,signer:A.member})));let s=await Te(),t=await Promise.all(e.map(async A=>{let{address:g,addressTree:y}=await B(A.member.address,s);return {address:g,tree:y,queue:y,type:"User"}})),c=await F([],t),a=await me(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:i,systemOffset:o}=r.toAccountMetas(),d=v(c,o);return await Go({compressedProofArgs:d,payer:n,createUserArgs:e.map((A,g)=>({member:A.member.address,role:A.role,userCreationArgs:a[g],transactionManagerUrl:A.role===2?A.transactionManagerUrl:null})),remainingAccounts:i})}async function _L({admin:e,rpId:n,disable:r}){let s=await Je({rpId:n});return ec({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function HL({authority:e,domainConfig:n,newAuthority:r,newOrigins:s,newMetadataUrl:t}){let c=null,a=[];if(r){let i=new N;await i.addSystemAccounts();let o=await Te(),{address:d,addressTree:A}=await B(r.address,o),g=[{address:d,tree:A,queue:A,type:"User"}],y=await F([],g),f=(await me(i,y.treeInfos,y.roots,y.rootIndices,g))[0],l=i.toAccountMetas();a=l.remainingAccounts,c={compressedProofArgs:v(y,l.systemOffset),authorityCreationArgs:f};}return uc({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 JL({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new N;await s.addSystemAccounts();let t=await se([{address:(await B(e.address,n)).address,type:"User"}]),c=await F(t,[]),a=te(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,q())[0],{remainingAccounts:i,systemOffset:o}=s.toAccountMetas(),d=v(c,o);return Tc({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:a,remainingAccounts:i})}async function AB({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,delegateOperation:t,cachedAccounts:c}){let{domainConfig:a,verifyArgs:i,message:o,signature:d,publicKey:A}=k(r),g=[];o&&d&&A&&g.push({message:o,signature:d,publicKey:A});let y=new N;await y.addSystemAccounts();let f=[],l=[];l.push(...await se([{address:(await B("address"in r?r.address:r,s)).address,type:"User"}],c));let I=await Te(),{address:C,addressTree:b}=await re(e,I);f.push({address:C,queue:b,tree:b,type:"Settings"});let S=l.length,x=await F(l,f),W=te(y,x.treeInfos.slice(0,S),x.leafIndices.slice(0,S),x.rootIndices.slice(0,S),x.proveByIndices.slice(0,S),l.filter(oe=>oe.type==="User"),q())[0],H=(await me(y,x.treeInfos.slice(S),x.roots.slice(S),x.rootIndices.slice(S),f)).find(oe=>oe.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:U,systemOffset:J}=y.toAccountMetas(),_=v(x,J),le=[];if(!H)throw new Error("Settings creation args is missing.");return le.push(await ko({settingsIndex:e,payer:n,initialMember:r instanceof h?void 0:r,secp256r1VerifyArgs:i,domainConfig:a,userMutArgs:W,compressedProofArgs:_,settingsCreation:H,delegateOperation:t,remainingAccounts:U})),{instructions:le,secp256r1VerifyInput:g}}async function IB({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let c=new N;await c.addSystemAccounts();let a=await se([{address:(await re(e,n)).address,type:"Settings"}],t),i=await F(a,[]),o=te(c,i.treeInfos,i.leafIndices,i.rootIndices,i.proveByIndices,a.filter(S=>S.type==="Settings"),j())[0],d=ye(s),A=d.filter(S=>S instanceof h),g=[],y=[];for(let S of A){let x=g.length,{domainConfig:W,verifyArgs:w,signature:H,publicKey:U,message:J}=k(S,x);J&&H&&U&&g.push({message:J,signature:H,publicKey:U}),W&&(c.addPreAccounts([{address:W,role:gill.AccountRole.READONLY}]),w?.__option==="Some"&&y.push({domainConfigKey:W,verifyArgs:w.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(i,l),C=[];g.length>0&&C.push(G(g));let b=await ee(e);return C.push(Yo({settings:b,payer:r,settingsMut:o,compressedProofArgs:I,secp256r1VerifyArgs:y,remainingAccounts:f})),C}function VI(e,n,r,s){let t=GI(e,n),c=FI(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 GI(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 FI(e,n){return n<e.header.numSignerAccounts}async function dr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=Ei(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),Q()):{}),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:VI(t,i,o,e)});if(t.addressTableLookups)for(let i of t.addressTableLookups){let o=c[i.lookupTableAddress];if(!o)throw new Error(`Address lookup table account ${i.lookupTableAddress} not found`);for(let d of i.writableIndexes){let A=o[d];if(!A)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${d}`);a.push({address:A,role:gill.AccountRole.WRITABLE});}for(let d of i.readonlyIndexes){let A=o[d];if(!A)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${d}`);a.push({address:A,role:gill.AccountRole.READONLY});}}for(let i of s?.filter(o=>o.address!==e)??[]){let o=a.findIndex(d=>d.address===i.address);o===-1?a.push({address:i.address,role:gill.AccountRole.READONLY_SIGNER,signer:i}):a[o].role===gill.AccountRole.READONLY||a[o].role===gill.AccountRole.READONLY_SIGNER?a[o]={address:i.address,role:gill.AccountRole.READONLY_SIGNER,signer:i}:(a[o].role===gill.AccountRole.WRITABLE||a[o].role===gill.AccountRole.WRITABLE_SIGNER)&&(a[o]={address:i.address,role:gill.AccountRole.WRITABLE_SIGNER,signer:i});}return {accountMetas:a,addressLookupTableAccounts:c,transactionMessage:t}}async function vd({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:A,addressLookupTableAccounts:g}=await dr({transactionMessageBytes:r,walletAddress:d,additionalSigners:a,addressesByLookupTableAddress:t}),y=[];return c.length>0&&y.push(G(c)),y.push(o?ui({transactionBuffer:n,payer:s.address,remainingAccounts:A,settingsKey:e}):si({transactionBuffer:n,payer:s.address,settings:e})),i&&y.push(Li({payer:s,tipAmount:i})),{instructions:y,addressLookupTableAccounts:g}}async function Ud({index:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:a=[],compressed:i=false,simulateProof:o=false,cachedAccounts:d}){let A=ye(s),g=await ee(e),y=await Ie(g),[{accountMetas:f,addressLookupTableAccounts:l,transactionMessage:I},{settingsReadonlyArgs:C,proof:b,packedAccounts:S}]=await Promise.all([dr({transactionMessageBytes:r,walletAddress:y,additionalSigners:A.filter(_=>!(_ instanceof h)),addressesByLookupTableAddress:c}),pe(i,e,n,o,d)]);S.addPreAccounts(f);let x=A.filter(_=>_ instanceof h),W=[];for(let _ of x){let le=a.length,{domainConfig:oe,verifyArgs:Pe,signature:Ce,publicKey:vt,message:Ut}=k(_,le);Ut&&Ce&&vt&&a.push({message:Ut,signature:Ce,publicKey:vt}),oe&&(S.addPreAccounts([{address:oe,role:gill.AccountRole.READONLY}]),Pe?.__option==="Some"&&W.push({domainConfigKey:oe,verifyArgs:Pe.value}));}let{remainingAccounts:w,systemOffset:H}=S.toAccountMetas(),U=[];a.length>0&&U.push(G(a));let J=KI(I,f);if(i){if(!t||!C)throw new Error("Payer not found or proof args is missing.");let _=v(b,H);U.push(Ci({secp256r1VerifyArgs:W,transactionMessage:J,settingsReadonlyArgs:C,compressedProofArgs:_,payer:t,remainingAccounts:w}));}else U.push(Ti({secp256r1VerifyArgs:W,settings:g,transactionMessage:J,remainingAccounts:w}));return {instructions:U,addressLookupTableAccounts:l}}function KI(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 ZB({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:a,compressed:i=false}){let o=ye(s),d=await ee(e),A=await Ie(d),{settingsReadonlyArgs:g,proof:y,packedAccounts:f}=await pe(i,e,n,false,t),l=[],I=[];for(let x of o)if(x instanceof h){let W=l.length,{domainConfig:w,verifyArgs:H,signature:U,publicKey:J,message:_}=k(x,W);_&&U&&J&&l.push({message:_,signature:U,publicKey:J}),w&&(f.addPreAccounts([{address:w,role:gill.AccountRole.READONLY}]),H?.__option==="Some"&&I.push({domainConfigKey:w,verifyArgs:H.value}));}else f.addPreAccounts([{address:x.address,role:gill.AccountRole.READONLY_SIGNER,signer:x}]);let{remainingAccounts:C,systemOffset:b}=f.toAccountMetas(),S=[];if(l.length>0&&S.push(G(l)),i){if(!a||!g)throw new Error("Payer not found or proof args is missing.");let x=v(y,b);S.push(Bc({amount:c,settingsReadonlyArgs:g,compressedProofArgs:x,payer:a,secp256r1VerifyArgs:I,source:A,destination:r,remainingAccounts:C}));}else S.push(vc({amount:c,secp256r1VerifyArgs:I,source:A,destination:r,settings:d,remainingAccounts:C}));return S}async function ow({index:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:a,payer:i,tokenProgram:o,compressed:d=false}){let A=ye(t),g=await ee(e),y=await Ie(g),[f,l]=await Promise.all([programs.getAssociatedTokenAccountAddress(s,y,o),programs.getAssociatedTokenAccountAddress(s,r,o)]),{settingsReadonlyArgs:I,proof:C,packedAccounts:b}=await pe(d,e,n,false,c),S=[],x=[];for(let U of A)if(U instanceof h){let J=S.length,{domainConfig:_,verifyArgs:le,signature:oe,publicKey:Pe,message:Ce}=k(U,J);Ce&&oe&&Pe&&S.push({message:Ce,signature:oe,publicKey:Pe}),_&&(b.addPreAccounts([{address:_,role:gill.AccountRole.READONLY}]),le?.__option==="Some"&&x.push({domainConfigKey:_,verifyArgs:le.value}));}else b.addPreAccounts([{address:U.address,role:gill.AccountRole.READONLY_SIGNER,signer:U}]);let{remainingAccounts:W,systemOffset:w}=b.toAccountMetas(),H=[];if(S.length>0&&H.push(G(S)),d){if(!i||!I)throw new Error("Payer not found or proof args is missing.");let U=v(C,w);H.push(Jc({amount:a,settingsReadonlyArgs:I,compressedProofArgs:U,payer:i,secp256r1VerifyArgs:x,source:y,sourceTokenAccount:f,destination:r,destinationTokenAccount:l,mint:s,tokenProgram:o,remainingAccounts:W}));}else H.push(Hc({amount:a,secp256r1VerifyArgs:x,source:y,sourceTokenAccount:f,destination:r,destinationTokenAccount:l,settings:g,mint:s,tokenProgram:o,remainingAccounts:W}));return H}async function Tw({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:a}){let i=await zs(Q(),s),o=i.data.multiWalletSettings,{settingsReadonlyArgs:d,proof:A,packedAccounts:g}=await pe(c,e,n,false,a),{remainingAccounts:y,systemOffset:f}=g.toAccountMetas(),{domainConfig:l,verifyArgs:I,message:C,signature:b,publicKey:S}=k(r),x=[];if(C&&b&&S&&x.push(G([{message:C,signature:b,publicKey:S}])),c){if(!t||!d)throw new Error("Payer not found or proof args is missing.");let W=v(A,f);x.push(sa({transactionBuffer:s,domainConfig:l,closer:r instanceof h?void 0:r,rentCollector:i.data.payer,secp256r1VerifyArgs:I,settingsReadonlyArgs:d,payer:t,compressedProofArgs:W,remainingAccounts:y}));}else x.push($c({transactionBuffer:s,domainConfig:l,closer:r instanceof h?void 0:r,settings:o,payer:i.data.payer,secp256r1VerifyArgs:I,remainingAccounts:[]}));return x}function Ld({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:a,preauthorizeExecution:i,bufferExtendHashes:o,compressedArgs:d,expectedSigners:A}){let{domainConfig:g,verifyArgs:y,message:f,signature:l,publicKey:I}=k(n),C=[];if(f&&l&&I&&C.push(G([{message:f,signature:l,publicKey:I}])),d){let{settingsReadonlyArgs:b,compressedProofArgs:S,remainingAccounts:x}=d;C.push(Ta({transactionBuffer:t,payer:e,secp256r1VerifyArgs:y,creator:n instanceof h?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSigners:A},settingsReadonlyArgs:b,compressedProofArgs:S,remainingAccounts:x}));}else C.push(ua({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:y,creator:n instanceof h?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSigners:A},remainingAccounts:[]}));return C}function Bd({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,message:i,publicKey:o}=k(e),d=[];return i&&a&&o&&d.push(G([{message:i,signature:a,publicKey:o}])),s?d.push(Ra({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof h?void 0:e,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(Ca({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof h?void 0:e,remainingAccounts:[]})),d}function wd({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?Ha({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Oa({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function kd({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,publicKey:i,message:o}=k(n),d=[];return o&&a&&i&&d.push(G([{message:o,signature:a,publicKey:i}])),s?d.push($a({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof h?void 0:n,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(Ja({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof h?void 0:n,remainingAccounts:[]})),d}async function tk({message:e,signer:n,popUp:r}){let s=await or({authUrl:`${he()}/?redirectUrl=${encodeURIComponent(window.origin)}`,data:{type:"message",payload:e},signer:n,popUp:r,additionalInfo:er()});return {...s,signer:new ae(s.signer),userAddressTreeIndex:s.userAddressTree?await nr(s.userAddressTree):void 0}}async function ck({transactionActionType:e,transactionAddress:n,transactionMessageBytes:r,signer:s,popUp:t}){let c=await or({authUrl:`${he()}/?redirectUrl=${encodeURIComponent(window.origin)}`,data:{type:"transaction",payload:JSON.stringify({transactionActionType:e,transactionAddress:n,transactionMessageBytes:cr(r)})},additionalInfo:er(),signer:s,popUp:t});return {...c,signer:new ae(c.signer),userAddressTreeIndex:c.userAddressTree?await nr(c.userAddressTree):void 0}}async function Ak({message:e,response:n,expectedRPID:r=Vi(),expectedOrigin:s=he()}){let{verified:t}=await server.verifyAuthenticationResponse({response:n.authResponse,expectedChallenge:cr(new TextEncoder().encode(e)),expectedOrigin:s,expectedRPID:r,requireUserVerification:false,credential:{id:n.authResponse.id,publicKey:ud(n.signer.toString()),counter:0}});return t}async function Dk({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o,compressed:d=false,bufferIndex:A=Math.floor(Math.random()*255),additionalVoters:g=[],additionalSigners:y=[],chunkSize:f=Math.ceil(s.length/2),cachedAccounts:l}){let I=await ee(n),C=await Qi(I,t instanceof h?t:t.address,A),b=[],S=[];for(let ce=0;ce<s.length;ce+=f){let zn=s.subarray(ce,ce+f);b.push(zn),S.push(sha256.sha256(zn));}let x=sha256.sha256(new Uint8Array(s)),{settingsReadonlyArgs:W,proof:w,packedAccounts:H}=await pe(d,n,r,false,l),{remainingAccounts:U,systemOffset:J}=H.toAccountMetas(),_=W?{settingsReadonlyArgs:W,compressedProofArgs:v(w,J),remainingAccounts:U,payer:e}:null,le=[t,...c?[c]:[],...g].map(Fe),oe=Ld({finalBufferHash:x,finalBufferSize:s.length,bufferIndex:A,payer:e,transactionBufferAddress:C,settings:I,creator:t,preauthorizeExecution:!c,bufferExtendHashes:S,compressedArgs:_,expectedSigners:le}),Pe=b.map(ce=>wd({transactionMessageBytes:ce,transactionBufferAddress:C,settings:I,compressed:d})),Ce=g.map(ce=>kd({voter:ce,transactionBufferAddress:C,settings:I,compressedArgs:_})),vt=Bd({compressedArgs:_,settings:I,executor:c,transactionBufferAddress:C}),{instructions:Ut,addressLookupTableAccounts:Vd}=await vd({compressed:d,settings:I,transactionMessageBytes:s,transactionBufferAddress:C,payer:e,additionalSigners:y,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o}),T=ce=>({payer:e,instructions:ce,addressesByLookupTableAddress:Vd});return [T(oe),...Pe.map(ce=>T([ce])),...Ce.length?[T(Ce.flat())]:[],T(vt),T(Ut)]}var Ar=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 gr=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let 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 Hd({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=Ar.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:l,drainedKeys:I}=f;c.push({readonlyIndexes:l.readonlyIndexes,readableIndices:l.readonlyIndexes,writableIndexes:l.writableIndexes,writableIndices:l.writableIndexes,lookupTableAddress:gill.address(l.lookupTableAddress)}),a.writable.push(...I.writable),a.readonly.push(...I.readonly);}}let[o,d]=t.getMessageComponents(),g=new gr(d,a).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function Bk({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=Hd({instructions:e,payer:n,recentBlockhash:u,addressesByLookupTableAddress:r});return Pi(s)}async function Vk({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:a,cachedAccounts:i,compressed:o=false,simulateProof:d=false}){let{instructions:A,addressLookupTableAccounts:g}=await Ud({index:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:a,simulateProof:d,cachedAccounts:i});return {payer:e,instructions:A,addressesByLookupTableAddress:g}}
2
+ exports.ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR=eo;exports.CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR=go;exports.CHANGE_CONFIG_DISCRIMINATOR=co;exports.COMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR=fo;exports.CREATE_DOMAIN_CONFIG_DISCRIMINATOR=Do;exports.CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR=Eo;exports.CREATE_GLOBAL_COUNTER_DISCRIMINATOR=Uo;exports.CREATE_MULTI_WALLET_COMPRESSED_DISCRIMINATOR=Bo;exports.CREATE_USER_ACCOUNTS_DISCRIMINATOR=Ho;exports.DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR=Ko;exports.DISABLE_DOMAIN_CONFIG_DISCRIMINATOR=Xo;exports.DOMAIN_CONFIG_DISCRIMINATOR=Kn;exports.DelegateOp=Ht;exports.EDIT_DOMAIN_CONFIG_DISCRIMINATOR=ic;exports.EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR=yc;exports.GLOBAL_COUNTER_DISCRIMINATOR=Xn;exports.KeyType=Pt;exports.MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR=Sc;exports.MIGRATE_COMPRESSED_USERS_DISCRIMINATOR=Mc;exports.MULTI_WALLET_ERROR__ALREADY_DELEGATED=XS;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED=px;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING=Tx;exports.MULTI_WALLET_ERROR__DUPLICATE_MEMBER=BS;exports.MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED=LS;exports.MULTI_WALLET_ERROR__EMPTY_MEMBERS=GS;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH=ox;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED=cx;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH=ax;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION=ex;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION=$S;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION=QS;exports.MULTI_WALLET_ERROR__INVALID_ACCOUNT=jS;exports.MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE=xx;exports.MULTI_WALLET_ERROR__INVALID_ARGUMENTS=YS;exports.MULTI_WALLET_ERROR__INVALID_BUFFER=sx;exports.MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS=JS;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG=OS;exports.MULTI_WALLET_ERROR__INVALID_SIGNED_MESSAGE=_S;exports.MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT=yx;exports.MULTI_WALLET_ERROR__INVALID_THRESHOLD=zS;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE=KS;exports.MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED=Ax;exports.MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG=lx;exports.MULTI_WALLET_ERROR__MISSING_ACCOUNT=ZS;exports.MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY=gx;exports.MULTI_WALLET_ERROR__MISSING_USER_ARGS=qS;exports.MULTI_WALLET_ERROR__NO_SIGNER_FOUND=rx;exports.MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED=NS;exports.MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED=HS;exports.MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS=Sx;exports.MULTI_WALLET_ERROR__PERMANENT_MEMBER=wS;exports.MULTI_WALLET_ERROR__PERMANENT_MEMBER_NOT_ALLOWED=kS;exports.MULTI_WALLET_ERROR__PROTECTED_ACCOUNT=ux;exports.MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH=fx;exports.MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND=mx;exports.MULTI_WALLET_ERROR__TOO_MANY_MEMBERS=FS;exports.MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED=ix;exports.MULTI_WALLET_ERROR__TRANSACTION_MANAGER_NOT_ALLOWED=VS;exports.MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED=dx;exports.MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER=nx;exports.MULTI_WALLET_ERROR__UNEXPECTED_SIGNER=tx;exports.MULTI_WALLET_PROGRAM_ADDRESS=u;exports.MultiWalletAccount=vS;exports.MultiWalletInstruction=US;exports.NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=_c;exports.NATIVE_TRANSFER_INTENT_DISCRIMINATOR=Rc;exports.Permission=xe;exports.Permissions=De;exports.SETTINGS_DISCRIMINATOR=Os;exports.Secp256r1Key=ae;exports.SignedSecp256r1Key=h;exports.TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=zc;exports.TOKEN_TRANSFER_INTENT_DISCRIMINATOR=kc;exports.TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR=ta;exports.TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR=Zc;exports.TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR=ya;exports.TRANSACTION_BUFFER_CREATE_DISCRIMINATOR=aa;exports.TRANSACTION_BUFFER_DISCRIMINATOR=Vs;exports.TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR=ha;exports.TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR=Sa;exports.TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR=wa;exports.TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR=Ua;exports.TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR=Za;exports.TRANSACTION_BUFFER_VOTE_DISCRIMINATOR=Fa;exports.TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR=ai;exports.TRANSACTION_EXECUTE_DISCRIMINATOR=ti;exports.TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR=Si;exports.TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR=yi;exports.UserRole=Ve;exports.WHITELISTED_ADDRESS_TREE_DISCRIMINATOR=js;exports.addWhitelistedAddressTrees=tL;exports.changeConfig=kO;exports.closeTransactionBuffer=Tw;exports.compressSettingsAccount=$O;exports.configAction=wC;exports.convertMemberKeyToString=gd;exports.convertPubkeyCompressedToCose=ud;exports.convertPubkeyCoseToCompressed=rO;exports.createDomainConfig=iL;exports.createDomainUserAccounts=fL;exports.createGlobalCounter=CL;exports.createPopUp=ad;exports.createTransactionBuffer=Ld;exports.createTransactionManagerSigner=CI;exports.createUserAccounts=bL;exports.createWallet=AB;exports.decodeDomainConfig=jn;exports.decodeGlobalCounter=Qn;exports.decodeSettings=Bs;exports.decodeTransactionBuffer=Fs;exports.decodeWhitelistedAddressTree=Zs;exports.decompressSettingsAccount=IB;exports.disableDomainConfig=_L;exports.editDomainConfig=HL;exports.editTransactionManagerUrl=JL;exports.executeTransaction=vd;exports.executeTransactionBuffer=Bd;exports.executeTransactionSync=Ud;exports.extendTransactionBuffer=wd;exports.fetchAllDomainConfig=$I;exports.fetchAllGlobalCounter=oC;exports.fetchAllMaybeDomainConfig=nu;exports.fetchAllMaybeGlobalCounter=Su;exports.fetchAllMaybeSettings=My;exports.fetchAllMaybeTransactionBuffer=zy;exports.fetchAllMaybeWhitelistedAddressTree=um;exports.fetchAllSettings=Mh;exports.fetchAllTransactionBuffer=Uh;exports.fetchAllWhitelistedAddressTree=Bh;exports.fetchDomainConfig=Yn;exports.fetchGlobalCounter=sC;exports.fetchMaybeDomainConfig=ru;exports.fetchMaybeGlobalCounter=fu;exports.fetchMaybeSettings=Jr;exports.fetchMaybeSettingsAccountData=Qx;exports.fetchMaybeTransactionBuffer=Fy;exports.fetchMaybeUserAccountData=$x;exports.fetchMaybeWhitelistedAddressTree=dm;exports.fetchSettings=Dh;exports.fetchSettingsAccountData=ji;exports.fetchTransactionBuffer=zs;exports.fetchUserAccountData=Ji;exports.fetchWhitelistedAddressTree=qs;exports.getAddMemberArgsCodec=uC;exports.getAddMemberArgsDecoder=mr;exports.getAddMemberArgsEncoder=yr;exports.getAddWhitelistedAddressTreesDiscriminatorBytes=Qh;exports.getAddWhitelistedAddressTreesInstruction=tP;exports.getAddWhitelistedAddressTreesInstructionAsync=ro;exports.getAddWhitelistedAddressTreesInstructionDataCodec=eP;exports.getAddWhitelistedAddressTreesInstructionDataDecoder=to;exports.getAddWhitelistedAddressTreesInstructionDataEncoder=en;exports.getAuthEndpoint=he;exports.getChangeConfigCompressedDiscriminatorBytes=SP;exports.getChangeConfigCompressedInstruction=po;exports.getChangeConfigCompressedInstructionDataCodec=xP;exports.getChangeConfigCompressedInstructionDataDecoder=mo;exports.getChangeConfigCompressedInstructionDataEncoder=yo;exports.getChangeConfigDiscriminatorBytes=dP;exports.getChangeConfigInstruction=AP;exports.getChangeConfigInstructionAsync=io;exports.getChangeConfigInstructionDataCodec=uP;exports.getChangeConfigInstructionDataDecoder=ao;exports.getChangeConfigInstructionDataEncoder=tn;exports.getCompiledInstructionCodec=yC;exports.getCompiledInstructionDecoder=Tr;exports.getCompiledInstructionEncoder=pr;exports.getCompressSettingsAccountDiscriminatorBytes=RP;exports.getCompressSettingsAccountInstruction=Io;exports.getCompressSettingsAccountInstructionDataCodec=bP;exports.getCompressSettingsAccountInstructionDataDecoder=xo;exports.getCompressSettingsAccountInstructionDataEncoder=So;exports.getCompressedAccountMetaCodec=lC;exports.getCompressedAccountMetaDecoder=tt;exports.getCompressedAccountMetaEncoder=et;exports.getCompressedAccountMetaReadOnlyCodec=IC;exports.getCompressedAccountMetaReadOnlyDecoder=ot;exports.getCompressedAccountMetaReadOnlyEncoder=st;exports.getCompressedProofCodec=MC;exports.getCompressedProofDecoder=Cr;exports.getCompressedProofEncoder=Ir;exports.getCompressedSettingsAddressFromIndex=re;exports.getCompressedSettingsCodec=RC;exports.getCompressedSettingsDataCodec=WC;exports.getCompressedSettingsDataDecoder=it;exports.getCompressedSettingsDataEncoder=at;exports.getCompressedSettingsDecoder=j;exports.getCompressedSettingsEncoder=ct;exports.getComputeBudgetEstimate=Hi;exports.getConfigActionCodec=BC;exports.getConfigActionDecoder=gt;exports.getConfigActionEncoder=At;exports.getCreateDomainConfigDiscriminatorBytes=wP;exports.getCreateDomainConfigInstruction=NP;exports.getCreateDomainConfigInstructionAsync=ho;exports.getCreateDomainConfigInstructionDataCodec=kP;exports.getCreateDomainConfigInstructionDataDecoder=Mo;exports.getCreateDomainConfigInstructionDataEncoder=un;exports.getCreateDomainUserAccountDiscriminatorBytes=jP;exports.getCreateDomainUserAccountInstruction=ZP;exports.getCreateDomainUserAccountInstructionAsync=bo;exports.getCreateDomainUserAccountInstructionDataCodec=YP;exports.getCreateDomainUserAccountInstructionDataDecoder=Ro;exports.getCreateDomainUserAccountInstructionDataEncoder=gn;exports.getCreateGlobalCounterDiscriminatorBytes=rE;exports.getCreateGlobalCounterInstruction=sE;exports.getCreateGlobalCounterInstructionAsync=_o;exports.getCreateGlobalCounterInstructionDataCodec=nE;exports.getCreateGlobalCounterInstructionDataDecoder=Wo;exports.getCreateGlobalCounterInstructionDataEncoder=mn;exports.getCreateMultiWalletCompressedDiscriminatorBytes=gE;exports.getCreateMultiWalletCompressedInstruction=mE;exports.getCreateMultiWalletCompressedInstructionAsync=ko;exports.getCreateMultiWalletCompressedInstructionDataCodec=yE;exports.getCreateMultiWalletCompressedInstructionDataDecoder=wo;exports.getCreateMultiWalletCompressedInstructionDataEncoder=pn;exports.getCreateUserAccountArgsCodec=GC;exports.getCreateUserAccountArgsDecoder=vr;exports.getCreateUserAccountArgsEncoder=br;exports.getCreateUserAccountsDiscriminatorBytes=CE;exports.getCreateUserAccountsInstruction=ME;exports.getCreateUserAccountsInstructionAsync=Go;exports.getCreateUserAccountsInstructionDataCodec=DE;exports.getCreateUserAccountsInstructionDataDecoder=Vo;exports.getCreateUserAccountsInstructionDataEncoder=ln;exports.getDecompressSettingsAccountDiscriminatorBytes=WE;exports.getDecompressSettingsAccountInstruction=Yo;exports.getDecompressSettingsAccountInstructionDataCodec=_E;exports.getDecompressSettingsAccountInstructionDataDecoder=jo;exports.getDecompressSettingsAccountInstructionDataEncoder=Jo;exports.getDelegateOpCodec=KC;exports.getDelegateOpDecoder=Re;exports.getDelegateOpEncoder=Ee;exports.getDisableDomainConfigDiscriminatorBytes=HE;exports.getDisableDomainConfigInstruction=ec;exports.getDisableDomainConfigInstructionDataCodec=VE;exports.getDisableDomainConfigInstructionDataDecoder=Qo;exports.getDisableDomainConfigInstructionDataEncoder=$o;exports.getDomainConfigAddress=Je;exports.getDomainConfigCodec=XI;exports.getDomainConfigDecoder=Jn;exports.getDomainConfigDiscriminatorBytes=qI;exports.getDomainConfigEncoder=tu;exports.getDomainConfigSize=QI;exports.getEditDomainConfigDiscriminatorBytes=ZE;exports.getEditDomainConfigInstruction=uc;exports.getEditDomainConfigInstructionAsync=XE;exports.getEditDomainConfigInstructionDataCodec=qE;exports.getEditDomainConfigInstructionDataDecoder=dc;exports.getEditDomainConfigInstructionDataEncoder=In;exports.getEditMemberArgsCodec=ZC;exports.getEditMemberArgsDecoder=Pr;exports.getEditMemberArgsEncoder=hr;exports.getEditTransactionManagerUrlDiscriminatorBytes=oR;exports.getEditTransactionManagerUrlInstruction=Tc;exports.getEditTransactionManagerUrlInstructionDataCodec=cR;exports.getEditTransactionManagerUrlInstructionDataDecoder=pc;exports.getEditTransactionManagerUrlInstructionDataEncoder=mc;exports.getFeePayer=a_;exports.getGlobalAdditonalInfo=er;exports.getGlobalAuthorizedClient=Gi;exports.getGlobalCounterAddress=$i;exports.getGlobalCounterCodec=nC;exports.getGlobalCounterDecoder=$n;exports.getGlobalCounterDiscriminatorBytes=rC;exports.getGlobalCounterEncoder=lu;exports.getGlobalCounterSize=cC;exports.getJitoTipsConfig=Bn;exports.getLightCpiSigner=N_;exports.getLightProtocolRpc=Et;exports.getLinkWalletArgsCodec=QC;exports.getLinkWalletArgsDecoder=Wr;exports.getLinkWalletArgsEncoder=Ur;exports.getMemberCodec=nD;exports.getMemberDecoder=ut;exports.getMemberEncoder=dt;exports.getMemberKeyCodec=cD;exports.getMemberKeyDecoder=K;exports.getMemberKeyEncoder=z;exports.getMigrateCompressedSettingsDiscriminatorBytes=mR;exports.getMigrateCompressedSettingsInstruction=TR;exports.getMigrateCompressedSettingsInstructionDataCodec=pR;exports.getMigrateCompressedSettingsInstructionDataDecoder=Ic;exports.getMigrateCompressedSettingsInstructionDataEncoder=xc;exports.getMigrateCompressedUsersDiscriminatorBytes=MR;exports.getMigrateCompressedUsersInstruction=PR;exports.getMigrateCompressedUsersInstructionDataCodec=hR;exports.getMigrateCompressedUsersInstructionDataDecoder=Pc;exports.getMigrateCompressedUsersInstructionDataEncoder=hc;exports.getMultiWalletErrorMessage=lW;exports.getNativeTransferIntentCompressedDiscriminatorBytes=zR;exports.getNativeTransferIntentCompressedInstruction=Bc;exports.getNativeTransferIntentCompressedInstructionDataCodec=KR;exports.getNativeTransferIntentCompressedInstructionDataDecoder=Lc;exports.getNativeTransferIntentCompressedInstructionDataEncoder=Oc;exports.getNativeTransferIntentDiscriminatorBytes=OR;exports.getNativeTransferIntentInstruction=vc;exports.getNativeTransferIntentInstructionAsync=BR;exports.getNativeTransferIntentInstructionDataCodec=LR;exports.getNativeTransferIntentInstructionDataDecoder=bc;exports.getNativeTransferIntentInstructionDataEncoder=Cn;exports.getNewAuthorityArgsCodec=uD;exports.getNewAuthorityArgsDecoder=Or;exports.getNewAuthorityArgsEncoder=_r;exports.getOriginIndex=sO;exports.getPackedAddressTreeInfoCodec=yD;exports.getPackedAddressTreeInfoDecoder=mt;exports.getPackedAddressTreeInfoEncoder=yt;exports.getPackedStateTreeInfoCodec=TD;exports.getPackedStateTreeInfoDecoder=nt;exports.getPackedStateTreeInfoEncoder=rt;exports.getPermissionsCodec=SD;exports.getPermissionsDecoder=ve;exports.getPermissionsEncoder=be;exports.getProofArgsCodec=DD;exports.getProofArgsDecoder=M;exports.getProofArgsEncoder=D;exports.getRemoveMemberArgsCodec=ED;exports.getRemoveMemberArgsDecoder=Rr;exports.getRemoveMemberArgsEncoder=Er;exports.getRpId=Vi;exports.getSecp256r1PubkeyCodec=vD;exports.getSecp256r1PubkeyDecoder=pt;exports.getSecp256r1PubkeyEncoder=Lr;exports.getSecp256r1SignatureOffsetsDataDecoder=kI;exports.getSecp256r1SignatureOffsetsDataEncoder=wI;exports.getSecp256r1VerifyArgsCodec=_D;exports.getSecp256r1VerifyArgsDecoder=L;exports.getSecp256r1VerifyArgsEncoder=O;exports.getSecp256r1VerifyArgsWithDomainAddressCodec=wD;exports.getSecp256r1VerifyArgsWithDomainAddressDecoder=Z;exports.getSecp256r1VerifyArgsWithDomainAddressEncoder=Y;exports.getSecp256r1VerifyInstruction=G;exports.getSecp256r1VerifyInstructionDataCodec=VO;exports.getSecp256r1VerifyInstructionDataDecoder=Id;exports.getSecp256r1VerifyInstructionDataEncoder=Cd;exports.getSendAndConfirmTransaction=Ni;exports.getSettingsCodec=Ch;exports.getSettingsCreationArgsCodec=VD;exports.getSettingsCreationArgsDecoder=lt;exports.getSettingsCreationArgsEncoder=Tt;exports.getSettingsDecoder=Ls;exports.getSettingsDiscriminatorBytes=Ih;exports.getSettingsEncoder=Dy;exports.getSettingsFromIndex=ee;exports.getSettingsIndexWithAddressCodec=zD;exports.getSettingsIndexWithAddressDecoder=wr;exports.getSettingsIndexWithAddressEncoder=Br;exports.getSettingsMutArgsCodec=YD;exports.getSettingsMutArgsDecoder=Se;exports.getSettingsMutArgsEncoder=fe;exports.getSettingsReadonlyArgsCodec=$D;exports.getSettingsReadonlyArgsDecoder=$;exports.getSettingsReadonlyArgsEncoder=X;exports.getSettingsSize=hh;exports.getSignedSecp256r1Key=nO;exports.getSolanaRpc=Q;exports.getSolanaRpcEndpoint=ki;exports.getTokenTransferIntentCompressedDiscriminatorBytes=db;exports.getTokenTransferIntentCompressedInstruction=Jc;exports.getTokenTransferIntentCompressedInstructionAsync=Ab;exports.getTokenTransferIntentCompressedInstructionDataCodec=ub;exports.getTokenTransferIntentCompressedInstructionDataDecoder=Kc;exports.getTokenTransferIntentCompressedInstructionDataEncoder=hn;exports.getTokenTransferIntentDiscriminatorBytes=QR;exports.getTokenTransferIntentInstruction=Hc;exports.getTokenTransferIntentInstructionAsync=tb;exports.getTokenTransferIntentInstructionDataCodec=eb;exports.getTokenTransferIntentInstructionDataDecoder=Nc;exports.getTokenTransferIntentInstructionDataEncoder=Mn;exports.getTransactionBufferAddress=Qi;exports.getTransactionBufferCloseCompressedDiscriminatorBytes=Rb;exports.getTransactionBufferCloseCompressedInstruction=sa;exports.getTransactionBufferCloseCompressedInstructionDataCodec=bb;exports.getTransactionBufferCloseCompressedInstructionDataDecoder=na;exports.getTransactionBufferCloseCompressedInstructionDataEncoder=ra;exports.getTransactionBufferCloseDiscriminatorBytes=Sb;exports.getTransactionBufferCloseInstruction=$c;exports.getTransactionBufferCloseInstructionDataCodec=xb;exports.getTransactionBufferCloseInstructionDataDecoder=Xc;exports.getTransactionBufferCloseInstructionDataEncoder=qc;exports.getTransactionBufferCodec=vh;exports.getTransactionBufferCreateArgsCodec=rM;exports.getTransactionBufferCreateArgsDecoder=St;exports.getTransactionBufferCreateArgsEncoder=ft;exports.getTransactionBufferCreateCompressedDiscriminatorBytes=Jb;exports.getTransactionBufferCreateCompressedInstruction=Ta;exports.getTransactionBufferCreateCompressedInstructionDataCodec=jb;exports.getTransactionBufferCreateCompressedInstructionDataDecoder=pa;exports.getTransactionBufferCreateCompressedInstructionDataEncoder=ma;exports.getTransactionBufferCreateDiscriminatorBytes=wb;exports.getTransactionBufferCreateInstruction=ua;exports.getTransactionBufferCreateInstructionDataCodec=kb;exports.getTransactionBufferCreateInstructionDataDecoder=da;exports.getTransactionBufferCreateInstructionDataEncoder=ia;exports.getTransactionBufferDecoder=Gs;exports.getTransactionBufferDiscriminatorBytes=bh;exports.getTransactionBufferEncoder=Gy;exports.getTransactionBufferExecuteCompressedDiscriminatorBytes=uv;exports.getTransactionBufferExecuteCompressedInstruction=Ra;exports.getTransactionBufferExecuteCompressedInstructionDataCodec=Av;exports.getTransactionBufferExecuteCompressedInstructionDataDecoder=Ea;exports.getTransactionBufferExecuteCompressedInstructionDataEncoder=Pa;exports.getTransactionBufferExecuteDiscriminatorBytes=tv;exports.getTransactionBufferExecuteInstruction=Ca;exports.getTransactionBufferExecuteInstructionDataCodec=rv;exports.getTransactionBufferExecuteInstructionDataDecoder=Ia;exports.getTransactionBufferExecuteInstructionDataEncoder=xa;exports.getTransactionBufferExtendCompressedDiscriminatorBytes=Pv;exports.getTransactionBufferExtendCompressedInstruction=Ha;exports.getTransactionBufferExtendCompressedInstructionDataCodec=Ev;exports.getTransactionBufferExtendCompressedInstructionDataDecoder=Na;exports.getTransactionBufferExtendCompressedInstructionDataEncoder=ka;exports.getTransactionBufferExtendDiscriminatorBytes=fv;exports.getTransactionBufferExtendInstruction=Oa;exports.getTransactionBufferExtendInstructionDataCodec=Sv;exports.getTransactionBufferExtendInstructionDataDecoder=_a;exports.getTransactionBufferExtendInstructionDataEncoder=Wa;exports.getTransactionBufferVoteCompressedDiscriminatorBytes=zv;exports.getTransactionBufferVoteCompressedInstruction=$a;exports.getTransactionBufferVoteCompressedInstructionDataCodec=Kv;exports.getTransactionBufferVoteCompressedInstructionDataDecoder=Xa;exports.getTransactionBufferVoteCompressedInstructionDataEncoder=qa;exports.getTransactionBufferVoteDiscriminatorBytes=Lv;exports.getTransactionBufferVoteInstruction=Ja;exports.getTransactionBufferVoteInstructionDataCodec=Bv;exports.getTransactionBufferVoteInstructionDataDecoder=Ka;exports.getTransactionBufferVoteInstructionDataEncoder=za;exports.getTransactionExecuteCompressedDiscriminatorBytes=cU;exports.getTransactionExecuteCompressedInstruction=ui;exports.getTransactionExecuteCompressedInstructionDataCodec=aU;exports.getTransactionExecuteCompressedInstructionDataDecoder=di;exports.getTransactionExecuteCompressedInstructionDataEncoder=ii;exports.getTransactionExecuteDiscriminatorBytes=$v;exports.getTransactionExecuteInstruction=si;exports.getTransactionExecuteInstructionDataCodec=Qv;exports.getTransactionExecuteInstructionDataDecoder=ni;exports.getTransactionExecuteInstructionDataEncoder=ri;exports.getTransactionExecuteSyncCompressedDiscriminatorBytes=MU;exports.getTransactionExecuteSyncCompressedInstruction=Ci;exports.getTransactionExecuteSyncCompressedInstructionDataCodec=hU;exports.getTransactionExecuteSyncCompressedInstructionDataDecoder=Ii;exports.getTransactionExecuteSyncCompressedInstructionDataEncoder=xi;exports.getTransactionExecuteSyncDiscriminatorBytes=pU;exports.getTransactionExecuteSyncInstruction=Ti;exports.getTransactionExecuteSyncInstructionDataCodec=TU;exports.getTransactionExecuteSyncInstructionDataDecoder=pi;exports.getTransactionExecuteSyncInstructionDataEncoder=mi;exports.getTransactionMessageAddressTableLookupCodec=dM;exports.getTransactionMessageAddressTableLookupDecoder=Nr;exports.getTransactionMessageAddressTableLookupEncoder=kr;exports.getTransactionMessageCodec=cM;exports.getTransactionMessageDecoder=It;exports.getTransactionMessageEncoder=xt;exports.getUserAccountAddress=B;exports.getUserCodec=yM;exports.getUserCreationArgsCodec=lM;exports.getUserCreationArgsDecoder=ue;exports.getUserCreationArgsEncoder=de;exports.getUserDecoder=q;exports.getUserEncoder=_e;exports.getUserMutArgsCodec=IM;exports.getUserMutArgsDecoder=ge;exports.getUserMutArgsEncoder=Ae;exports.getUserReadOnlyArgsCodec=hM;exports.getUserReadOnlyArgsDecoder=Fr;exports.getUserReadOnlyArgsEncoder=Gr;exports.getUserReadOnlyOrMutateArgsCodec=bM;exports.getUserReadOnlyOrMutateArgsDecoder=Qe;exports.getUserReadOnlyOrMutateArgsEncoder=$e;exports.getUserRoleCodec=OM;exports.getUserRoleDecoder=We;exports.getUserRoleEncoder=Ue;exports.getWalletAddressFromIndex=ed;exports.getWalletAddressFromSettings=Ie;exports.getWhitelistedAddressTreeCodec=Lh;exports.getWhitelistedAddressTreeDecoder=Ys;exports.getWhitelistedAddressTreeDiscriminatorBytes=Oh;exports.getWhitelistedAddressTreeEncoder=im;exports.getWhitelistedAddressTreeFromIndex=kn;exports.getWhitelistedAddressTreeIndexFromAddress=nr;exports.getWhitelistedAddressTreesAddress=Ki;exports.identifyMultiWalletAccount=uW;exports.identifyMultiWalletInstruction=AW;exports.initialize=d_;exports.isConfigAction=kC;exports.isMultiWalletError=fW;exports.isUserReadOnlyOrMutateArgs=UM;exports.nativeTransferIntent=ZB;exports.parseAddWhitelistedAddressTreesInstruction=rP;exports.parseChangeConfigCompressedInstruction=IP;exports.parseChangeConfigInstruction=gP;exports.parseCompressSettingsAccountInstruction=vP;exports.parseCreateDomainConfigInstruction=HP;exports.parseCreateDomainUserAccountInstruction=qP;exports.parseCreateGlobalCounterInstruction=oE;exports.parseCreateMultiWalletCompressedInstruction=pE;exports.parseCreateUserAccountsInstruction=hE;exports.parseDecompressSettingsAccountInstruction=OE;exports.parseDisableDomainConfigInstruction=GE;exports.parseEditDomainConfigInstruction=$E;exports.parseEditTransactionManagerUrlInstruction=aR;exports.parseMigrateCompressedSettingsInstruction=lR;exports.parseMigrateCompressedUsersInstruction=ER;exports.parseNativeTransferIntentCompressedInstruction=JR;exports.parseNativeTransferIntentInstruction=wR;exports.parseSecp256r1VerifyInstruction=GO;exports.parseTokenTransferIntentCompressedInstruction=gb;exports.parseTokenTransferIntentInstruction=rb;exports.parseTransactionBufferCloseCompressedInstruction=vb;exports.parseTransactionBufferCloseInstruction=Ib;exports.parseTransactionBufferCreateCompressedInstruction=Yb;exports.parseTransactionBufferCreateInstruction=Nb;exports.parseTransactionBufferExecuteCompressedInstruction=gv;exports.parseTransactionBufferExecuteInstruction=nv;exports.parseTransactionBufferExtendCompressedInstruction=Rv;exports.parseTransactionBufferExtendInstruction=xv;exports.parseTransactionBufferVoteCompressedInstruction=Jv;exports.parseTransactionBufferVoteInstruction=wv;exports.parseTransactionExecuteCompressedInstruction=iU;exports.parseTransactionExecuteInstruction=eU;exports.parseTransactionExecuteSyncCompressedInstruction=PU;exports.parseTransactionExecuteSyncInstruction=lU;exports.pollJitoBundleConfirmation=fO;exports.prepareTransactionBundle=Dk;exports.prepareTransactionMessage=Bk;exports.prepareTransactionSync=Vk;exports.resolveTransactionManagerSigner=SO;exports.sendJitoBundle=II;exports.signAndSendBundledTransactions=TO;exports.signAndSendTransaction=lO;exports.signMessageWithPasskey=tk;exports.signTransactionWithPasskey=ck;exports.tokenTransferIntent=ow;exports.uninitialize=i_;exports.userReadOnlyOrMutateArgs=vM;exports.vaultTransactionMessageDeserialize=Ei;exports.vaultTransactionMessageSerialize=Pi;exports.verifyMessage=Ak;exports.voteTransactionBuffer=kd;//# sourceMappingURL=index.cjs.map
3
3
  //# sourceMappingURL=index.cjs.map