@revibase/core 0.0.18 → 0.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +89 -88
- package/dist/index.d.ts +89 -88
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';var gill=require('gill'),Un=require('bn.js'),stateless_js=require('@lightprotocol/stateless.js'),sha2_js=require('@noble/hashes/sha2.js'),web3_js=require('@solana/web3.js'),superstruct=require('superstruct'),programs=require('gill/programs'),tinyCbor=require('@levischuck/tiny-cbor'),nist_js=require('@noble/curves/nist.js'),ed25519_js=require('@noble/curves/ed25519.js'),server=require('@simplewebauthn/server');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Un__default=/*#__PURE__*/_interopDefault(Un);var Hn=new Uint8Array([201,232,212,229,59,241,106,197]);function jC(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Hn)}function eu(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["authority",gill.getAddressEncoder()],["rpIdHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["bump",gill.getU8Encoder()],["isDisabled",gill.getU8Encoder()],["rpIdLength",gill.getU8Encoder()],["numOrigins",gill.getU8Encoder()],["rpId",gill.fixEncoderSize(gill.getBytesEncoder(),255)],["origins",gill.fixEncoderSize(gill.getBytesEncoder(),515)]]),e=>({...e,discriminator:Hn}))}function Vn(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["authority",gill.getAddressDecoder()],["rpIdHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["bump",gill.getU8Decoder()],["isDisabled",gill.getU8Decoder()],["rpIdLength",gill.getU8Decoder()],["numOrigins",gill.getU8Decoder()],["rpId",gill.fixDecoderSize(gill.getBytesDecoder(),255)],["origins",gill.fixDecoderSize(gill.getBytesDecoder(),515)]])}function qC(){return gill.combineCodec(eu(),Vn())}function Gn(e){return gill.decodeAccount(e,Vn())}async function Fn(e,n,r){let s=await tu(e,n,r);return gill.assertAccountExists(s),s}async function tu(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Gn(s)}async function YC(e,n,r){let s=await ru(e,n,r);return gill.assertAccountsExist(s),s}async function ru(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Gn(t))}function ZC(){return 846}var Jn=new Uint8Array([42,206,176,58,175,129,130,233]);function QC(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Jn)}function Tu(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()]]),e=>({...e,discriminator:Jn}))}function jn(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()]])}function eD(){return gill.combineCodec(Tu(),jn())}function qn(e){return gill.decodeAccount(e,jn())}async function tD(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 rD(e,n,r){let s=await lu(e,n,r);return gill.assertAccountsExist(s),s}async function lu(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>qn(t))}function nD(){return 24}function pr(){return gill.getStructEncoder([["memberKey",$()],["permissions",ve()],["verifyArgs",gill.getOptionEncoder(B())],["userArgs",_e()]])}function mr(){return gill.getStructDecoder([["memberKey",Q()],["permissions",be()],["verifyArgs",gill.getOptionDecoder(w())],["userArgs",Ue()]])}function aD(){return gill.combineCodec(pr(),mr())}function Tr(){return gill.getStructEncoder([["programAddressIndex",gill.getU8Encoder()],["accountIndices",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["data",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function fr(){return gill.getStructDecoder([["programAddressIndex",gill.getU8Decoder()],["accountIndices",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["data",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function uD(){return gill.combineCodec(Tr(),fr())}function nt(){return gill.getStructEncoder([["treeInfo",ot()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["outputStateTreeIndex",gill.getU8Encoder()]])}function st(){return gill.getStructDecoder([["treeInfo",ct()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["outputStateTreeIndex",gill.getU8Decoder()]])}function pD(){return gill.combineCodec(nt(),st())}function at(){return gill.getStructEncoder([["treeInfo",ot()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function it(){return gill.getStructDecoder([["treeInfo",ct()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function lD(){return gill.combineCodec(at(),it())}function Cr(){return gill.getStructEncoder([["a",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["b",gill.fixEncoderSize(gill.getBytesEncoder(),64)],["c",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function Dr(){return gill.getStructDecoder([["a",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["b",gill.fixDecoderSize(gill.getBytesDecoder(),64)],["c",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function ID(){return gill.combineCodec(Cr(),Dr())}function dt(){return gill.getStructEncoder([["data",gill.getOptionEncoder(ut())]])}function z(){return gill.getStructDecoder([["data",gill.getOptionDecoder(At())]])}function ED(){return gill.combineCodec(dt(),z())}function ut(){return gill.getStructEncoder([["threshold",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["index",gill.getU128Encoder()],["multiWalletBump",gill.getU8Encoder()],["members",gill.getArrayEncoder(gt())],["settingsAddressTreeIndex",gill.getU8Encoder()]])}function At(){return gill.getStructDecoder([["threshold",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["index",gill.getU128Decoder()],["multiWalletBump",gill.getU8Decoder()],["members",gill.getArrayDecoder(yt())],["settingsAddressTreeIndex",gill.getU8Decoder()]])}function vD(){return gill.combineCodec(ut(),At())}function pt(){return gill.getDiscriminatedUnionEncoder([["EditPermissions",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(hr())])]])],["AddMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(pr())])]])],["RemoveMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Rr())])]])],["SetThreshold",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getU8Encoder()])]])]])}function mt(){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(vr())])]])],["SetThreshold",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getU8Decoder()])]])]])}function WD(){return gill.combineCodec(pt(),mt())}function LD(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function OD(e,n){return n.__kind===e}function br(){return gill.getStructEncoder([["member",gill.getAddressEncoder()],["role",We()],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userCreationArgs",pe()]])}function _r(){return gill.getStructDecoder([["member",gill.getAddressDecoder()],["role",Le()],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userCreationArgs",me()]])}function ND(){return gill.combineCodec(br(),_r())}function hr(){return gill.getStructEncoder([["memberKey",$()],["permissions",ve()]])}function Pr(){return gill.getStructDecoder([["memberKey",Q()],["permissions",be()]])}function FD(){return gill.combineCodec(hr(),Pr())}function Tt(){return gill.getStructEncoder([["memberKey",$()],["messageHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function ft(){return gill.getStructDecoder([["memberKey",Q()],["messageHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function jD(){return gill.combineCodec(Tt(),ft())}function Ur(){return gill.getStructEncoder([["settingsMutArgs",de()],["transactionManager",gill.getOptionEncoder(Se())]])}function Wr(){return gill.getStructDecoder([["settingsMutArgs",ue()],["transactionManager",gill.getOptionDecoder(xe())]])}function XD(){return gill.combineCodec(Ur(),Wr())}function gt(){return gill.getStructEncoder([["pubkey",$()],["permissions",ve()],["role",gill.getU8Encoder()],["userAddressTreeIndex",gill.getU8Encoder()],["isDelegate",gill.getU8Encoder()]])}function yt(){return gill.getStructDecoder([["pubkey",Q()],["permissions",be()],["role",gill.getU8Decoder()],["userAddressTreeIndex",gill.getU8Decoder()],["isDelegate",gill.getU8Decoder()]])}function tM(){return gill.combineCodec(gt(),yt())}function $(){return gill.getStructEncoder([["keyType",gill.getU8Encoder()],["key",gill.fixEncoderSize(gill.getBytesEncoder(),33)]])}function Q(){return gill.getStructDecoder([["keyType",gill.getU8Decoder()],["key",gill.fixDecoderSize(gill.getBytesDecoder(),33)]])}function sM(){return gill.combineCodec($(),Q())}function Br(){return gill.getStructEncoder([["authorityCreationArgs",pe()],["compressedProofArgs",M()]])}function wr(){return gill.getStructDecoder([["authorityCreationArgs",me()],["compressedProofArgs",E()]])}function iM(){return gill.combineCodec(Br(),wr())}function lt(){return gill.getStructEncoder([["addressMerkleTreePubkeyIndex",gill.getU8Encoder()],["addressQueuePubkeyIndex",gill.getU8Encoder()],["rootIndex",gill.getU16Encoder()]])}function St(){return gill.getStructDecoder([["addressMerkleTreePubkeyIndex",gill.getU8Decoder()],["addressQueuePubkeyIndex",gill.getU8Decoder()],["rootIndex",gill.getU16Decoder()]])}function AM(){return gill.combineCodec(lt(),St())}function ot(){return gill.getStructEncoder([["rootIndex",gill.getU16Encoder()],["proveByIndex",gill.getBooleanEncoder()],["merkleTreePubkeyIndex",gill.getU8Encoder()],["queuePubkeyIndex",gill.getU8Encoder()],["leafIndex",gill.getU32Encoder()]])}function ct(){return gill.getStructDecoder([["rootIndex",gill.getU16Decoder()],["proveByIndex",gill.getBooleanDecoder()],["merkleTreePubkeyIndex",gill.getU8Decoder()],["queuePubkeyIndex",gill.getU8Decoder()],["leafIndex",gill.getU32Decoder()]])}function pM(){return gill.combineCodec(ot(),ct())}function ve(){return gill.getStructEncoder([["mask",gill.getU8Encoder()]])}function be(){return gill.getStructDecoder([["mask",gill.getU8Decoder()]])}function fM(){return gill.combineCodec(ve(),be())}function M(){return gill.getStructEncoder([["proof",gill.getOptionEncoder(Cr())],["lightCpiAccountsStartIndex",gill.getU8Encoder()]])}function E(){return gill.getStructDecoder([["proof",gill.getOptionDecoder(Dr())],["lightCpiAccountsStartIndex",gill.getU8Decoder()]])}function IM(){return gill.combineCodec(M(),E())}function Rr(){return gill.getStructEncoder([["memberKey",$()],["userArgs",_e()]])}function vr(){return gill.getStructDecoder([["memberKey",Q()],["userArgs",Ue()]])}function EM(){return gill.combineCodec(Rr(),vr())}function kr(){return gill.getTupleEncoder([gill.fixEncoderSize(gill.getBytesEncoder(),33)])}function xt(){return gill.getTupleDecoder([gill.fixDecoderSize(gill.getBytesDecoder(),33)])}function RM(){return gill.combineCodec(kr(),xt())}function B(){return gill.getStructEncoder([["signedMessageIndex",gill.getU8Encoder()],["slotNumber",gill.getU64Encoder()],["originIndex",gill.getU8Encoder()],["crossOrigin",gill.getBooleanEncoder()],["truncatedClientDataJson",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["clientAndDeviceHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function w(){return gill.getStructDecoder([["signedMessageIndex",gill.getU8Decoder()],["slotNumber",gill.getU64Decoder()],["originIndex",gill.getU8Decoder()],["crossOrigin",gill.getBooleanDecoder()],["truncatedClientDataJson",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["clientAndDeviceHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function _M(){return gill.combineCodec(B(),w())}function ee(){return gill.getStructEncoder([["domainConfigKey",gill.getAddressEncoder()],["verifyArgs",B()]])}function te(){return gill.getStructDecoder([["domainConfigKey",gill.getAddressDecoder()],["verifyArgs",w()]])}function OM(){return gill.combineCodec(ee(),te())}function It(){return gill.getStructEncoder([["addressTreeInfo",lt()],["outputStateTreeIndex",gill.getU8Encoder()]])}function Ct(){return gill.getStructDecoder([["addressTreeInfo",St()],["outputStateTreeIndex",gill.getU8Decoder()]])}function NM(){return gill.combineCodec(It(),Ct())}function Dt(){return gill.getStructEncoder([["index",gill.getU128Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()]])}function Mt(){return gill.getStructDecoder([["index",gill.getU128Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()]])}function GM(){return gill.combineCodec(Dt(),Mt())}function de(){return gill.getStructEncoder([["accountMeta",nt()],["data",dt()]])}function ue(){return gill.getStructDecoder([["accountMeta",st()],["data",z()]])}function JM(){return gill.combineCodec(de(),ue())}function ne(){return gill.getStructEncoder([["accountMeta",at()],["data",dt()]])}function se(){return gill.getStructDecoder([["accountMeta",it()],["data",z()]])}function ZM(){return gill.combineCodec(ne(),se())}function Et(){return gill.getStructEncoder([["bufferIndex",gill.getU8Encoder()],["preauthorizeExecution",gill.getBooleanEncoder()],["bufferExtendHashes",gill.getArrayEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))],["finalBufferHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["finalBufferSize",gill.getU16Encoder()],["expectedSecp256r1Signers",gill.getOptionEncoder(gill.getArrayEncoder(Tt()))]])}function ht(){return gill.getStructDecoder([["bufferIndex",gill.getU8Decoder()],["preauthorizeExecution",gill.getBooleanDecoder()],["bufferExtendHashes",gill.getArrayDecoder(gill.fixDecoderSize(gill.getBytesDecoder(),32))],["finalBufferHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["finalBufferSize",gill.getU16Decoder()],["expectedSecp256r1Signers",gill.getOptionDecoder(gill.getArrayDecoder(ft()))]])}function eE(){return gill.combineCodec(Et(),ht())}function Pt(){return gill.getStructEncoder([["numSigners",gill.getU8Encoder()],["numWritableSigners",gill.getU8Encoder()],["numWritableNonSigners",gill.getU8Encoder()],["numAccountKeys",gill.getU8Encoder()],["instructions",gill.getArrayEncoder(Tr())],["addressTableLookups",gill.getArrayEncoder(Nr())]])}function Rt(){return gill.getStructDecoder([["numSigners",gill.getU8Decoder()],["numWritableSigners",gill.getU8Decoder()],["numWritableNonSigners",gill.getU8Decoder()],["numAccountKeys",gill.getU8Decoder()],["instructions",gill.getArrayDecoder(fr())],["addressTableLookups",gill.getArrayDecoder(Hr())]])}function sE(){return gill.combineCodec(Pt(),Rt())}function Nr(){return gill.getStructEncoder([["lookupTableAddressIndex",gill.getU8Encoder()],["writableIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["readonlyIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function Hr(){return gill.getStructDecoder([["lookupTableAddressIndex",gill.getU8Decoder()],["writableIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["readonlyIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function aE(){return gill.combineCodec(Nr(),Hr())}function Oe(){return gill.getStructEncoder([["member",$()],["domainConfig",gill.getOptionEncoder(gill.getAddressEncoder())],["role",We()],["delegatedTo",gill.getOptionEncoder(Dt())],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userAddressTreeIndex",gill.getU8Encoder()]])}function J(){return gill.getStructDecoder([["member",Q()],["domainConfig",gill.getOptionDecoder(gill.getAddressDecoder())],["role",Le()],["delegatedTo",gill.getOptionDecoder(Mt())],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userAddressTreeIndex",gill.getU8Decoder()]])}function AE(){return gill.combineCodec(Oe(),J())}function pe(){return gill.getStructEncoder([["addressTreeInfo",lt()],["outputStateTreeIndex",gill.getU8Encoder()]])}function me(){return gill.getStructDecoder([["addressTreeInfo",St()],["outputStateTreeIndex",gill.getU8Decoder()]])}function mE(){return gill.combineCodec(pe(),me())}function Se(){return gill.getStructEncoder([["accountMeta",nt()],["data",Oe()]])}function xe(){return gill.getStructDecoder([["accountMeta",st()],["data",J()]])}function SE(){return gill.combineCodec(Se(),xe())}function Fr(){return gill.getStructEncoder([["accountMeta",at()],["data",Oe()]])}function zr(){return gill.getStructDecoder([["accountMeta",it()],["data",J()]])}function DE(){return gill.combineCodec(Fr(),zr())}function _e(){return gill.getDiscriminatedUnionEncoder([["Read",gill.getStructEncoder([["fields",gill.getTupleEncoder([Fr()])]])],["Mutate",gill.getStructEncoder([["fields",gill.getTupleEncoder([Se()])]])]])}function Ue(){return gill.getDiscriminatedUnionDecoder([["Read",gill.getStructDecoder([["fields",gill.getTupleDecoder([zr()])]])],["Mutate",gill.getStructDecoder([["fields",gill.getTupleDecoder([xe()])]])]])}function PE(){return gill.combineCodec(_e(),Ue())}function RE(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function vE(e,n){return n.__kind===e}var Be=(t=>(t[t.Member=0]="Member",t[t.PermanentMember=1]="PermanentMember",t[t.TransactionManager=2]="TransactionManager",t[t.Administrator=3]="Administrator",t))(Be||{});function We(){return gill.getEnumEncoder(Be)}function Le(){return gill.getEnumDecoder(Be)}function UE(){return gill.combineCodec(We(),Le())}var vs=new Uint8Array([223,179,163,190,177,224,67,173]);function Sh(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(vs)}function hy(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()],["members",gill.getArrayEncoder(gt(),{size:4})],["membersLen",gill.getU8Encoder()],["threshold",gill.getU8Encoder()],["multiWalletBump",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()],["padding",gill.fixEncoderSize(gill.getBytesEncoder(),3)]]),e=>({...e,discriminator:vs}))}function bs(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()],["members",gill.getArrayDecoder(yt(),{size:4})],["membersLen",gill.getU8Decoder()],["threshold",gill.getU8Decoder()],["multiWalletBump",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()],["padding",gill.fixDecoderSize(gill.getBytesDecoder(),3)]])}function xh(){return gill.combineCodec(hy(),bs())}function _s(e){return gill.decodeAccount(e,bs())}async function Ih(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 _s(s)}async function Ch(e,n,r){let s=await Py(e,n,r);return gill.assertAccountsExist(s),s}async function Py(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>_s(t))}function Dh(){return 184}var Bs=new Uint8Array([90,36,35,219,93,225,110,96]);function Ph(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Bs)}function jy(){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",$()],["executor",$()],["bufferExtendHashes",gill.getArrayEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))],["voters",gill.getArrayEncoder($())],["expectedSecp256r1Signers",gill.getOptionEncoder(gill.getArrayEncoder(Tt()))],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:Bs}))}function ws(){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",Q()],["executor",Q()],["bufferExtendHashes",gill.getArrayDecoder(gill.fixDecoderSize(gill.getBytesDecoder(),32))],["voters",gill.getArrayDecoder(Q())],["expectedSecp256r1Signers",gill.getOptionDecoder(gill.getArrayDecoder(ft()))],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function Rh(){return gill.combineCodec(jy(),ws())}function ks(e){return gill.decodeAccount(e,ws())}async function Ns(e,n,r){let s=await qy(e,n,r);return gill.assertAccountExists(s),s}async function qy(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return ks(s)}async function vh(e,n,r){let s=await Yy(e,n,r);return gill.assertAccountsExist(s),s}async function Yy(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>ks(t))}var Gs=new Uint8Array([105,23,173,2,197,255,80,87]);function Uh(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Gs)}function yp(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["whitelistedAddressTrees",gill.getArrayEncoder(gill.getAddressEncoder())],["bump",gill.getU8Encoder()]]),e=>({...e,discriminator:Gs}))}function Fs(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["whitelistedAddressTrees",gill.getArrayDecoder(gill.getAddressDecoder())],["bump",gill.getU8Decoder()]])}function Wh(){return gill.combineCodec(yp(),Fs())}function zs(e){return gill.decodeAccount(e,Fs())}async function Ks(e,n,r){let s=await pp(e,n,r);return gill.assertAccountExists(s),s}async function pp(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return zs(s)}async function Lh(e,n,r){let s=await mp(e,n,r);return gill.assertAccountsExist(s),s}async function mp(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>zs(t))}function p({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 js(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}function K(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 m(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:K(r.value),role:Js(r.value)?gill.upgradeRoleToSigner(s):s,...Js(r.value)?{signer:r.value}:{}})}}function Js(e){return !!e&&typeof e=="object"&&"address"in e&&gill.isTransactionSigner(e)}var Ys=new Uint8Array([8]);function Xh(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ys)}function tn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["addressTree",gill.getAddressEncoder()]]),e=>({...e,discriminator:Ys}))}function Zs(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["addressTree",gill.getAddressDecoder()]])}function $h(){return gill.combineCodec(tn(),Zs())}async function Xs(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...a],data:tn().encode(c),programAddress:r})}function Qh(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...a],data:tn().encode(c),programAddress:r})}function eP(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:Zs().decode(e.data)}}var to=new Uint8Array([9]);function aP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(to)}function rn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsIndex",gill.getU128Encoder()],["configActions",gill.getArrayEncoder(pt())],["compressedProofArgs",gill.getOptionEncoder(M())]]),e=>({...e,discriminator:to}))}function ro(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsIndex",gill.getU128Decoder()],["configActions",gill.getArrayDecoder(mt())],["compressedProofArgs",gill.getOptionDecoder(E())]])}function iP(){return gill.combineCodec(rn(),ro())}async function no(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.settings.value||(t.settings.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getU128Encoder().encode(js(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(K(t.settings.value)),gill.getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.authority),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:rn().encode(c),programAddress:r})}function dP(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.authority),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:rn().encode(c),programAddress:r})}function uP(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),authority:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:ro().decode(e.data)}}var co=new Uint8Array([20]);function fP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(co)}function ao(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["configActions",gill.getArrayEncoder(pt())],["settingsMut",de()],["compressedProofArgs",M()]]),e=>({...e,discriminator:co}))}function io(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["configActions",gill.getArrayDecoder(mt())],["settingsMut",ue()],["compressedProofArgs",E()]])}function lP(){return gill.combineCodec(ao(),io())}function uo(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.authority),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:ao().encode(c),programAddress:r})}function SP(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),authority:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:io().decode(e.data)}}var yo=new Uint8Array([17]);function hP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(yo)}function po(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",M()],["settingsMutArgs",de()],["secp256r1VerifyArgs",gill.getArrayEncoder(ee())]]),e=>({...e,discriminator:yo}))}function mo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",E()],["settingsMutArgs",ue()],["secp256r1VerifyArgs",gill.getArrayDecoder(te())]])}function PP(){return gill.combineCodec(po(),mo())}function To(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:po().encode(c),programAddress:r})}function RP(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:mo().decode(e.data)}}var Mo=new Uint8Array([0]);function OP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Mo)}function sn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["rpId",gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())],["origins",gill.getArrayEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["authorityCreationArgs",pe()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Mo}))}function Eo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["rpId",gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())],["origins",gill.getArrayDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["authorityCreationArgs",me()],["compressedProofArgs",E()]])}function BP(){return gill.combineCodec(sn(),Eo())}async function ho(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:sn().encode(c),programAddress:r})}function wP(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:sn().encode(c),programAddress:r})}function kP(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:Eo().decode(e.data)}}var Ro=new Uint8Array([4]);function KP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ro)}function cn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",M()],["member",kr()],["role",We()],["userAccountCreationArgs",pe()],["linkWalletArgs",gill.getOptionEncoder(Ur())]]),e=>({...e,discriminator:Ro}))}function vo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",E()],["member",xt()],["role",Le()],["userAccountCreationArgs",me()],["linkWalletArgs",gill.getOptionDecoder(Wr())]])}function JP(){return gill.combineCodec(cn(),vo())}async function bo(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...a],data:cn().encode(c),programAddress:r})}function jP(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a=p({args:c}),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...a],data:cn().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:vo().decode(e.data)}}var Uo=new Uint8Array([3]);function eR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Uo)}function dn(){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 tR(){return gill.combineCodec(dn(),Wo())}async function Lo(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=p(c),a=m(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:dn().encode({}),programAddress:r})}function rR(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=p(c),a=m(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:dn().encode({}),programAddress:r})}function nR(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 wo=new Uint8Array([19]);function uR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(wo)}function un(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["compressedProofArgs",M()],["settingsCreation",It()],["userArgs",_e()],["settingsIndex",gill.getU128Encoder()]]),e=>({...e,discriminator:wo}))}function ko(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["compressedProofArgs",E()],["settingsCreation",Ct()],["userArgs",Ue()],["settingsIndex",gill.getU128Decoder()]])}function AR(){return gill.combineCodec(un(),ko())}async function No(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.globalCounter.value||(t.globalCounter.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),o(t.globalCounter),o(t.whitelistedAddressTrees),...a],data:un().encode(c),programAddress:r})}function gR(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),o(t.globalCounter),o(t.whitelistedAddressTrees),...a],data:un().encode(c),programAddress:r})}function yR(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s(),globalCounter:r(),whitelistedAddressTrees:r()},data:ko().decode(e.data)}}var Vo=new Uint8Array([5]);function xR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Vo)}function gn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",M()],["createUserArgs",gill.getArrayEncoder(br())]]),e=>({...e,discriminator:Vo}))}function Go(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",E()],["createUserArgs",gill.getArrayDecoder(_r())]])}function IR(){return gill.combineCodec(gn(),Go())}async function Fo(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:gn().encode(c),programAddress:r})}function CR(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:gn().encode(c),programAddress:r})}function DR(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:Go().decode(e.data)}}var Jo=new Uint8Array([18]);function bR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Jo)}function jo(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsMut",de()],["compressedProofArgs",M()],["secp256r1VerifyArgs",gill.getArrayEncoder(ee())]]),e=>({...e,discriminator:Jo}))}function qo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsMut",ue()],["compressedProofArgs",E()],["secp256r1VerifyArgs",gill.getArrayDecoder(te())]])}function _R(){return gill.combineCodec(jo(),qo())}function Yo(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:jo().encode(c),programAddress:r})}function UR(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:qo().decode(e.data)}}var $o=new Uint8Array([2]);function kR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode($o)}function Qo(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["disable",gill.getBooleanEncoder()]]),e=>({...e,discriminator:$o}))}function ec(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["disable",gill.getBooleanDecoder()]])}function NR(){return gill.combineCodec(Qo(),ec())}function tc(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},a=p({args:c}),o=m(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),...a],data:Qo().encode(c),programAddress:r})}function HR(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:ec().decode(e.data)}}var oc=new Uint8Array([1]);function jR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(oc)}function pn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["newOrigins",gill.getOptionEncoder(gill.getArrayEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())))],["newAuthorityArgs",gill.getOptionEncoder(Br())]]),e=>({...e,discriminator:oc}))}function cc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["newOrigins",gill.getOptionDecoder(gill.getArrayDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())))],["newAuthorityArgs",gill.getOptionDecoder(wr())]])}function qR(){return gill.combineCodec(pn(),cc())}async function YR(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...a],data:pn().encode(c),programAddress:r})}function ac(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...a],data:pn().encode(c),programAddress:r})}function ZR(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:s(),whitelistedAddressTrees:s(),systemProgram:r()},data:cc().decode(e.data)}}var uc=new Uint8Array([6]);function nv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(uc)}function Ac(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",Se()],["transactionManagerUrl",gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())],["compressedProofArgs",M()]]),e=>({...e,discriminator:uc}))}function gc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",xe()],["transactionManagerUrl",gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())],["compressedProofArgs",E()]])}function sv(){return gill.combineCodec(Ac(),gc())}function yc(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a=p({args:c}),o=m(r);return Object.freeze({accounts:[o(t.authority),...a],data:Ac().encode(c),programAddress:r})}function ov(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:gc().decode(e.data)}}var Tc=new Uint8Array([7]);function gv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Tc)}function fc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",Se()],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["delegateTo",gill.getOptionEncoder(Dt())],["oldSettingsMutArgs",gill.getOptionEncoder(de())],["newSettingsMutArgs",gill.getOptionEncoder(de())],["compressedProofArgs",M()]]),e=>({...e,discriminator:Tc}))}function lc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",xe()],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["delegateTo",gill.getOptionDecoder(Mt())],["oldSettingsMutArgs",gill.getOptionDecoder(ue())],["newSettingsMutArgs",gill.getOptionDecoder(ue())],["compressedProofArgs",E()]])}function yv(){return gill.combineCodec(fc(),lc())}function Sc(e,n){let r=n?.programAddress??A,t={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},oldSettings:{value:e.oldSettings??null,isWritable:true},newSettings:{value:e.newSettings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.feePayer),o(t.signer),o(t.oldSettings),o(t.newSettings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),...a],data:fc().encode(c),programAddress:r})}function pv(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{feePayer:r(),signer:s(),oldSettings:s(),newSettings:s(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s()},data:lc().decode(e.data)}}var Cc=new Uint8Array([33]);function Iv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Cc)}function Dc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",ut()],["compressedProofArgs",M()],["settingsCreationArgs",It()]]),e=>({...e,discriminator:Cc}))}function Mc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",At()],["compressedProofArgs",E()],["settingsCreationArgs",Ct()]])}function Cv(){return gill.combineCodec(Dc(),Mc())}function Ec(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.authority),...a],data:Dc().encode(c),programAddress:r})}function Dv(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:Mc().decode(e.data)}}var Rc=new Uint8Array([32]);function bv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Rc)}function vc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Oe()],["compressedProofArgs",M()],["userCreationArgs",pe()]]),e=>({...e,discriminator:Rc}))}function bc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",J()],["compressedProofArgs",E()],["userCreationArgs",me()]])}function _v(){return gill.combineCodec(vc(),bc())}function _c(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.authority),...a],data:vc().encode(c),programAddress:r})}function Uv(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:bc().decode(e.data)}}var Wc=new Uint8Array([30]);function Nv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Wc)}function mn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(ee())]]),e=>({...e,discriminator:Wc}))}function Lc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(te())]])}function Hv(){return gill.combineCodec(mn(),Lc())}async function Vv(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getAddressEncoder().encode(K(t.settings.value)),gill.getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...a],data:mn().encode(c),programAddress:r})}function Oc(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...a],data:mn().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===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Lc().decode(e.data)}}var kc=new Uint8Array([28]);function Yv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(kc)}function Nc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(ee())],["settingsReadonlyArgs",ne()],["compressedProofArgs",M()]]),e=>({...e,discriminator:kc}))}function Hc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(te())],["settingsReadonlyArgs",se()],["compressedProofArgs",E()]])}function Zv(){return gill.combineCodec(Nc(),Hc())}function Vc(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...a],data:Nc().encode(c),programAddress:r})}function Xv(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Hc().decode(e.data)}}var Fc=new Uint8Array([31]);function sb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Fc)}function fn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["createAtaIfNeeded",gill.getBooleanEncoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(ee())]]),e=>({...e,discriminator:Fc}))}function zc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["createAtaIfNeeded",gill.getBooleanDecoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(te())]])}function ob(){return gill.combineCodec(fn(),zc())}async function cb(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getAddressEncoder().encode(K(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(K(t.source.value)),gill.getAddressEncoder().encode(K(t.tokenProgram.value)),gill.getAddressEncoder().encode(K(t.mint.value))]})),t.destinationTokenAccount.value||(t.destinationTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(K(t.destination.value)),gill.getAddressEncoder().encode(K(t.tokenProgram.value)),gill.getAddressEncoder().encode(K(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...a],data:fn().encode(c),programAddress:r})}function Kc(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...a],data:fn().encode(c),programAddress:r})}function ab(e){if(e.accounts.length<11)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceTokenAccount:r(),destination:r(),destinationTokenAccount:r(),tokenProgram:r(),mint:r(),systemProgram:r(),associatedTokenProgram:r()},data:zc().decode(e.data)}}var Yc=new Uint8Array([29]);function pb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Yc)}function ln(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["createAtaIfNeeded",gill.getBooleanEncoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(ee())],["settingsReadonlyArgs",ne()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Yc}))}function Zc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["createAtaIfNeeded",gill.getBooleanDecoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(te())],["settingsReadonlyArgs",se()],["compressedProofArgs",E()]])}function mb(){return gill.combineCodec(ln(),Zc())}async function Tb(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceTokenAccount.value||(t.sourceTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(K(t.source.value)),gill.getAddressEncoder().encode(K(t.tokenProgram.value)),gill.getAddressEncoder().encode(K(t.mint.value))]})),t.destinationTokenAccount.value||(t.destinationTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(K(t.destination.value)),gill.getAddressEncoder().encode(K(t.tokenProgram.value)),gill.getAddressEncoder().encode(K(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...a],data:ln().encode(c),programAddress:r})}function Xc(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...a],data:ln().encode(c),programAddress:r})}function fb(e){if(e.accounts.length<11)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceTokenAccount:r(),destination:r(),destinationTokenAccount:r(),tokenProgram:r(),mint:r(),systemProgram:r(),associatedTokenProgram:r()},data:Zc().decode(e.data)}}var ea=new Uint8Array([13]);function Mb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ea)}function ta(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())]]),e=>({...e,discriminator:ea}))}function ra(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function Eb(){return gill.combineCodec(ta(),ra())}function na(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:ta().encode(c),programAddress:r})}function hb(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:ra().decode(e.data)}}var ca=new Uint8Array([24]);function Wb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ca)}function aa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["settingsReadonlyArgs",ne()],["compressedProofArgs",M()]]),e=>({...e,discriminator:ca}))}function ia(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["settingsReadonlyArgs",se()],["compressedProofArgs",E()]])}function Lb(){return gill.combineCodec(aa(),ia())}function da(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.rentCollector),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:aa().encode(c),programAddress:r})}function Ob(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:ia().decode(e.data)}}var ga=new Uint8Array([10]);function Gb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ga)}function ya(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Et()],["secp256r1VerifyArgs",gill.getOptionEncoder(B())]]),e=>({...e,discriminator:ga}))}function pa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",ht()],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function Fb(){return gill.combineCodec(ya(),pa())}function ma(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...a],data:ya().encode(c),programAddress:r})}function zb(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:pa().decode(e.data)}}var la=new Uint8Array([21]);function Xb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(la)}function Sa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Et()],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["settingsReadonlyArgs",ne()],["compressedProofArgs",M()]]),e=>({...e,discriminator:la}))}function xa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",ht()],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["settingsReadonlyArgs",se()],["compressedProofArgs",E()]])}function $b(){return gill.combineCodec(Sa(),xa())}function Ia(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...a],data:Sa().encode(c),programAddress:r})}function Qb(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:xa().decode(e.data)}}var Ma=new Uint8Array([14]);function c_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ma)}function Ea(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())]]),e=>({...e,discriminator:Ma}))}function ha(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function a_(){return gill.combineCodec(Ea(),ha())}function Pa(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Ea().encode(c),programAddress:r})}function i_(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:ha().decode(e.data)}}var ba=new Uint8Array([25]);function m_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ba)}function _a(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["settingsReadonlyArgs",ne()],["compressedProofArgs",M()]]),e=>({...e,discriminator:ba}))}function Ua(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["settingsReadonlyArgs",se()],["compressedProofArgs",E()]])}function T_(){return gill.combineCodec(_a(),Ua())}function Wa(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:_a().encode(c),programAddress:r})}function f_(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ua().decode(e.data)}}var Ba=new Uint8Array([12]);function D_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ba)}function wa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:Ba}))}function ka(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function M_(){return gill.combineCodec(wa(),ka())}function Na(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=p({args:c}),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.transactionBuffer),...a],data:wa().encode(c),programAddress:r})}function E_(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),transactionBuffer:r()},data:ka().decode(e.data)}}var Ga=new Uint8Array([23]);function __(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ga)}function Fa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:Ga}))}function za(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["settingsKey",gill.getAddressDecoder()]])}function U_(){return gill.combineCodec(Fa(),za())}function Ka(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=p({args:c}),o=m(r);return Object.freeze({accounts:[o(t.transactionBuffer),...a],data:Fa().encode(c),programAddress:r})}function W_(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{transactionBuffer:r()},data:za().decode(e.data)}}var qa=new Uint8Array([11]);function H_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(qa)}function Ya(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())]]),e=>({...e,discriminator:qa}))}function Za(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function V_(){return gill.combineCodec(Ya(),Za())}function Xa(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Ya().encode(c),programAddress:r})}function G_(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Za().decode(e.data)}}var ei=new Uint8Array([22]);function Y_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ei)}function ti(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["settingsReadonlyArgs",ne()],["compressedProofArgs",M()]]),e=>({...e,discriminator:ei}))}function ri(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["settingsReadonlyArgs",se()],["compressedProofArgs",E()]])}function Z_(){return gill.combineCodec(ti(),ri())}function ni(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:ti().encode(c),programAddress:r})}function X_(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:ri().decode(e.data)}}var ci=new Uint8Array([15]);function nU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ci)}function ai(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:ci}))}function ii(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function sU(){return gill.combineCodec(ai(),ii())}function di(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},i=p({}),a=m(r);return Object.freeze({accounts:[a(t.settings),a(t.payer),a(t.transactionBuffer),...i],data:ai().encode({}),programAddress:r})}function oU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),transactionBuffer:r()},data:ii().decode(e.data)}}var gi=new Uint8Array([26]);function AU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(gi)}function yi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:gi}))}function pi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsKey",gill.getAddressDecoder()]])}function gU(){return gill.combineCodec(yi(),pi())}function mi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=p({args:c}),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.transactionBuffer),...a],data:yi().encode(c),programAddress:r})}function yU(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:pi().decode(e.data)}}var li=new Uint8Array([16]);function xU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(li)}function Si(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",Pt()],["secp256r1VerifyArgs",gill.getArrayEncoder(ee())]]),e=>({...e,discriminator:li}))}function xi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",Rt()],["secp256r1VerifyArgs",gill.getArrayDecoder(te())]])}function IU(){return gill.combineCodec(Si(),xi())}function Ii(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Si().encode(c),programAddress:r})}function CU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:xi().decode(e.data)}}var Mi=new Uint8Array([27]);function vU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Mi)}function Ei(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",Pt()],["secp256r1VerifyArgs",gill.getArrayEncoder(ee())],["settingsReadonlyArgs",ne()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Mi}))}function hi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",Rt()],["secp256r1VerifyArgs",gill.getArrayDecoder(te())],["settingsReadonlyArgs",se()],["compressedProofArgs",E()]])}function bU(){return gill.combineCodec(Ei(),hi())}function Pi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Ei().encode(c),programAddress:r})}function _U(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:hi().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",XS=(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))(XS||{});function TW(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 $S=(f=>(f[f.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",f[f.ChangeConfig=1]="ChangeConfig",f[f.ChangeConfigCompressed=2]="ChangeConfigCompressed",f[f.CompressSettingsAccount=3]="CompressSettingsAccount",f[f.CreateDomainConfig=4]="CreateDomainConfig",f[f.CreateDomainUserAccount=5]="CreateDomainUserAccount",f[f.CreateGlobalCounter=6]="CreateGlobalCounter",f[f.CreateMultiWalletCompressed=7]="CreateMultiWalletCompressed",f[f.CreateUserAccounts=8]="CreateUserAccounts",f[f.DecompressSettingsAccount=9]="DecompressSettingsAccount",f[f.DisableDomainConfig=10]="DisableDomainConfig",f[f.EditDomainConfig=11]="EditDomainConfig",f[f.EditTransactionManagerUrl=12]="EditTransactionManagerUrl",f[f.EditUserDelegate=13]="EditUserDelegate",f[f.MigrateCompressedSettings=14]="MigrateCompressedSettings",f[f.MigrateCompressedUsers=15]="MigrateCompressedUsers",f[f.NativeTransferIntent=16]="NativeTransferIntent",f[f.NativeTransferIntentCompressed=17]="NativeTransferIntentCompressed",f[f.TokenTransferIntent=18]="TokenTransferIntent",f[f.TokenTransferIntentCompressed=19]="TokenTransferIntentCompressed",f[f.TransactionBufferClose=20]="TransactionBufferClose",f[f.TransactionBufferCloseCompressed=21]="TransactionBufferCloseCompressed",f[f.TransactionBufferCreate=22]="TransactionBufferCreate",f[f.TransactionBufferCreateCompressed=23]="TransactionBufferCreateCompressed",f[f.TransactionBufferExecute=24]="TransactionBufferExecute",f[f.TransactionBufferExecuteCompressed=25]="TransactionBufferExecuteCompressed",f[f.TransactionBufferExtend=26]="TransactionBufferExtend",f[f.TransactionBufferExtendCompressed=27]="TransactionBufferExtendCompressed",f[f.TransactionBufferVote=28]="TransactionBufferVote",f[f.TransactionBufferVoteCompressed=29]="TransactionBufferVoteCompressed",f[f.TransactionExecute=30]="TransactionExecute",f[f.TransactionExecuteCompressed=31]="TransactionExecuteCompressed",f[f.TransactionExecuteSync=32]="TransactionExecuteSync",f[f.TransactionExecuteSyncCompressed=33]="TransactionExecuteSyncCompressed",f))($S||{});function fW(e){let n="data"in e?e.data:e;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([8])),0))return 0;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([9])),0))return 1;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([20])),0))return 2;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([17])),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([19])),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([18])),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([7])),0))return 13;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([33])),0))return 14;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([32])),0))return 15;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([30])),0))return 16;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([28])),0))return 17;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([31])),0))return 18;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([29])),0))return 19;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([13])),0))return 20;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([24])),0))return 21;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([10])),0))return 22;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([21])),0))return 23;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([14])),0))return 24;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([25])),0))return 25;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([12])),0))return 26;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([23])),0))return 27;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([11])),0))return 28;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([22])),0))return 29;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([15])),0))return 30;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([26])),0))return 31;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([16])),0))return 32;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([27])),0))return 33;throw new Error("The provided instruction could not be identified as a multiWallet instruction.")}var ex=6e3,tx=6001,rx=6002,nx=6003,sx=6004,ox=6005,cx=6006,ax=6007,ix=6008,dx=6009,ux=6010,Ax=6011,gx=6012,yx=6013,px=6014,mx=6015,Tx=6016,fx=6017,lx=6018,Sx=6019,xx=6020,Ix=6021,Cx=6022,Dx=6023,Mx=6024,Ex=6025,hx=6026,Px=6027,Rx=6028,vx=6029,bx=6030,_x=6031,Ux=6032,Wx=6033,Lx=6034,Ox=6035,Bx=6036,wx=6037,kx=6038,Nx=6039,Hx=6040,Vx=6041,Gx=6042,Fx=6043,zx=6044,Kx=6045,Jx=6046,jx=6047,qx=6048,Yx=6049,Zx=6050,Xx=6051,$x=6052,Qx=6053,Ri;process.env.NODE_ENV!=="production"&&(Ri={[bx]:"This member is already delegated to another wallet.",[ax]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[Yx]:"The domain configuration account is disabled. Please contact support or try again later.",[Zx]:"Missing domain configuration account.",[ux]:"Duplicate public keys detected among members. Each member must have a unique key.",[dx]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[xx]:"No members provided. A multisig wallet must contain at least one member.",[lx]:"Expected a User with Administrator role for this instruction.",[ix]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[Tx]:"Expected a User with Transaction Manager role for this instruction.",[Nx]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[Hx]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[Vx]:"Declared buffer size does not match the actual serialized size.",[Wx]:"Not enough members with vote permission to meet the approval threshold.",[_x]:"At least one signer with execute permission is required to proceed.",[Ux]:"At least one signer with initiate permission is required to perform this action.",[Ex]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[Qx]:"Address Tree supplied is not part of the whitelisted address trees",[Sx]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[Px]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[kx]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[Lx]:"Only delegated members are allowed for this transaction.",[Mx]:"Unexpected number of accounts provided for this instruction.",[yx]:"User with Permanent Member role requires a must have a delegated wallet.",[tx]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[sx]:"The extracted public key has an invalid length or encoding.",[ex]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[nx]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[jx]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[Cx]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[fx]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[mx]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[Dx]:"Malformed transaction message: structure or formatting does not match the expected layout.",[hx]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[ox]:"The extracted WebAuthn signed message payload is malformed.",[Kx]:"An input string exceeds the maximum allowed character length.",[Xx]:"This member is not registered under the provided domain configuration.",[Rx]:"A required account is missing from the instruction context.",[Jx]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[vx]:"User mutation arguments are required when performing add or remove delegate operations.",[Bx]:"No valid signer found in this transaction.",[gx]:"Only one permanent member is allowed per wallet.",[px]:"Only one transaction manager is allowed per wallet.",[$x]:"The given origin index is not in the whitelisted origins.",[Ax]:"Permanent members cannot be removed from a wallet.",[zx]:"Writable CPI calls to protected accounts are not permitted.",[cx]:"The rpIdHash extracted from the signed message does not match the expected value.",[rx]:"The signature index provided is out of bounds for the secp256r1 instruction.",[qx]:"The specified slot number was not found in the provided slot history.",[Ix]:"Too many members: a maximum of 4 members are supported.",[Gx]:"This transaction has expired. It must be executed within 3 minutes of approval.",[Fx]:"This transaction has not yet reached the required approval threshold.",[wx]:"Only the transaction creator or rent payer may close this transaction buffer.",[Ox]:"Member is not part of the expected signers for this transaction."});function DW(e){return process.env.NODE_ENV!=="production"?Ri[e]:"Error message not available in production bundles."}function MW(e,n,r){return gill.isProgramError(e,n,A,r)}var Wt={Ed25519:1,Secp256r1:2};var Ie={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},Me=class e{constructor(n){this.mask=n;}static fromPermissions(n){return new e(n.reduce((r,s)=>r|s,0))}static all(){return new e(Object.values(Ie).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var In=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!==In)throw new Error(`Invalid public key length, expected ${In} 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===In)return n;throw new Error("Invalid public key input")}toBytes(){let n=this.toBuffer();return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}toString(){return this.toBase58()}toJSON(){return this.toBase58()}},C=class extends Ae{verifyArgs;domainConfig;authData;signature;originIndex;crossOrigin;clientAndDeviceHash;authResponse;constructor(n,r){super(n),this.verifyArgs=r.verifyArgs,this.domainConfig=r.domainConfig,this.authData=r.authData,this.signature=r.signature,this.originIndex=r.originIndex,this.crossOrigin=r.crossOrigin,this.clientAndDeviceHash=r.clientAndDeviceHash,this.authResponse=r.authResponse;}};function rI(){return gill.getStructCodec([["programAddressIndex",gill.getU8Codec()],["accountIndices",gill.getArrayCodec(gill.getU8Codec())],["data",gill.getArrayCodec(gill.getU8Codec())]])}function nI(){return gill.getStructCodec([["lookupTableAddress",gill.getAddressCodec()],["writableIndexes",gill.getArrayCodec(gill.getU8Codec())],["readonlyIndexes",gill.getArrayCodec(gill.getU8Codec())]])}var bi=gill.getStructCodec([["numSigners",gill.getU8Codec()],["numWritableSigners",gill.getU8Codec()],["numWritableNonSigners",gill.getU8Codec()],["accountKeys",gill.getArrayCodec(gill.getAddressCodec())],["instructions",gill.getArrayCodec(rI())],["addressTableLookups",gill.getArrayCodec(nI())]]);function _i(e){return bi.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 Ui(e){let n=bi.decode(e);return {header:{numSignerAccounts:n.numSigners,numReadonlySignerAccounts:n.numSigners-n.numWritableSigners,numReadonlyNonSignerAccounts:n.accountKeys.length-n.numSigners-n.numWritableNonSigners},addressTableLookups:n.addressTableLookups.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes.map(Number),writableIndexes:r.writableIndexes.map(Number),readableIndices:r.readonlyIndexes.map(Number),writableIndices:r.writableIndexes.map(Number)})),instructions:n.instructions.map(r=>({accountIndices:r.accountIndices.map(Number),data:new Uint8Array(r.data),programAddressIndex:r.programAddressIndex})),lifetimeToken:A,staticAccounts:n.accountKeys,version:0}}stateless_js.featureFlags.version=stateless_js.VERSION.V2;var Wi="revibase.com",Li="https://auth.revibase.com",Oi="https://api.revibase.com";var Ke=null,wi=2e3,ki=3e3,cI=300*1e3;async function rr({authUrl:e,signer:n,popUp:r=null,data:s}){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");return new Promise((t,c)=>{let i=new URL(e).origin,a=null,o=setInterval(()=>{r&&r.closed&&(u(),c(new Error("User closed the authentication window")));},500),d=setTimeout(()=>{u(),c(new Error("Authentication timed out"));},cI);function u(){clearInterval(o),clearTimeout(d),a&&clearTimeout(a),Ke&&window.removeEventListener("message",Ke),r&&r.close();}if(r?r.location.replace(e):r=Gi(e),!r){c(new Error("Disable your popup blocker to continue."));return}let g=y=>{let T=y.origin===i,l=y.source===r;if(!(!T||!l||!y.isTrusted||!r))switch(y.data.type){case "popup-ready":r.postMessage({type:"popup-init",payload:{signer:n?.toString(),data:s}},i),a=setTimeout(()=>{u(),c(new Error("User closed the authentication window"));},wi+ki);break;case "popup-complete":try{let D=JSON.parse(y.data.payload);u(),t(D);}catch{c(new Error("Failed to parse response payload"));}break;case "popup-heartbeat":a&&(clearTimeout(a),a=setTimeout(()=>{u(),c(new Error("User closed the authentication window"));},wi+ki));break;case "popup-closed":u(),c(new Error("User closed the authentication window"));break}};Ke&&window.removeEventListener("message",Ke),Ke=g,window.addEventListener("message",Ke);})}function nr(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Ne(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,s=n.padEnd(n.length+r,"="),t=atob(s),c=new ArrayBuffer(t.length),i=new Uint8Array(c);for(let a=0;a<t.length;a++)i[a]=t.charCodeAt(a);return c}function sr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function aI(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 Ni(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 Hi(e,n){let r=[],s=0,t=new TextDecoder;for(let c=0;c<n;c++){if(s+2>e.length)throw new Error("MaxLengthExceeded");let i=e[s]|e[s+1]<<8;if(s+=2,s+i>e.length)throw new Error("MaxLengthExceeded");let a=e.slice(s,s+i),o=t.decode(a);r.push(o),s+=i;}return r}function Vi(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 h=n&127;r+=h;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let s=e[r+1],t=r+2,c=e.slice(t,t+s);if(r=t+s,e[r]!==2)throw new Error("Expected INTEGER for s");let i=e[r+1],a=r+2,o=e.slice(a,a+i),d=c[0]===0&&c.length>32?c.slice(1):c,u=o[0]===0&&o.length>32?o.slice(1):o;if(d.length>32||u.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(d,32-d.length);let y=nist_js.p256.Point.CURVE().n>>1n,T=BigInt("0x"+sr(u)),D=(T>y?nist_js.p256.Point.CURVE().n-T:T).toString(16).padStart(64,"0"),x=aI(D);return new Uint8Array([...g,...x])}function Gi(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,i,a;if(s)t=n,c=r,i=0,a=0;else {let u=window.screenLeft??window.screenX,g=window.screenTop??window.screenY,y=window.innerWidth??document.documentElement.clientWidth??screen.width,T=window.innerHeight??document.documentElement.clientHeight??screen.height;t=500,c=600,a=u+(y-t)/2,i=g+(T-c)/2;}let o=[`width=${t}`,`height=${c}`,`top=${i}`,`left=${a}`,"toolbar=no","location=no","status=no","menubar=no","scrollbars=yes","resizable=yes"].join(","),d=window.open(e,"_blank",o);return d&&d.focus(),d}function mL(e){let n=tinyCbor.decodeCBOR(e),r=nist_js.p256.Point.fromAffine({x:BigInt("0x"+sr(n.get(-2))),y:BigInt("0x"+sr(n.get(-3)))});return gill.getBase58Decoder().decode(r.toBytes(true))}function zi(e){let r=nist_js.p256.Point.fromBytes(new Uint8Array(gill.getBase58Encoder().encode(e))).toBytes(false),s=new Map;return s.set(1,2),s.set(3,-7),s.set(-1,1),s.set(-2,r.slice(1,33)),s.set(-3,r.slice(33,65)),new Uint8Array(tinyCbor.encodeCBOR(s))}async function TL(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=new Uint8Array(Ne(n)),c=JSON.parse(new TextDecoder().decode(Ne(r))),i=Ni(c),a=Vi(new Uint8Array(Ne(s))),o=await je({rpIdHash:t.subarray(0,32)});return new C(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(Ne(r)),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(gill.getBase58Encoder().encode(e.slotHash))},clientAndDeviceHash:Mn(e.clientId,e.deviceSignature.publicKey,e.nonce),domainConfig:o,authData:t,signature:a,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}async function fL(e,n){let{data:r}=await Fn(oe(),e),t=Hi(new Uint8Array(r.origins),r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new Error("Origin not found in domain config");return t}function Mn(e,n,r){return sha2_js.sha256(new Uint8Array([...gill.getBase58Encoder().encode(e),...gill.getBase58Encoder().encode(n),...new TextEncoder().encode(r)]))}function Je(e){return sha2_js.sha256(En(e))}function En(e){return new Uint8Array([...new Uint8Array(Ne(e.response.authenticatorData)),...sha2_js.sha256(new Uint8Array(Ne(e.response.clientDataJSON)))])}async function Pn(e,n=false){let r=n?{blockhash:gill.getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await oe().getLatestBlockhash().send()).value;return await Promise.all(e.map(async s=>await gill.pipe(gill.createTransactionMessage({version:0}),c=>gill.appendTransactionMessageInstructions(s.instructions,c),c=>gill.setTransactionMessageFeePayerSigner(s.payer,c),c=>gill.setTransactionMessageLifetimeUsingBlockhash(r,c),c=>s.addressesByLookupTableAddress?gill.compressTransactionMessageUsingAddressLookupTables(c,s.addressesByLookupTableAddress):c,async c=>{let i=Math.ceil((s.unitsConsumed??0)*1.1)||8e5;return i>2e5?gill.prependTransactionMessageInstructions([programs.getSetComputeUnitLimitInstruction({units:i})],c):c},async c=>n?gill.compileTransaction(await c):await gill.signTransactionMessageWithSigners(await c))))}async function ji(e,n){let s=(await e.getRecentPrioritizationFees(n.filter(c=>c.role===gill.AccountRole.WRITABLE||c.role===gill.AccountRole.WRITABLE_SIGNER).map(c=>c.address)).send()).map(c=>Number(c.prioritizationFee));s.sort((c,i)=>c-i);let t=Math.floor(s.length/2);return s.length%2===0?Math.round((s[t-1]+s[t])/2):s[t]}async function qi(e,n){if(e.length===0)throw new Error("Bundle is empty.");for(let c=0;c<e.length;c++){if(e[c].length>1644)throw new Error(`Transaction ${c} exceeds maximum length, ${e[c].length}. Retry again.`);console.log(`Transaction ${c} length: ${e[c].length}`);}let r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:"2",method:"simulateBundle",params:[{encodedTransactions:e},{skipSigVerify:true,replaceRecentBlockhash:true,preExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]})),postExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]}))}]})});if(!r.ok)throw console.error(await r.json()),new Error("Failed to simulate bundle");let{result:s,error:t}=await r.json();if(!s||t)throw console.error(t??s),new Error(`Unable to simulate bundle: ${JSON.stringify(t??s)}`);if(typeof s.value.summary!="string"&&s.value.summary.failed){let{TransactionFailure:c}=s.value.summary.failed.error,[,i]=c;throw console.error(t??s),new Error(`Simulation failed: ${i}`)}return s.value.transactionResults.map(c=>c.unitsConsumed)}function G(e,n=0){let r=e instanceof C?e:void 0,s=r?.verifyArgs&&n!==-1?gill.some({signedMessageIndex:n,truncatedClientDataJson:r.verifyArgs.truncatedClientDataJson,slotNumber:r.verifyArgs.slotNumber,originIndex:r.originIndex,crossOrigin:r.crossOrigin,clientAndDeviceHash:r.clientAndDeviceHash}):null,t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,i=r?.authData&&r.verifyArgs?.clientDataJson?En(r.authResponse):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:i,publicKey:a}}function qe(e){if(e instanceof Ae)return {keyType:Wt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:Wt.Ed25519,key:new Uint8Array([0,...gill.getAddressEncoder().encode(n)])}}}function Ji(e){return e instanceof C?e.toString():e.address.toString()}function ge(e){let n=new Set,r=[];for(let s of e)n.has(Ji(s))||(r.push(s),n.add(Ji(s)));if(r.filter(s=>s instanceof C).length>1)throw new Error("More than 1 Secp256r1 signers in an instruction is not supported.");return r}function Yi({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 Zi(e){let n=await fetch(`${e}/getRandomPayer`),{randomPayer:r}=await n.json();return {address:gill.address(r),async signTransactions(s){let t={publicKey:r,transactions:s.map(a=>gill.getBase64Decoder().decode(gill.getTransactionEncoder().encode(a)))},i=await(await fetch(`${e}/sign`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).json();if("error"in i)throw new Error(i.error);return i.signatures.map(a=>({[gill.address(r)]:gill.getBase58Encoder().encode(a)}))}}}var _={};function Ye(){if(!_.solanaRpcEndpoint)throw new Error("Rpc is not initialized yet.");return _.solanaRpcEndpoint}function He(){if(!_.lightProtocolRpc)throw new Error("Rpc is not initialized yet");return _.lightProtocolRpc}function oe(){if(!_.solanaRpc)throw new Error("Rpc is not initialized yet");return _.solanaRpc}function Xi(){if(!_.sendAndConfirm)throw new Error("Rpc is not initialized yet.");return _.sendAndConfirm}function $i(){if(!_.computeEstimate)throw new Error("Rpc is not initialized yet");return _.computeEstimate}async function WL(){return _.feePayer||(_.feePayer=await Zi(_.apiEndpoint??Oi)),_.feePayer}function Rn(){if(!_.jitoTipsConfig)throw new Error("Jito Bundle Config is not set.");return _.jitoTipsConfig}function he(){return _.authEndpoint??Li}function Qi(){return _.rpId??Wi}function Ze(){if(!_.clientSettings)throw new Error("No client settings found.");return _.clientSettings}function LL(){Object.keys(_).forEach(e=>{_[e]=void 0;});}function OL({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s,apiEndpoint:t,authEndpoint:c,rpId:i,clientSettings:a}){_.solanaRpcEndpoint=e,_.lightProtocolRpc=stateless_js.createRpc(e,r,n);let{rpc:o,sendAndConfirmTransaction:d}=gill.createSolanaClient({urlOrMoniker:e});_.solanaRpc=o,_.sendAndConfirm=d,_.computeEstimate=programs.estimateComputeUnitLimitFactory({rpc:o}),_.apiEndpoint=t??null,_.jitoTipsConfig=s??null,_.authEndpoint=c??null,_.rpId=i??null,_.clientSettings=a??null;}var U=class{preAccounts;systemAccounts;nextIndex;map;outputTreeIndex;constructor(){this.preAccounts=[],this.systemAccounts=[],this.nextIndex=0,this.map=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){this.preAccounts.push(...n);}getAccountRole(n,r){return n?r?gill.AccountRole.WRITABLE_SIGNER:gill.AccountRole.READONLY_SIGNER:r?gill.AccountRole.WRITABLE:gill.AccountRole.READONLY}async addSystemAccounts(){this.systemAccounts.push(...stateless_js.getLightSystemAccountMetasV2({selfProgram:new web3_js.PublicKey(A.toString())}).map(n=>({address:gill.address(n.pubkey.toString()),role:this.getAccountRole(n.isSigner,n.isWritable)})));}insertOrGet(n){return this.insertOrGetConfig(n,gill.AccountRole.WRITABLE)}insertOrGetConfig(n,r){if(!this.map.has(n)){let s=this.nextIndex++,t={address:gill.address(n),role:r};this.map.set(n,{index:s,accountMeta:t});}return this.map.get(n).index}packOutputTreeIndex(n){if(n.treeType===stateless_js.TreeType.StateV1)return this.insertOrGet(n.tree.toString());if(n.treeType===stateless_js.TreeType.StateV2)return this.insertOrGet(n.queue.toString());throw new Error("Tree type not supported")}async getOutputTreeIndex(){if(this.outputTreeIndex!==-1)return this.outputTreeIndex;let n=Ye().includes("devnet")?stateless_js.localTestActiveStateTreeInfos():await He().getStateTreeInfos(),r=stateless_js.selectStateTreeInfo(n);return this.packOutputTreeIndex(r)}packTreeInfos(n,r){let s=[],t=[];for(let c of n){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());s.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:i,queuePubkeyIndex:a,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let o=c.treeInfo.nextTreeInfo??c.treeInfo,d=this.packOutputTreeIndex(o);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let c of r){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:i,addressQueuePubkeyIndex:a});}return {stateTrees:s.length>0?{packedTreeInfos:s,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(){return Array.from(this.map.entries()).sort((r,s)=>r[1].index-s[1].index).map(([,{accountMeta:r}])=>({...r}))}getOffsets(){let n=this.preAccounts.length,r=n+this.systemAccounts.length;return [n,r]}toAccountMetas(){let n=this.hashSetAccountsToMetas(),[r,s]=this.getOffsets();return {remainingAccounts:[...this.preAccounts,...this.systemAccounts,...n],systemOffset:r,packedOffset:s}}};async function cr(e,n){let r=n?.get(e.toString());if(r)return r;{let s=await rd(e);return s&&n?.set(e.toString(),s),s}}async function ce(e,n){let s=(await Promise.all(e.map(async t=>cr(t.address,n)))).filter(t=>t!==null).filter(t=>t.data!==null&&t.address!==null);if(s.length!==e.length)throw new Error("Unable to find compressed account.");return s.map((t,c)=>({...t,type:e[c].type,tree:t.treeInfo.tree,queue:t.treeInfo.queue}))}function b(e,n){return {proof:e?.compressedProof?gill.some({a:new Uint8Array(e.compressedProof.a),b:new Uint8Array(e.compressedProof.b),c:new Uint8Array(e.compressedProof.c)}):null,lightCpiAccountsStartIndex:n}}async function ae(e,n,r,s,t){if(t.length===0)return [];let c=t.map((d,u)=>({treeInfo:n[u],root:r[u],rootIndex:s[u],address:d.address.toArray()})),{addressTrees:i}=e.packTreeInfos([],c),a=await e.getOutputTreeIndex();return t.map((d,u)=>({addressTreeInfo:i[u],outputStateTreeIndex:a,address:d.address,type:d.type}))}function Y(e,n,r,s,t,c,i){let a=[];for(let u=0;u<n.length;u++)a.push({treeInfo:n[u],rootIndex:s[u],leafIndex:r[u],proveByIndex:t[u],hash:c[u].hash});let o=e.packTreeInfos(a,[]).stateTrees;if(!o)throw new Error("Unable to parsed data.");return c.map((u,g)=>({data:i.decode(u.data.data),accountMeta:{treeInfo:o.packedTreeInfos[g],address:new Uint8Array(u.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function fe(e,n,r,s,t){let c=null,i=null,a=new U;if(e){await a.addSystemAccounts();let{address:o}=await j(n,r),d=(await ce([{address:o,type:"Settings"}],t))[0];s?i={rootIndices:[0],roots:[],leafIndices:[d.leafIndex],leaves:[],treeInfos:[d.treeInfo],proveByIndices:[d.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:i=await k([d],[]);let u=a.packTreeInfos([{treeInfo:i.treeInfos[0],rootIndex:i.rootIndices[0],leafIndex:i.leafIndices[0],proveByIndex:i.proveByIndices[0],hash:d.hash}],[]).stateTrees;if(!u)throw new Error("Unable to parsed data.");c={accountMeta:{address:new Uint8Array(d.address),treeInfo:u.packedTreeInfos[0]},data:z().decode(d.data?.data)};}return {settingsReadonlyArgs:c,proof:i,packedAccounts:a}}async function k(e,n,r=10,s=400){let t=1;for(;t<r;)try{return await He().getValidityProofV0(e,n)}catch(c){if(console.error(`Attempt ${t}, Get Validity Proof failed. ${c}`),t++,t>=r)throw new Error(`Failed to get validity proof after ${r} attempts: ${c}`);await new Promise(i=>setTimeout(i,s));}throw new Error(`Failed to get validity proof after ${r} attempts`)}async function le(){return (await ar()).length-1}var vn;async function ar(){if(!vn){let{data:e}=await Ks(oe(),await nd());vn=e.whitelistedAddressTrees;}return vn}async function ir(e,n,r){let s=await qI(e,n,r);if(!s)throw new Error("User cannot be found.");return s}async function qI(e,n,r){let{address:s}=await N(e,n),t=await cr(s,r);return t?.data?.data?J().decode(t.data.data):null}async function Ot(e,n,r){let s=await YI(e,n,r);if(!s)throw new Error("Settings cannot be found.");return s}async function YI(e,n,r){try{let{address:s}=await j(e,n),t=await cr(s,r);if(!t?.data?.data)throw new Error("No compressed settings account found.");let c=z().decode(t.data.data);if(c.data.__option==="None")throw new Error("No compressed settings account found.");return {...c.data.value,isCompressed:!0}}catch{let s=await jr(oe(),await Z(e));return s.exists?{...s.data,members:s.data.members.slice(0,s.data.membersLen),isCompressed:false}:null}}async function bn(e){let n=await ar();if(e<0||e>=n.length)throw new Error(`Invalid address tree index: ${e}`);return n[e]}async function aO(e){let r=(await ar()).findIndex(s=>s===e);if(r===-1)throw new Error(`Address tree not found: ${e}`);return r}async function rd(e){let n=await stateless_js.rpcRequest(He().compressionApiEndpoint,stateless_js.versionedEndpoint("getCompressedAccount"),{hash:void 0,address:e?stateless_js.encodeBN254toBase58(e):void 0}),r;if(stateless_js.featureFlags.isV2()?r=superstruct.create(n,stateless_js.jsonRpcResultAndContext(superstruct.nullable(stateless_js.CompressedAccountResultV2))):r=superstruct.create(n,stateless_js.jsonRpcResultAndContext(superstruct.nullable(stateless_js.CompressedAccountResult))),"error"in r)throw new web3_js.SolanaJSONRPCError(r.error,`failed to get info for compressed account ${e?e.toString():""}`);if(r.result.value===null)return null;let s=stateless_js.featureFlags.isV2()?r.result.value.merkleContext.tree:r.result.value.tree,t=Ye().includes("devnet")?stateless_js.localTestActiveStateTreeInfos():await He().getStateTreeInfos(),c=stateless_js.getStateTreeInfoByPubkey(t,s),i=r.result.value;return stateless_js.createCompressedAccountWithMerkleContextLegacy(stateless_js.createMerkleContextLegacy(c,i.hash,i.leafIndex),i.owner,stateless_js.bn(i.lamports),i.data?stateless_js.parseAccountData(i.data):void 0,i.address||void 0)}async function j(e,n=0){let r=await bn(n),s=stateless_js.deriveAddressSeedV2([new Uint8Array(gill.getUtf8Encoder().encode("multi_wallet")),new Uint8Array(gill.getU128Encoder().encode(e))]);return {address:stateless_js.createBN254(stateless_js.deriveAddressV2(s,new web3_js.PublicKey(r),new web3_js.PublicKey(A)).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function N(e,n=0){let r=await bn(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(A.toString())).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function je({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha2_js.sha256(new Uint8Array(gill.getUtf8Encoder().encode(n)));else throw new Error("RpId not found.");if(!e)throw new Error("RpIdHash not found.");let[r]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("domain_config"),e]});return r}async function gd(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("global_counter")]});return e}async function nd(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function yd(e,n,r){if(r>255)throw new Error("Index cannot be greater than 255.");let[s]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("transaction_buffer"),n instanceof Ae?n.toTruncatedBuffer():gill.getAddressEncoder().encode(n),gill.getU8Encoder().encode(r)]});return s}async function Ce(e){let[n]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("vault")]});return n}async function Z(e){let[n]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getU128Encoder().encode(e)]});return n}async function pd(e){let n=await Z(e);return await Ce(n)}async function TO(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("cpi_authority")]});return e}async function vO(e){let n=await Pn(e,true),r=await qi(n.map(gill.getBase64EncodedWireTransaction),Ye()),s=await Pn(e.map((c,i)=>({...c,unitsConsumed:r[i]})));return await AC(s.map(gill.getBase64EncodedWireTransaction))}async function bO({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await oe().getLatestBlockhash().send(),t=await gill.pipe(gill.createTransactionMessage({version:0}),c=>gill.appendTransactionMessageInstructions([...e],c),c=>gill.setTransactionMessageFeePayerSigner(n,c),c=>gill.setTransactionMessageLifetimeUsingBlockhash(s.value,c),c=>r?gill.compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[i,a]=await Promise.all([$i()(c),ji(oe(),c.instructions.flatMap(d=>d.accounts??[]))]),o=Math.ceil(i*1.1);return gill.prependTransactionMessageInstructions([...o>2e5?[programs.getSetComputeUnitLimitInstruction({units:o})]:[],...a>0?[programs.getSetComputeUnitPriceInstruction({microLamports:a})]:[]],c)},async c=>await gill.signTransactionMessageWithSigners(await c));return await Xi()(t,{commitment:"confirmed",skipPreflight:true}),gill.getSignatureFromTransaction(t)}async function AC(e,n=10,r=1e3,s=Rn()){let{blockEngineUrl:t}=s;for(let c=1;c<=n;c++){let i=await fetch(`${t}/bundles`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"sendBundle",params:[e,{encoding:"base64"}]})});if(i.status===429&&c<n){await new Promise(o=>setTimeout(o,r));continue}let a=await i.json();if(a.error)throw new Error(`Error sending bundles: ${JSON.stringify(a.error,null,2)}`);return a.result}throw new Error("Failed to send bundle after retries.")}async function _O(e,n=30,r=3e3,s=Rn()){let{blockEngineUrl:t}=s;for(let c=1;c<=n;c++){let i=await fetch(`${t}/getBundleStatuses`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});if(i.status===429&&c<n){await new Promise(d=>setTimeout(d,r));continue}let a=await i.json();if(a.error)throw new Error(`Error sending bundles: ${JSON.stringify(a.error,null,2)}`);let o=a.result;if(o.value.length){let d=o.value[0];if(d.confirmation_status==="confirmed"||d.confirmation_status==="finalized")return d.transactions[d.transactions.length-1]}if(c<n){await new Promise(d=>setTimeout(d,r));continue}}throw new Error("Failed to get bundle status after retries.")}async function UO(e,n,r,s){let t=await Ot(n,r,s);if(t.threshold>1)throw new Error("Multi-signature transactions with threshold > 1 are not supported yet.");let{permissions:c}=t.members.find(u=>fd(u.pubkey)===e.toString())??{};if(!c)throw new Error("No permissions found for the current member.");let i=Me.has(c,Ie.InitiateTransaction),a=Me.has(c,Ie.VoteTransaction),o=Me.has(c,Ie.ExecuteTransaction);if(i&&a&&o)return {};if(!a||!o)throw new Error("Signer lacks the required Vote/Execute permissions.");let d=t.members.find(u=>u.role===2);if(!d)throw new Error("No transaction manager available in wallet.");return {transactionManagerAddress:gill.address(fd(d.pubkey)),userAddressTreeIndex:d.userAddressTreeIndex}}async function WO({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await ir(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new Error("Transaction manager endpoint is missing for this account.");return gC(n,c.transactionManagerUrl.value,e,s)}function gC(e,n,r,s){return {address:e,async signTransactions(t){let c={publicKey:e.toString(),transactions:t.map(gill.getBase64EncodedWireTransaction)};if(s&&(c.transactionMessageBytes=gill.getBase64Decoder().decode(s)),r){let{clientId:o,signClientMessage:d}=Ze();c.authResponses=await Promise.all(r.map(async u=>({...u,clientSignature:{clientId:o,signature:(await d("complete",gill.getBase64Decoder().decode(Je(u.authResponse)))).signature}})));}let a=await(await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})).json();if("error"in a)throw new Error(a.error);return a.signatures.map(o=>({[e]:gill.getBase58Encoder().encode(o)}))}}}function fd(e){return e.keyType===Wt.Ed25519?gill.getBase58Decoder().decode(e.key.subarray(1,33)):gill.getBase58Decoder().decode(e.key)}async function $O({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,payer:s,compressed:t=false,cachedAccounts:c}){let i=await fC(r),a=new U,o=null,d=null,u=[];if(i.length||t){let h=await lC({packedAccounts:a,userAccounts:i,compressed:t,index:e,settingsAddressTreeIndex:n,cachedAccounts:c});o=h.proof,d=h.settingsMutArgs??null,u=h.userMutArgs??[];}let{configActions:g,secp256r1VerifyInput:y}=await SC({configActionsArgs:r,packedAccounts:a,userMutArgs:u,index:e}),{remainingAccounts:T,systemOffset:l}=a.toAccountMetas(),D=b(o,l);return {instructions:t?[uo({configActions:g,payer:s,authority:gill.createNoopSigner(await pd(e)),compressedProofArgs:D,settingsMut:d,remainingAccounts:T})]:[await no({settingsIndex:e,configActions:g,payer:s,compressedProofArgs:D,remainingAccounts:T})],secp256r1VerifyInput:y}}async function fC(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let s=await Promise.all(r.members.map(t=>N(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}case "RemoveMembers":{let s=await Promise.all(r.members.map(t=>N(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}}return n}async function lC({packedAccounts:e,userAccounts:n,compressed:r,index:s,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let i=[];if(r){let T=(await j(s,t)).address;i.push({address:T,type:"Settings"});}n.length&&i.push(...n);let a=i.length?await ce(i,c):[];if(!a.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let o=await k(a,[]),d=[],u=[];for(let T of a)T.type==="Settings"?d.push(T):T.type==="User"&&u.push(T);let g,y=[];if(r&&o&&(g=Y(e,o.treeInfos.slice(0,1),o.leafIndices.slice(0,1),o.rootIndices.slice(0,1),o.proveByIndices.slice(0,1),d,z())[0]),u.length&&o){let T=r?1:0;y=Y(e,o.treeInfos.slice(T),o.leafIndices.slice(T),o.rootIndices.slice(T),o.proveByIndices.slice(T),u,J());}return {proof:o,settingsMutArgs:g,userMutArgs:y}}async function SC({index:e,configActionsArgs:n,packedAccounts:r,userMutArgs:s}){let t=[],c=[];for(let i of n)switch(i.type){case "AddMembers":{let a=[];for(let o of i.members)if(o.member instanceof C){let d=t.length,{message:u,signature:g,publicKey:y,domainConfig:T}=G(o.member,d);u&&g&&y&&t.push({message:u,signature:g,publicKey:y}),T&&r.addPreAccounts([{address:T,role:gill.AccountRole.READONLY}]);let l=await N(o.member,o.userAddressTreeIndex).then(D=>s.find(x=>new Un__default.default(new Uint8Array(x.accountMeta.address)).eq(D.address)));if(!l)throw new Error("Unable to find user account");a.push(ld({permissionArgs:o.permissions,index:d,userMutArgs:l,pubkey:o.member}));}else {let d=await N(o.member,o.userAddressTreeIndex).then(u=>s.find(g=>new Un__default.default(new Uint8Array(g.accountMeta.address)).eq(u.address)));if(!d)throw new Error("Unable to find user account");a.push(ld({permissionArgs:o.permissions,index:-1,userMutArgs:d,pubkey:o.member}));}c.push({__kind:i.type,fields:[a]});break}case "RemoveMembers":{let a=await Promise.all(i.members.map(o=>N(o.member,o.userAddressTreeIndex).then(d=>{let u=s.find(g=>new Un__default.default(new Uint8Array(g.accountMeta.address)).eq(d.address));if(!u)throw new Error("Unable to find user account");return IC({pubkey:o.member,userMutArgs:u,index:e})})));c.push({__kind:i.type,fields:[a]});break}case "EditPermissions":{let a=i.members.map(o=>xC({permissionArgs:o.permissions,pubkey:o.member}));c.push({__kind:i.type,fields:[a]});break}default:c.push({__kind:i.type,fields:[i.threshold]});}return {configActions:c,secp256r1VerifyInput:t}}function xC({pubkey:e,permissionArgs:n}){return {memberKey:qe(e),permissions:Sd(n)}}function IC({pubkey:e,userMutArgs:n,index:r}){if(n.data.role===1)throw new Error("Permanent Member cannot be removed from the wallet.");let s=n.data.delegatedTo.__option==="Some"?Number(n.data.delegatedTo.value.index.toString())===r:false;return {memberKey:qe(e),userArgs:s?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function ld({pubkey:e,permissionArgs:n,index:r,userMutArgs:s}){if(s.data.role===1){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&&(n.execute||n.vote))throw new Error("Transaction Manager can only have initiate permission");return {memberKey:qe(e),permissions:Sd(n),verifyArgs:e instanceof C&&e.verifyArgs&&r!==-1?gill.some({truncatedClientDataJson:e.verifyArgs.truncatedClientDataJson,slotNumber:e.verifyArgs.slotNumber,signedMessageIndex:r,originIndex:e.originIndex,crossOrigin:e.crossOrigin,clientAndDeviceHash:e.clientAndDeviceHash}):gill.none(),userArgs:s.data.role===1?{__kind:"Mutate",fields:[s]}:{__kind:"Read",fields:[s]}}}function Sd(e){let n=[];return e.initiate&&n.push(Ie.InitiateTransaction),e.vote&&n.push(Ie.VoteTransaction),e.execute&&n.push(Ie.ExecuteTransaction),Me.fromPermissions(n)}var $e=33,Qe=64,Bn=14,RC=2,vC=gill.address("Secp256r1SigVerify1111111111111111111111111");function bC(){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 _C(){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 Dd(){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=_C();for(let a=0;a<r;a++)t.push(c.decode(e,n)),n+=Bn;let i=[];for(let a=0;a<r;a++){let o=gill.fixDecoderSize(gill.getBytesDecoder(),$e).decode(e,n);n+=$e;let d=gill.fixDecoderSize(gill.getBytesDecoder(),Qe).decode(e,n);n+=Qe;let u=t[a].messageDataSize,g=gill.fixDecoderSize(gill.getBytesDecoder(),u).decode(e,n);n+=u,i.push({publicKey:o,signature:d,message:g});}return [{numSignatures:r,padding:s,offsets:t,payload:i},n]}})}function Md(){return gill.createEncoder({getSizeFromValue:e=>{let n=Bn*e.offsets.length,r=e.payload.reduce((s,t)=>s+$e+Qe+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=bC();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=gill.fixEncoderSize(gill.getBytesEncoder(),$e).write(t.publicKey,n,r),r=gill.fixEncoderSize(gill.getBytesEncoder(),Qe).write(t.signature,n,r),r=gill.getBytesEncoder().write(t.message,n,r);return r}})}function tB(){return gill.combineCodec(Md(),Dd())}function F(e,n){let r=e.length,s=RC+r*Bn,t=[];for(let o=0;o<r;o++){let{message:d}=e[o],u=s,g=u+$e,y=g+Qe;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:y,messageDataSize:d.length,messageInstructionIndex:65535}),s+=$e+Qe+d.length;}let c=n?.programAddress??vC,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:Md().encode(i)}}function rB(e){return {programAddress:e.programAddress,accounts:{},data:Dd().decode(e.data)}}async function gB({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let c=new U;await c.addSystemAccounts();let i=await Z(e),{address:a}=await j(e,n),o=await ce([{address:a,type:"Settings"}],t),d=await k(o,[]),u=Y(c,d.treeInfos,d.leafIndices,d.rootIndices,d.proveByIndices,o.filter(S=>S.type==="Settings"),z())[0],g=ge(s),y=g.filter(S=>S instanceof C),T=[],l=[];for(let S of y){let L=T.length,{domainConfig:W,verifyArgs:q,signature:H,publicKey:V,message:O}=G(S,L);O&&H&&V&&T.push({message:O,signature:H,publicKey:V}),W&&(c.addPreAccounts([{address:W,role:gill.AccountRole.READONLY}]),q?.__option==="Some"&&l.push({domainConfigKey:W,verifyArgs:q.value}));}c.addPreAccounts(g.filter(S=>"address"in S).map(S=>({address:S.address,role:gill.AccountRole.READONLY_SIGNER,signer:S})));let{remainingAccounts:D,systemOffset:x}=c.toAccountMetas(),h=b(d,x),I=[];return T.length>0&&I.push(F(T)),I.push(To({settings:i,settingsMutArgs:u,compressedProofArgs:h,payer:r,secp256r1VerifyArgs:l,remainingAccounts:D})),I}async function mB({admin:e,addressTree:n}){return Xs({payer:e,addressTree:n,remainingAccounts:[]})}async function CB({payer:e,rpId:n,origins:r,authority:s}){let t=await je({rpId:n}),c=new U;await c.addSystemAccounts();let i=await le(),{address:a,addressTree:o}=await N(s.address,i),d=[{address:a,tree:o,queue:o,type:"User"}],u=await k([],d),g=(await ae(c,u.treeInfos,u.roots,u.rootIndices,d))[0],{remainingAccounts:y,systemOffset:T}=c.toAccountMetas(),l=b(u,T);return await ho({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:l,payer:e,domainConfig:t,rpId:n,remainingAccounts:y})}async function UB({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new U;await c.addSystemAccounts();let i=[];r.index&&(i.push({address:(await j(r.index,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&i.push({address:(await N(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let a=i.length?await ce(i,t):[],o=await le(),{address:d,addressTree:u}=await N(r.member,o),g=[{address:d,type:"User",tree:u,queue:u}],y=await k(a,g),T=null,l=null,D=a.filter(W=>W.type==="Settings"),x=a.filter(W=>W.type==="User");D.length&&(T=Y(c,y.treeInfos.slice(0,1),y.leafIndices.slice(0,1),y.rootIndices.slice(0,1),y.proveByIndices.slice(0,1),D,z())[0]),x.length&&(l=Y(c,y.treeInfos.slice(1,2),y.leafIndices.slice(1,2),y.rootIndices.slice(1,2),y.proveByIndices.slice(1,2),x,J())[0]);let h=await ae(c,y.treeInfos.slice(a.length),y.roots.slice(a.length),y.rootIndices.slice(a.length),g),{remainingAccounts:I,systemOffset:S}=c.toAccountMetas(),L=b(y,S);return await bo({payer:n,authority:e,compressedProofArgs:L,member:xt().decode(r.member.toBuffer()),role:r.role,linkWalletArgs:T?gill.some({settingsMutArgs:T,transactionManager:l?gill.some(l):gill.none()}):gill.none(),userAccountCreationArgs:h[0],domainConfig:s,remainingAccounts:I})}async function BB({payer:e}){let n=await gd();return Lo({payer:e,globalCounter:n})}async function FB({createUserArgs:e,payer:n}){let r=new U;await r.addSystemAccounts(),r.addPreAccounts(e.map(u=>({address:u.member.address,role:gill.AccountRole.READONLY_SIGNER,signer:u.member})));let s=await le(),t=await Promise.all(e.map(async u=>{let{address:g,addressTree:y}=await N(u.member.address,s);return {address:g,tree:y,queue:y,type:"User"}})),c=await k([],t),i=await ae(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:a,systemOffset:o}=r.toAccountMetas(),d=b(c,o);return await Fo({compressedProofArgs:d,payer:n,createUserArgs:e.map((u,g)=>({member:u.member.address,role:u.role,userCreationArgs:i[g],transactionManagerUrl:u.role===2?u.transactionManagerUrl:null})),remainingAccounts:a})}async function jB({admin:e,rpId:n,disable:r}){let s=await je({rpId:n});return tc({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function ew({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,c=[];if(r){let i=new U;await i.addSystemAccounts();let a=await le(),{address:o,addressTree:d}=await N(r.address,a),u=[{address:o,tree:d,queue:d,type:"User"}],g=await k([],u),y=(await ae(i,g.treeInfos,g.roots,g.rootIndices,u))[0],T=i.toAccountMetas();c=T.remainingAccounts,t={compressedProofArgs:b(g,T.systemOffset),authorityCreationArgs:y};}return ac({domainConfig:n,authority:e,newOrigins:s?gill.some(s):gill.none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function cw({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new U;await s.addSystemAccounts();let t=await ce([{address:(await N(e.address,n)).address,type:"User"}]),c=await k(t,[]),i=Y(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,J())[0],{remainingAccounts:a,systemOffset:o}=s.toAccountMetas(),d=b(c,o);return yc({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function Tw({payer:e,user:n,userAddressTreeIndex:r,newDelegate:s,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:i,message:a,signature:o,publicKey:d}=G(n),u=[];a&&o&&d&&u.push({message:a,signature:o,publicKey:d});let g=await ir(n instanceof C?n:n.address,r,t),y=[];y.push({address:(await N(n instanceof C?n:n.address,r)).address,type:"User"});let T,l=null,D,x=null;g.delegatedTo.__option==="Some"&&((await Ot(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex,t)).isCompressed?(y.push({address:(await j(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex)).address,type:"Settings"}),l={start:y.length-1,end:y.length}):T=await Z(g.delegatedTo.value.index)),s&&((await Ot(s.index,s.settingsAddressTreeIndex,t)).isCompressed?(y.push({address:(await j(s.index,s.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:y.length-1,end:y.length}):D=await Z(s.index));let h=new U;await h.addSystemAccounts();let I=await ce(y,t),S=await k(I,[]),L=Y(h,S.treeInfos.slice(0,1),S.leafIndices.slice(0,1),S.rootIndices.slice(0,1),S.proveByIndices.slice(0,1),I.slice(0,1),J())[0],W=l?gill.some(Y(h,S.treeInfos.slice(l.start,l.end),S.leafIndices.slice(l.start,l.end),S.rootIndices.slice(l.start,l.end),S.proveByIndices.slice(l.start,l.end),I.slice(l.start,l.end),z())[0]):gill.none(),q=x?gill.some(Y(h,S.treeInfos.slice(x.start,x.end),S.leafIndices.slice(x.start,x.end),S.rootIndices.slice(x.start,x.end),S.proveByIndices.slice(x.start,x.end),I.slice(x.start,x.end),z())[0]):gill.none(),{remainingAccounts:H,systemOffset:V}=h.toAccountMetas(),O=b(S,V),re=[];return u.length>0&&re.push(F(u)),re.push(Sc({secp256r1VerifyArgs:i,domainConfig:c,delegateTo:s?gill.some(s):gill.none(),feePayer:e,signer:n instanceof C?void 0:n,oldSettings:T,oldSettingsMutArgs:W,newSettings:D,newSettingsMutArgs:q,compressedProofArgs:O,userMutArgs:L,remainingAccounts:H})),re}async function Dw({args:e,authority:n,index:r,settingsAddressTreeIndex:s}){let t=new U;await t.addSystemAccounts();let{address:c,addressTree:i}=await j(r,s),a=[{address:c,tree:i,queue:i,type:"Settings"}],o=await k([],a),d=(await ae(t,o.treeInfos,o.roots,o.rootIndices,a))[0],{remainingAccounts:u,systemOffset:g}=t.toAccountMetas(),y=b(o,g);return Ec({compressedProofArgs:y,args:e,authority:n,settingsCreationArgs:d,remainingAccounts:u})}async function bw({args:e,authority:n,member:r,userAddressTreeIndex:s}){let t=new U;await t.addSystemAccounts();let{address:c,addressTree:i}=await N(r,s),a=[{address:c,tree:i,queue:i,type:"User"}],o=await k([],a),d=(await ae(t,o.treeInfos,o.roots,o.rootIndices,a))[0],{remainingAccounts:u,systemOffset:g}=t.toAccountMetas(),y=b(o,g);return _c({compressedProofArgs:y,args:e,authority:n,userCreationArgs:d,remainingAccounts:u})}async function $w({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,cachedAccounts:t}){let{domainConfig:c,verifyArgs:i,message:a,signature:o,publicKey:d}=G(r),u=[];a&&o&&d&&u.push({message:a,signature:o,publicKey:d});let g=new U;await g.addSystemAccounts();let y=[],T=[];T.push(...await ce([{address:(await N("address"in r?r.address:r,s)).address,type:"User"}],t));let l=await le(),{address:D,addressTree:x}=await j(e,l);y.push({address:D,queue:x,tree:x,type:"Settings"});let h=T.length,I=await k(T,y),S=Y(g,I.treeInfos.slice(0,h),I.leafIndices.slice(0,h),I.rootIndices.slice(0,h),I.proveByIndices.slice(0,h),T.filter(re=>re.type==="User"),J())[0],W=(await ae(g,I.treeInfos.slice(h),I.roots.slice(h),I.rootIndices.slice(h),y)).find(re=>re.type==="Settings")??null;c?g.addPreAccounts([{address:c,role:gill.AccountRole.READONLY}]):"address"in r&&g.addPreAccounts([{address:r.address,role:gill.AccountRole.READONLY_SIGNER,signer:r}]);let{remainingAccounts:q,systemOffset:H}=g.toAccountMetas(),V=b(I,H),O=[];if(!W)throw new Error("Settings creation args is missing.");return u.length>0&&O.push(F(u)),O.push(await No({settingsIndex:e,payer:n,initialMember:r instanceof C?void 0:r,secp256r1VerifyArgs:i,domainConfig:c,userArgs:S.data.role===1?{__kind:"Mutate",fields:[S]}:{__kind:"Read",fields:[S]},compressedProofArgs:V,settingsCreation:W,remainingAccounts:q})),O}async function ik({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let c=new U;await c.addSystemAccounts();let i=await ce([{address:(await j(e,n)).address,type:"Settings"}],t),a=await k(i,[]),o=Y(c,a.treeInfos,a.leafIndices,a.rootIndices,a.proveByIndices,i.filter(I=>I.type==="Settings"),z())[0],d=ge(s),u=d.filter(I=>I instanceof C),g=[],y=[];for(let I of u){let S=g.length,{domainConfig:L,verifyArgs:W,signature:q,publicKey:H,message:V}=G(I,S);V&&q&&H&&g.push({message:V,signature:q,publicKey:H}),L&&(c.addPreAccounts([{address:L,role:gill.AccountRole.READONLY}]),W?.__option==="Some"&&y.push({domainConfigKey:L,verifyArgs:W.value}));}c.addPreAccounts(d.filter(I=>"address"in I).map(I=>({address:I.address,role:gill.AccountRole.READONLY_SIGNER,signer:I})));let{remainingAccounts:T,systemOffset:l}=c.toAccountMetas(),D=b(a,l),x=[];g.length>0&&x.push(F(g));let h=await Z(e);return x.push(Yo({settings:h,payer:r,settingsMut:o,compressedProofArgs:D,secp256r1VerifyArgs:y,remainingAccounts:T})),x}function BC(e,n,r,s){let t=wC(e,n),c=kC(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 wC(e,n){let r=e.staticAccounts.length,{numSignerAccounts:s,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,i=s-t,a=r-s-c;return n>=r?false:n<i?true:n>=s?n-s<a:false}function kC(e,n){return n<e.header.numSignerAccounts}async function ur({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=Ui(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=r??(t.addressTableLookups?await gill.fetchAddressesForLookupTables(t.addressTableLookups.map(a=>a.lookupTableAddress),oe()):{}),i=[];i.push(...t.addressTableLookups?.map(a=>({role:gill.AccountRole.READONLY,address:a.lookupTableAddress}))??[]);for(let[a,o]of t.staticAccounts.entries())i.push({address:o,role:BC(t,a,o,e)});if(t.addressTableLookups)for(let a of t.addressTableLookups){let o=c[a.lookupTableAddress];if(!o)throw new Error(`Address lookup table account ${a.lookupTableAddress} not found`);for(let d of a.writableIndexes){let u=o[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:gill.AccountRole.WRITABLE});}for(let d of a.readonlyIndexes){let u=o[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:gill.AccountRole.READONLY});}}for(let a of s?.filter(o=>o.address!==e)??[]){let o=i.findIndex(d=>d.address===a.address);o===-1?i.push({address:a.address,role:gill.AccountRole.READONLY_SIGNER,signer:a}):i[o].role===gill.AccountRole.READONLY||i[o].role===gill.AccountRole.READONLY_SIGNER?i[o]={address:a.address,role:gill.AccountRole.READONLY_SIGNER,signer:a}:(i[o].role===gill.AccountRole.WRITABLE||i[o].role===gill.AccountRole.WRITABLE_SIGNER)&&(i[o]={address:a.address,role:gill.AccountRole.WRITABLE_SIGNER,signer:a});}return {accountMetas:i,addressLookupTableAccounts:c,transactionMessage:t}}async function bd({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:i=[],jitoBundlesTipAmount:a,compressed:o=false}){let d=await Ce(e),{accountMetas:u,addressLookupTableAccounts:g}=await ur({transactionMessageBytes:r,walletAddress:d,additionalSigners:i,addressesByLookupTableAddress:t}),y=[];return c.length>0&&y.push(F(c)),y.push(o?mi({transactionBuffer:n,payer:s.address,remainingAccounts:u,settingsKey:e}):di({transactionBuffer:n,payer:s.address,settings:e})),a&&y.push(Yi({payer:s,tipAmount:a})),{instructions:y,addressLookupTableAccounts:g}}async function _d({index:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:i=[],compressed:a=false,simulateProof:o=false,cachedAccounts:d}){let u=ge(s),g=await Z(e),y=await Ce(g),[{accountMetas:T,addressLookupTableAccounts:l,transactionMessage:D},{settingsReadonlyArgs:x,proof:h,packedAccounts:I}]=await Promise.all([ur({transactionMessageBytes:r,walletAddress:y,additionalSigners:u.filter(O=>!(O instanceof C)),addressesByLookupTableAddress:c}),fe(a,e,n,o,d)]);I.addPreAccounts(T);let S=u.filter(O=>O instanceof C),L=[];for(let O of S){let re=i.length,{domainConfig:Te,verifyArgs:Pe,signature:De,publicKey:Re,message:Bt}=G(O,re);Bt&&De&&Re&&i.push({message:Bt,signature:De,publicKey:Re}),Te&&(I.addPreAccounts([{address:Te,role:gill.AccountRole.READONLY}]),Pe?.__option==="Some"&&L.push({domainConfigKey:Te,verifyArgs:Pe.value}));}let{remainingAccounts:W,systemOffset:q}=I.toAccountMetas(),H=[];i.length>0&&H.push(F(i));let V=HC(D,T);if(a){if(!t||!x)throw new Error("Payer not found or proof args is missing.");let O=b(h,q);H.push(Pi({secp256r1VerifyArgs:L,transactionMessage:V,settingsReadonlyArgs:x,compressedProofArgs:O,payer:t,remainingAccounts:W}));}else H.push(Ii({secp256r1VerifyArgs:L,settings:g,transactionMessage:V,remainingAccounts:W}));return {instructions:H,addressLookupTableAccounts:l}}function HC(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 Bk({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:i,compressed:a=false}){let o=ge(s),d=await Z(e),u=await Ce(d),{settingsReadonlyArgs:g,proof:y,packedAccounts:T}=await fe(a,e,n,false,t),l=[],D=[];for(let S of o)if(S instanceof C){let L=l.length,{domainConfig:W,verifyArgs:q,signature:H,publicKey:V,message:O}=G(S,L);O&&H&&V&&l.push({message:O,signature:H,publicKey:V}),W&&(T.addPreAccounts([{address:W,role:gill.AccountRole.READONLY}]),q?.__option==="Some"&&D.push({domainConfigKey:W,verifyArgs:q.value}));}else T.addPreAccounts([{address:S.address,role:gill.AccountRole.READONLY_SIGNER,signer:S}]);let{remainingAccounts:x,systemOffset:h}=T.toAccountMetas(),I=[];if(l.length>0&&I.push(F(l)),a){if(!i||!g)throw new Error("Payer not found or proof args is missing.");let S=b(y,h);I.push(Vc({amount:c,settingsReadonlyArgs:g,compressedProofArgs:S,payer:i,secp256r1VerifyArgs:D,source:u,destination:r,remainingAccounts:x}));}else I.push(Oc({amount:c,secp256r1VerifyArgs:D,source:u,destination:r,settings:d,remainingAccounts:x}));return I}async function Jk({index:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:i,payer:a,tokenProgram:o,createAtaIfNeeded:d=true,compressed:u=false}){let g=ge(t),y=await Z(e),T=await Ce(y),[l,D]=await Promise.all([programs.getAssociatedTokenAccountAddress(s,T,o),programs.getAssociatedTokenAccountAddress(s,r,o)]),{settingsReadonlyArgs:x,proof:h,packedAccounts:I}=await fe(u,e,n,false,c),S=[],L=[];for(let V of g)if(V instanceof C){let O=S.length,{domainConfig:re,verifyArgs:Te,signature:Pe,publicKey:De,message:Re}=G(V,O);Re&&Pe&&De&&S.push({message:Re,signature:Pe,publicKey:De}),re&&(I.addPreAccounts([{address:re,role:gill.AccountRole.READONLY}]),Te?.__option==="Some"&&L.push({domainConfigKey:re,verifyArgs:Te.value}));}else I.addPreAccounts([{address:V.address,role:gill.AccountRole.READONLY_SIGNER,signer:V}]);let{remainingAccounts:W,systemOffset:q}=I.toAccountMetas(),H=[];if(S.length>0&&H.push(F(S)),u){if(!a||!x)throw new Error("Payer not found or proof args is missing.");let V=b(h,q);H.push(Xc({amount:i,createAtaIfNeeded:d,settingsReadonlyArgs:x,compressedProofArgs:V,payer:a,secp256r1VerifyArgs:L,source:T,sourceTokenAccount:l,destination:r,destinationTokenAccount:D,mint:s,tokenProgram:o,remainingAccounts:W}));}else H.push(Kc({amount:i,createAtaIfNeeded:d,secp256r1VerifyArgs:L,source:T,sourceTokenAccount:l,destination:r,destinationTokenAccount:D,settings:y,mint:s,tokenProgram:o,remainingAccounts:W}));return H}async function nN({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:i}){let a=await Ns(oe(),s),o=a.data.multiWalletSettings,{settingsReadonlyArgs:d,proof:u,packedAccounts:g}=await fe(c,e,n,false,i),{remainingAccounts:y,systemOffset:T}=g.toAccountMetas(),{domainConfig:l,verifyArgs:D,message:x,signature:h,publicKey:I}=G(r),S=[];if(x&&h&&I&&S.push(F([{message:x,signature:h,publicKey:I}])),c){if(!t||!d)throw new Error("Payer not found or proof args is missing.");let L=b(u,T);S.push(da({transactionBuffer:s,domainConfig:l,closer:r instanceof C?void 0:r,rentCollector:a.data.payer,secp256r1VerifyArgs:D,settingsReadonlyArgs:d,payer:t,compressedProofArgs:L,remainingAccounts:y}));}else S.push(na({transactionBuffer:s,domainConfig:l,closer:r instanceof C?void 0:r,settings:o,payer:a.data.payer,secp256r1VerifyArgs:D,remainingAccounts:[]}));return S}function Od({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:o,compressedArgs:d,expectedSecp256r1Signers:u}){let{domainConfig:g,verifyArgs:y,message:T,signature:l,publicKey:D}=G(n),x=[];if(T&&l&&D&&x.push(F([{message:T,signature:l,publicKey:D}])),d){let{settingsReadonlyArgs:h,compressedProofArgs:I,remainingAccounts:S}=d;x.push(Ia({transactionBuffer:t,payer:e,secp256r1VerifyArgs:y,creator:n instanceof C?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:o,preauthorizeExecution:a,expectedSecp256r1Signers:u},settingsReadonlyArgs:h,compressedProofArgs:I,remainingAccounts:S}));}else x.push(ma({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:y,creator:n instanceof C?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:o,preauthorizeExecution:a,expectedSecp256r1Signers:u},remainingAccounts:[]}));return x}function Bd({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:i,message:a,publicKey:o}=G(e),d=[];return a&&i&&o&&d.push(F([{message:a,signature:i,publicKey:o}])),s?d.push(Wa({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof C?void 0:e,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(Pa({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof C?void 0:e,remainingAccounts:[]})),d}function wd({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?Ka({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Na({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function kd({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:i,publicKey:a,message:o}=G(n),d=[];return o&&i&&a&&d.push(F([{message:o,signature:i,publicKey:a}])),s?d.push(ni({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof C?void 0:n,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(Xa({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof C?void 0:n,remainingAccounts:[]})),d}async function FN({message:e,signer:n,popUp:r}){let{clientId:s,signClientMessage:t}=Ze(),c={type:"message",payload:e},i=gill.getBase64Decoder().decode(new Uint8Array([...new TextEncoder().encode(JSON.stringify(c)),...n?n.toBuffer():[]])),{signature:a,expiry:o}=await t("start",i),d=`${he()}/?redirectUrl=${encodeURIComponent(window.origin)}&clientId=${encodeURIComponent(s)}&signature=${encodeURIComponent(a)}&expiry=${encodeURIComponent(o)}`,u=await rr({authUrl:d,data:c,signer:n,popUp:r});return {...u,signer:new Ae(u.signer)}}async function YN({transactionActionType:e,transactionAddress:n,transactionMessageBytes:r,signer:s,popUp:t}){let{clientId:c,signClientMessage:i}=Ze(),a={type:"transaction",payload:JSON.stringify({transactionActionType:e,transactionAddress:n,transactionMessageBytes:nr(r)})},o=gill.getBase64Decoder().decode(new Uint8Array([...new TextEncoder().encode(JSON.stringify(a)),...s?s.toBuffer():[]])),{signature:d,expiry:u}=await i("start",o),g=`${he()}/?redirectUrl=${encodeURIComponent(window.origin)}&clientId=${encodeURIComponent(c)}&signature=${encodeURIComponent(d)}&expiry=${encodeURIComponent(u)}`,y=await rr({authUrl:g,data:a,signer:s,popUp:t});return {...y,signer:new Ae(y.signer)}}async function r2({message:e,response:n,expectedRPID:r=Qi(),expectedOrigin:s=he()}){let t=new Uint8Array([...new TextEncoder().encode(e),...Mn(n.clientId,n.deviceSignature.publicKey,n.nonce)]),{verified:c}=await server.verifyAuthenticationResponse({response:n.authResponse,expectedChallenge:nr(t),expectedOrigin:s,expectedRPID:r,requireUserVerification:false,credential:{id:n.authResponse.id,publicKey:zi(n.signer.toString()),counter:0}}),i=ed25519_js.ed25519.verify(new Uint8Array(gill.getBase58Encoder().encode(n.deviceSignature.signature)),Je(n.authResponse),new Uint8Array(gill.getBase58Encoder().encode(n.deviceSignature.publicKey)));return c&&i}async function p2({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:o,compressed:d=false,additionalVoters:u=[],additionalSigners:g=[],chunkSize:y=Math.ceil(s.length/2),cachedAccounts:T}){let l=await Z(n),D=Math.floor(Math.random()*255),x=await yd(l,t instanceof C?t:t.address,D),h=[],I=[];for(let X=0;X<s.length;X+=y){let Nn=s.subarray(X,X+y);h.push(Nn),I.push(sha2_js.sha256(Nn));}let S=sha2_js.sha256(new Uint8Array(s)),{settingsReadonlyArgs:L,proof:W,packedAccounts:q}=await fe(d,n,r,false,T),{remainingAccounts:H,systemOffset:V}=q.toAccountMetas(),O=L?{settingsReadonlyArgs:L,compressedProofArgs:b(W,V),remainingAccounts:H,payer:e}:null,re=ge([t,...c?[c]:[],...u]).filter(X=>X instanceof C).map(X=>({memberKey:qe(X),messageHash:Je(X.authResponse)})),Te=Od({finalBufferHash:S,finalBufferSize:s.length,bufferIndex:D,payer:e,transactionBufferAddress:x,settings:l,creator:t,preauthorizeExecution:!c,bufferExtendHashes:I,compressedArgs:O,expectedSecp256r1Signers:re}),Pe=h.map(X=>wd({transactionMessageBytes:X,transactionBufferAddress:x,settings:l,compressed:d})),De=u.map(X=>kd({voter:X,transactionBufferAddress:x,settings:l,compressedArgs:O})),Re=Bd({compressedArgs:O,settings:l,executor:c,transactionBufferAddress:x}),{instructions:Bt,addressLookupTableAccounts:Gd}=await bd({compressed:d,settings:l,transactionMessageBytes:s,transactionBufferAddress:x,payer:e,additionalSigners:g,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:o}),et=X=>({payer:e,instructions:X,addressesByLookupTableAddress:Gd});return [et(Te),...Pe.map(X=>et([X])),...De.length?[et(De.flat())]:[],et(Re),et(Bt)]}var gr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let s=new Map,t=i=>{let a=s.get(i);return a===void 0&&(a={isSigner:false,isWritable:false,isInvoked:false},s.set(i,a)),a},c=t(r);c.isSigner=true,c.isWritable=true;for(let i of n){t(i.programAddress).isInvoked=false;for(let a of i.accounts??[]){let o=t(a.address);o.isSigner||=a.role===gill.AccountRole.READONLY_SIGNER||a.role===gill.AccountRole.WRITABLE_SIGNER,o.isWritable||=a.role===gill.AccountRole.WRITABLE||a.role===gill.AccountRole.WRITABLE_SIGNER;}}return new e(r,s)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,o])=>o.isSigner&&o.isWritable),s=n.filter(([,o])=>o.isSigner&&!o.isWritable),t=n.filter(([,o])=>!o.isSigner&&o.isWritable),c=n.filter(([,o])=>!o.isSigner&&!o.isWritable),i={numSignerAccounts:r.length+s.length,numReadonlySignerAccounts:s.length,numReadonlyNonSignerAccounts:c.length};{if(r.length===0)throw new Error("Expected at least one writable signer key");let[o]=r[0];if(o!==this.payer)throw new Error("Expected first writable signer key to be the fee payer")}let a=[...r.map(([o])=>o),...s.map(([o])=>o),...t.map(([o])=>o),...c.map(([o])=>o)];return [i,a]}extractTableLookup(n){let[r,s]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&i.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&!i.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:s,readonly:c}}}drainKeysFoundInLookupTable(n,r){let s=new Array,t=new Array;for(let[c,i]of this.keyMetaMap.entries())if(r(i)){let a=c,o=n.findIndex(d=>d===a);if(o>=0){if(o>=256)throw new Error("Max lookup table index exceeded");s.push(o),t.push(a),this.keyMetaMap.delete(c);}}return [s,t]}};var yr=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let s=new Map;this.keySegments().flat().forEach((c,i)=>{s.set(c,i);});let t=c=>{let i=s.get(c);if(i===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return i};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(i=>t(i.address))??[],data:c.data}))}};function Vd({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=gr.compile(r,e),c=new Array,i={writable:[],readonly:[]},a=Object.entries(s??{});for(let y of a){let T=t.extractTableLookup(y);if(T!==void 0){let{addressTableLookup:l,drainedKeys:D}=T;c.push({readonlyIndexes:l.readonlyIndexes,readableIndices:l.readonlyIndexes,writableIndexes:l.writableIndexes,writableIndices:l.writableIndexes,lookupTableAddress:gill.address(l.lookupTableAddress)}),i.writable.push(...D.writable),i.readonly.push(...D.readonly);}}let[o,d]=t.getMessageComponents(),g=new yr(d,i).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function P2({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=Vd({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return _i(s)}async function U2({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:i,cachedAccounts:a,compressed:o=false,simulateProof:d=false}){let{instructions:u,addressLookupTableAccounts:g}=await _d({index:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:i,simulateProof:d,cachedAccounts:a});return {payer:e,instructions:u,addressesByLookupTableAddress:g}}
|
|
2
|
-
exports.ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR=Ys;exports.CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR=co;exports.CHANGE_CONFIG_DISCRIMINATOR=to;exports.COMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR=yo;exports.CREATE_DOMAIN_CONFIG_DISCRIMINATOR=Mo;exports.CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR=Ro;exports.CREATE_GLOBAL_COUNTER_DISCRIMINATOR=Uo;exports.CREATE_MULTI_WALLET_COMPRESSED_DISCRIMINATOR=wo;exports.CREATE_USER_ACCOUNTS_DISCRIMINATOR=Vo;exports.DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR=Jo;exports.DISABLE_DOMAIN_CONFIG_DISCRIMINATOR=$o;exports.DOMAIN_CONFIG_DISCRIMINATOR=Hn;exports.EDIT_DOMAIN_CONFIG_DISCRIMINATOR=oc;exports.EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR=uc;exports.EDIT_USER_DELEGATE_DISCRIMINATOR=Tc;exports.GLOBAL_COUNTER_DISCRIMINATOR=Jn;exports.KeyType=Wt;exports.MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR=Cc;exports.MIGRATE_COMPRESSED_USERS_DISCRIMINATOR=Rc;exports.MULTI_WALLET_ERROR__ALREADY_DELEGATED=bx;exports.MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH=ax;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED=Yx;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING=Zx;exports.MULTI_WALLET_ERROR__DUPLICATE_MEMBER=ux;exports.MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED=dx;exports.MULTI_WALLET_ERROR__EMPTY_MEMBERS=xx;exports.MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH=lx;exports.MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH=ix;exports.MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH=Tx;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH=Nx;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED=Hx;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH=Vx;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION=Wx;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION=_x;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION=Ux;exports.MULTI_WALLET_ERROR__INVALID_ACCOUNT=Ex;exports.MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE=Qx;exports.MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG=Sx;exports.MULTI_WALLET_ERROR__INVALID_ARGUMENTS=Px;exports.MULTI_WALLET_ERROR__INVALID_BUFFER=kx;exports.MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS=Lx;exports.MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS=Mx;exports.MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG=yx;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION=tx;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY=sx;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG=ex;exports.MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS=nx;exports.MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT=jx;exports.MULTI_WALLET_ERROR__INVALID_THRESHOLD=Cx;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG=fx;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION=mx;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE=Dx;exports.MULTI_WALLET_ERROR__INVALID_USER_ROLE=hx;exports.MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE=ox;exports.MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED=Kx;exports.MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG=Xx;exports.MULTI_WALLET_ERROR__MISSING_ACCOUNT=Rx;exports.MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY=Jx;exports.MULTI_WALLET_ERROR__MISSING_USER_ARGS=vx;exports.MULTI_WALLET_ERROR__NO_SIGNER_FOUND=Bx;exports.MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED=gx;exports.MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED=px;exports.MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS=$x;exports.MULTI_WALLET_ERROR__PERMANENT_MEMBER=Ax;exports.MULTI_WALLET_ERROR__PROTECTED_ACCOUNT=zx;exports.MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH=cx;exports.MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS=rx;exports.MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND=qx;exports.MULTI_WALLET_ERROR__TOO_MANY_MEMBERS=Ix;exports.MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED=Gx;exports.MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED=Fx;exports.MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER=wx;exports.MULTI_WALLET_ERROR__UNEXPECTED_SIGNER=Ox;exports.MULTI_WALLET_PROGRAM_ADDRESS=A;exports.MultiWalletAccount=XS;exports.MultiWalletInstruction=$S;exports.NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=kc;exports.NATIVE_TRANSFER_INTENT_DISCRIMINATOR=Wc;exports.Permission=Ie;exports.Permissions=Me;exports.SETTINGS_DISCRIMINATOR=vs;exports.Secp256r1Key=Ae;exports.SignedSecp256r1Key=C;exports.TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=Yc;exports.TOKEN_TRANSFER_INTENT_DISCRIMINATOR=Fc;exports.TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR=ca;exports.TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR=ea;exports.TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR=la;exports.TRANSACTION_BUFFER_CREATE_DISCRIMINATOR=ga;exports.TRANSACTION_BUFFER_DISCRIMINATOR=Bs;exports.TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR=ba;exports.TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR=Ma;exports.TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR=Ga;exports.TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR=Ba;exports.TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR=ei;exports.TRANSACTION_BUFFER_VOTE_DISCRIMINATOR=qa;exports.TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR=gi;exports.TRANSACTION_EXECUTE_DISCRIMINATOR=ci;exports.TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR=Mi;exports.TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR=li;exports.UserRole=Be;exports.WHITELISTED_ADDRESS_TREE_DISCRIMINATOR=Gs;exports.addWhitelistedAddressTrees=mB;exports.changeConfig=$O;exports.closeTransactionBuffer=nN;exports.compressSettingsAccount=gB;exports.configAction=LD;exports.convertMemberKeyToString=fd;exports.convertPubkeyCompressedToCose=zi;exports.convertPubkeyCoseToCompressed=mL;exports.createDomainConfig=CB;exports.createDomainUserAccounts=UB;exports.createGlobalCounter=BB;exports.createPopUp=Gi;exports.createTransactionBuffer=Od;exports.createTransactionManagerSigner=gC;exports.createUserAccounts=FB;exports.createWallet=$w;exports.decodeDomainConfig=Gn;exports.decodeGlobalCounter=qn;exports.decodeSettings=_s;exports.decodeTransactionBuffer=ks;exports.decodeWhitelistedAddressTree=zs;exports.decompressSettingsAccount=ik;exports.disableDomainConfig=jB;exports.editDomainConfig=ew;exports.editTransactionManagerUrl=cw;exports.editUserDelegate=Tw;exports.executeTransaction=bd;exports.executeTransactionBuffer=Bd;exports.executeTransactionSync=_d;exports.extendTransactionBuffer=wd;exports.fetchAllDomainConfig=YC;exports.fetchAllGlobalCounter=rD;exports.fetchAllMaybeDomainConfig=ru;exports.fetchAllMaybeGlobalCounter=lu;exports.fetchAllMaybeSettings=Py;exports.fetchAllMaybeTransactionBuffer=Yy;exports.fetchAllMaybeWhitelistedAddressTree=mp;exports.fetchAllSettings=Ch;exports.fetchAllTransactionBuffer=vh;exports.fetchAllWhitelistedAddressTree=Lh;exports.fetchCompressedAccount=rd;exports.fetchDomainConfig=Fn;exports.fetchGlobalCounter=tD;exports.fetchMaybeDomainConfig=tu;exports.fetchMaybeGlobalCounter=fu;exports.fetchMaybeSettings=jr;exports.fetchMaybeSettingsAccountData=YI;exports.fetchMaybeTransactionBuffer=qy;exports.fetchMaybeUserAccountData=qI;exports.fetchMaybeWhitelistedAddressTree=pp;exports.fetchSettings=Ih;exports.fetchSettingsAccountData=Ot;exports.fetchTransactionBuffer=Ns;exports.fetchUserAccountData=ir;exports.fetchWhitelistedAddressTree=Ks;exports.getAddMemberArgsCodec=aD;exports.getAddMemberArgsDecoder=mr;exports.getAddMemberArgsEncoder=pr;exports.getAddWhitelistedAddressTreesDiscriminatorBytes=Xh;exports.getAddWhitelistedAddressTreesInstruction=Qh;exports.getAddWhitelistedAddressTreesInstructionAsync=Xs;exports.getAddWhitelistedAddressTreesInstructionDataCodec=$h;exports.getAddWhitelistedAddressTreesInstructionDataDecoder=Zs;exports.getAddWhitelistedAddressTreesInstructionDataEncoder=tn;exports.getAuthEndpoint=he;exports.getChangeConfigCompressedDiscriminatorBytes=fP;exports.getChangeConfigCompressedInstruction=uo;exports.getChangeConfigCompressedInstructionDataCodec=lP;exports.getChangeConfigCompressedInstructionDataDecoder=io;exports.getChangeConfigCompressedInstructionDataEncoder=ao;exports.getChangeConfigDiscriminatorBytes=aP;exports.getChangeConfigInstruction=dP;exports.getChangeConfigInstructionAsync=no;exports.getChangeConfigInstructionDataCodec=iP;exports.getChangeConfigInstructionDataDecoder=ro;exports.getChangeConfigInstructionDataEncoder=rn;exports.getClientAndDeviceHash=Mn;exports.getClientSettings=Ze;exports.getCompiledInstructionCodec=uD;exports.getCompiledInstructionDecoder=fr;exports.getCompiledInstructionEncoder=Tr;exports.getCompressSettingsAccountDiscriminatorBytes=hP;exports.getCompressSettingsAccountInstruction=To;exports.getCompressSettingsAccountInstructionDataCodec=PP;exports.getCompressSettingsAccountInstructionDataDecoder=mo;exports.getCompressSettingsAccountInstructionDataEncoder=po;exports.getCompressedAccountMetaCodec=pD;exports.getCompressedAccountMetaDecoder=st;exports.getCompressedAccountMetaEncoder=nt;exports.getCompressedAccountMetaReadOnlyCodec=lD;exports.getCompressedAccountMetaReadOnlyDecoder=it;exports.getCompressedAccountMetaReadOnlyEncoder=at;exports.getCompressedProofCodec=ID;exports.getCompressedProofDecoder=Dr;exports.getCompressedProofEncoder=Cr;exports.getCompressedSettingsAddressFromIndex=j;exports.getCompressedSettingsCodec=ED;exports.getCompressedSettingsDataCodec=vD;exports.getCompressedSettingsDataDecoder=At;exports.getCompressedSettingsDataEncoder=ut;exports.getCompressedSettingsDecoder=z;exports.getCompressedSettingsEncoder=dt;exports.getComputeBudgetEstimate=$i;exports.getConfigActionCodec=WD;exports.getConfigActionDecoder=mt;exports.getConfigActionEncoder=pt;exports.getCreateDomainConfigDiscriminatorBytes=OP;exports.getCreateDomainConfigInstruction=wP;exports.getCreateDomainConfigInstructionAsync=ho;exports.getCreateDomainConfigInstructionDataCodec=BP;exports.getCreateDomainConfigInstructionDataDecoder=Eo;exports.getCreateDomainConfigInstructionDataEncoder=sn;exports.getCreateDomainUserAccountDiscriminatorBytes=KP;exports.getCreateDomainUserAccountInstruction=jP;exports.getCreateDomainUserAccountInstructionAsync=bo;exports.getCreateDomainUserAccountInstructionDataCodec=JP;exports.getCreateDomainUserAccountInstructionDataDecoder=vo;exports.getCreateDomainUserAccountInstructionDataEncoder=cn;exports.getCreateGlobalCounterDiscriminatorBytes=eR;exports.getCreateGlobalCounterInstruction=rR;exports.getCreateGlobalCounterInstructionAsync=Lo;exports.getCreateGlobalCounterInstructionDataCodec=tR;exports.getCreateGlobalCounterInstructionDataDecoder=Wo;exports.getCreateGlobalCounterInstructionDataEncoder=dn;exports.getCreateMultiWalletCompressedDiscriminatorBytes=uR;exports.getCreateMultiWalletCompressedInstruction=gR;exports.getCreateMultiWalletCompressedInstructionAsync=No;exports.getCreateMultiWalletCompressedInstructionDataCodec=AR;exports.getCreateMultiWalletCompressedInstructionDataDecoder=ko;exports.getCreateMultiWalletCompressedInstructionDataEncoder=un;exports.getCreateUserAccountArgsCodec=ND;exports.getCreateUserAccountArgsDecoder=_r;exports.getCreateUserAccountArgsEncoder=br;exports.getCreateUserAccountsDiscriminatorBytes=xR;exports.getCreateUserAccountsInstruction=CR;exports.getCreateUserAccountsInstructionAsync=Fo;exports.getCreateUserAccountsInstructionDataCodec=IR;exports.getCreateUserAccountsInstructionDataDecoder=Go;exports.getCreateUserAccountsInstructionDataEncoder=gn;exports.getDecompressSettingsAccountDiscriminatorBytes=bR;exports.getDecompressSettingsAccountInstruction=Yo;exports.getDecompressSettingsAccountInstructionDataCodec=_R;exports.getDecompressSettingsAccountInstructionDataDecoder=qo;exports.getDecompressSettingsAccountInstructionDataEncoder=jo;exports.getDisableDomainConfigDiscriminatorBytes=kR;exports.getDisableDomainConfigInstruction=tc;exports.getDisableDomainConfigInstructionDataCodec=NR;exports.getDisableDomainConfigInstructionDataDecoder=ec;exports.getDisableDomainConfigInstructionDataEncoder=Qo;exports.getDomainConfigAddress=je;exports.getDomainConfigCodec=qC;exports.getDomainConfigDecoder=Vn;exports.getDomainConfigDiscriminatorBytes=jC;exports.getDomainConfigEncoder=eu;exports.getDomainConfigSize=ZC;exports.getEditDomainConfigDiscriminatorBytes=jR;exports.getEditDomainConfigInstruction=ac;exports.getEditDomainConfigInstructionAsync=YR;exports.getEditDomainConfigInstructionDataCodec=qR;exports.getEditDomainConfigInstructionDataDecoder=cc;exports.getEditDomainConfigInstructionDataEncoder=pn;exports.getEditMemberArgsCodec=FD;exports.getEditMemberArgsDecoder=Pr;exports.getEditMemberArgsEncoder=hr;exports.getEditTransactionManagerUrlDiscriminatorBytes=nv;exports.getEditTransactionManagerUrlInstruction=yc;exports.getEditTransactionManagerUrlInstructionDataCodec=sv;exports.getEditTransactionManagerUrlInstructionDataDecoder=gc;exports.getEditTransactionManagerUrlInstructionDataEncoder=Ac;exports.getEditUserDelegateDiscriminatorBytes=gv;exports.getEditUserDelegateInstruction=Sc;exports.getEditUserDelegateInstructionDataCodec=yv;exports.getEditUserDelegateInstructionDataDecoder=lc;exports.getEditUserDelegateInstructionDataEncoder=fc;exports.getExpectedSecp256r1SignersCodec=jD;exports.getExpectedSecp256r1SignersDecoder=ft;exports.getExpectedSecp256r1SignersEncoder=Tt;exports.getFeePayer=WL;exports.getGlobalCounterAddress=gd;exports.getGlobalCounterCodec=eD;exports.getGlobalCounterDecoder=jn;exports.getGlobalCounterDiscriminatorBytes=QC;exports.getGlobalCounterEncoder=Tu;exports.getGlobalCounterSize=nD;exports.getJitoTipsConfig=Rn;exports.getLightCpiSigner=TO;exports.getLightProtocolRpc=He;exports.getLinkWalletArgsCodec=XD;exports.getLinkWalletArgsDecoder=Wr;exports.getLinkWalletArgsEncoder=Ur;exports.getMemberCodec=tM;exports.getMemberDecoder=yt;exports.getMemberEncoder=gt;exports.getMemberKeyCodec=sM;exports.getMemberKeyDecoder=Q;exports.getMemberKeyEncoder=$;exports.getMigrateCompressedSettingsDiscriminatorBytes=Iv;exports.getMigrateCompressedSettingsInstruction=Ec;exports.getMigrateCompressedSettingsInstructionDataCodec=Cv;exports.getMigrateCompressedSettingsInstructionDataDecoder=Mc;exports.getMigrateCompressedSettingsInstructionDataEncoder=Dc;exports.getMigrateCompressedUsersDiscriminatorBytes=bv;exports.getMigrateCompressedUsersInstruction=_c;exports.getMigrateCompressedUsersInstructionDataCodec=_v;exports.getMigrateCompressedUsersInstructionDataDecoder=bc;exports.getMigrateCompressedUsersInstructionDataEncoder=vc;exports.getMultiWalletErrorMessage=DW;exports.getNativeTransferIntentCompressedDiscriminatorBytes=Yv;exports.getNativeTransferIntentCompressedInstruction=Vc;exports.getNativeTransferIntentCompressedInstructionDataCodec=Zv;exports.getNativeTransferIntentCompressedInstructionDataDecoder=Hc;exports.getNativeTransferIntentCompressedInstructionDataEncoder=Nc;exports.getNativeTransferIntentDiscriminatorBytes=Nv;exports.getNativeTransferIntentInstruction=Oc;exports.getNativeTransferIntentInstructionAsync=Vv;exports.getNativeTransferIntentInstructionDataCodec=Hv;exports.getNativeTransferIntentInstructionDataDecoder=Lc;exports.getNativeTransferIntentInstructionDataEncoder=mn;exports.getNewAuthorityArgsCodec=iM;exports.getNewAuthorityArgsDecoder=wr;exports.getNewAuthorityArgsEncoder=Br;exports.getOriginIndex=fL;exports.getPackedAddressTreeInfoCodec=AM;exports.getPackedAddressTreeInfoDecoder=St;exports.getPackedAddressTreeInfoEncoder=lt;exports.getPackedStateTreeInfoCodec=pM;exports.getPackedStateTreeInfoDecoder=ct;exports.getPackedStateTreeInfoEncoder=ot;exports.getPermissionsCodec=fM;exports.getPermissionsDecoder=be;exports.getPermissionsEncoder=ve;exports.getProofArgsCodec=IM;exports.getProofArgsDecoder=E;exports.getProofArgsEncoder=M;exports.getRemoveMemberArgsCodec=EM;exports.getRemoveMemberArgsDecoder=vr;exports.getRemoveMemberArgsEncoder=Rr;exports.getRpId=Qi;exports.getSecp256r1Message=En;exports.getSecp256r1MessageHash=Je;exports.getSecp256r1PubkeyCodec=RM;exports.getSecp256r1PubkeyDecoder=xt;exports.getSecp256r1PubkeyEncoder=kr;exports.getSecp256r1SignatureOffsetsDataDecoder=_C;exports.getSecp256r1SignatureOffsetsDataEncoder=bC;exports.getSecp256r1VerifyArgsCodec=_M;exports.getSecp256r1VerifyArgsDecoder=w;exports.getSecp256r1VerifyArgsEncoder=B;exports.getSecp256r1VerifyArgsWithDomainAddressCodec=OM;exports.getSecp256r1VerifyArgsWithDomainAddressDecoder=te;exports.getSecp256r1VerifyArgsWithDomainAddressEncoder=ee;exports.getSecp256r1VerifyInstruction=F;exports.getSecp256r1VerifyInstructionDataCodec=tB;exports.getSecp256r1VerifyInstructionDataDecoder=Dd;exports.getSecp256r1VerifyInstructionDataEncoder=Md;exports.getSendAndConfirmTransaction=Xi;exports.getSettingsCodec=xh;exports.getSettingsCreationArgsCodec=NM;exports.getSettingsCreationArgsDecoder=Ct;exports.getSettingsCreationArgsEncoder=It;exports.getSettingsDecoder=bs;exports.getSettingsDiscriminatorBytes=Sh;exports.getSettingsEncoder=hy;exports.getSettingsFromIndex=Z;exports.getSettingsIndexWithAddressCodec=GM;exports.getSettingsIndexWithAddressDecoder=Mt;exports.getSettingsIndexWithAddressEncoder=Dt;exports.getSettingsMutArgsCodec=JM;exports.getSettingsMutArgsDecoder=ue;exports.getSettingsMutArgsEncoder=de;exports.getSettingsReadonlyArgsCodec=ZM;exports.getSettingsReadonlyArgsDecoder=se;exports.getSettingsReadonlyArgsEncoder=ne;exports.getSettingsSize=Dh;exports.getSignedSecp256r1Key=TL;exports.getSignedTransactionManager=WO;exports.getSolanaRpc=oe;exports.getSolanaRpcEndpoint=Ye;exports.getTokenTransferIntentCompressedDiscriminatorBytes=pb;exports.getTokenTransferIntentCompressedInstruction=Xc;exports.getTokenTransferIntentCompressedInstructionAsync=Tb;exports.getTokenTransferIntentCompressedInstructionDataCodec=mb;exports.getTokenTransferIntentCompressedInstructionDataDecoder=Zc;exports.getTokenTransferIntentCompressedInstructionDataEncoder=ln;exports.getTokenTransferIntentDiscriminatorBytes=sb;exports.getTokenTransferIntentInstruction=Kc;exports.getTokenTransferIntentInstructionAsync=cb;exports.getTokenTransferIntentInstructionDataCodec=ob;exports.getTokenTransferIntentInstructionDataDecoder=zc;exports.getTokenTransferIntentInstructionDataEncoder=fn;exports.getTransactionBufferAddress=yd;exports.getTransactionBufferCloseCompressedDiscriminatorBytes=Wb;exports.getTransactionBufferCloseCompressedInstruction=da;exports.getTransactionBufferCloseCompressedInstructionDataCodec=Lb;exports.getTransactionBufferCloseCompressedInstructionDataDecoder=ia;exports.getTransactionBufferCloseCompressedInstructionDataEncoder=aa;exports.getTransactionBufferCloseDiscriminatorBytes=Mb;exports.getTransactionBufferCloseInstruction=na;exports.getTransactionBufferCloseInstructionDataCodec=Eb;exports.getTransactionBufferCloseInstructionDataDecoder=ra;exports.getTransactionBufferCloseInstructionDataEncoder=ta;exports.getTransactionBufferCodec=Rh;exports.getTransactionBufferCreateArgsCodec=eE;exports.getTransactionBufferCreateArgsDecoder=ht;exports.getTransactionBufferCreateArgsEncoder=Et;exports.getTransactionBufferCreateCompressedDiscriminatorBytes=Xb;exports.getTransactionBufferCreateCompressedInstruction=Ia;exports.getTransactionBufferCreateCompressedInstructionDataCodec=$b;exports.getTransactionBufferCreateCompressedInstructionDataDecoder=xa;exports.getTransactionBufferCreateCompressedInstructionDataEncoder=Sa;exports.getTransactionBufferCreateDiscriminatorBytes=Gb;exports.getTransactionBufferCreateInstruction=ma;exports.getTransactionBufferCreateInstructionDataCodec=Fb;exports.getTransactionBufferCreateInstructionDataDecoder=pa;exports.getTransactionBufferCreateInstructionDataEncoder=ya;exports.getTransactionBufferDecoder=ws;exports.getTransactionBufferDiscriminatorBytes=Ph;exports.getTransactionBufferEncoder=jy;exports.getTransactionBufferExecuteCompressedDiscriminatorBytes=m_;exports.getTransactionBufferExecuteCompressedInstruction=Wa;exports.getTransactionBufferExecuteCompressedInstructionDataCodec=T_;exports.getTransactionBufferExecuteCompressedInstructionDataDecoder=Ua;exports.getTransactionBufferExecuteCompressedInstructionDataEncoder=_a;exports.getTransactionBufferExecuteDiscriminatorBytes=c_;exports.getTransactionBufferExecuteInstruction=Pa;exports.getTransactionBufferExecuteInstructionDataCodec=a_;exports.getTransactionBufferExecuteInstructionDataDecoder=ha;exports.getTransactionBufferExecuteInstructionDataEncoder=Ea;exports.getTransactionBufferExtendCompressedDiscriminatorBytes=__;exports.getTransactionBufferExtendCompressedInstruction=Ka;exports.getTransactionBufferExtendCompressedInstructionDataCodec=U_;exports.getTransactionBufferExtendCompressedInstructionDataDecoder=za;exports.getTransactionBufferExtendCompressedInstructionDataEncoder=Fa;exports.getTransactionBufferExtendDiscriminatorBytes=D_;exports.getTransactionBufferExtendInstruction=Na;exports.getTransactionBufferExtendInstructionDataCodec=M_;exports.getTransactionBufferExtendInstructionDataDecoder=ka;exports.getTransactionBufferExtendInstructionDataEncoder=wa;exports.getTransactionBufferVoteCompressedDiscriminatorBytes=Y_;exports.getTransactionBufferVoteCompressedInstruction=ni;exports.getTransactionBufferVoteCompressedInstructionDataCodec=Z_;exports.getTransactionBufferVoteCompressedInstructionDataDecoder=ri;exports.getTransactionBufferVoteCompressedInstructionDataEncoder=ti;exports.getTransactionBufferVoteDiscriminatorBytes=H_;exports.getTransactionBufferVoteInstruction=Xa;exports.getTransactionBufferVoteInstructionDataCodec=V_;exports.getTransactionBufferVoteInstructionDataDecoder=Za;exports.getTransactionBufferVoteInstructionDataEncoder=Ya;exports.getTransactionExecuteCompressedDiscriminatorBytes=AU;exports.getTransactionExecuteCompressedInstruction=mi;exports.getTransactionExecuteCompressedInstructionDataCodec=gU;exports.getTransactionExecuteCompressedInstructionDataDecoder=pi;exports.getTransactionExecuteCompressedInstructionDataEncoder=yi;exports.getTransactionExecuteDiscriminatorBytes=nU;exports.getTransactionExecuteInstruction=di;exports.getTransactionExecuteInstructionDataCodec=sU;exports.getTransactionExecuteInstructionDataDecoder=ii;exports.getTransactionExecuteInstructionDataEncoder=ai;exports.getTransactionExecuteSyncCompressedDiscriminatorBytes=vU;exports.getTransactionExecuteSyncCompressedInstruction=Pi;exports.getTransactionExecuteSyncCompressedInstructionDataCodec=bU;exports.getTransactionExecuteSyncCompressedInstructionDataDecoder=hi;exports.getTransactionExecuteSyncCompressedInstructionDataEncoder=Ei;exports.getTransactionExecuteSyncDiscriminatorBytes=xU;exports.getTransactionExecuteSyncInstruction=Ii;exports.getTransactionExecuteSyncInstructionDataCodec=IU;exports.getTransactionExecuteSyncInstructionDataDecoder=xi;exports.getTransactionExecuteSyncInstructionDataEncoder=Si;exports.getTransactionMessageAddressTableLookupCodec=aE;exports.getTransactionMessageAddressTableLookupDecoder=Hr;exports.getTransactionMessageAddressTableLookupEncoder=Nr;exports.getTransactionMessageCodec=sE;exports.getTransactionMessageDecoder=Rt;exports.getTransactionMessageEncoder=Pt;exports.getUserAccountAddress=N;exports.getUserCodec=AE;exports.getUserCreationArgsCodec=mE;exports.getUserCreationArgsDecoder=me;exports.getUserCreationArgsEncoder=pe;exports.getUserDecoder=J;exports.getUserEncoder=Oe;exports.getUserMutArgsCodec=SE;exports.getUserMutArgsDecoder=xe;exports.getUserMutArgsEncoder=Se;exports.getUserReadOnlyArgsCodec=DE;exports.getUserReadOnlyArgsDecoder=zr;exports.getUserReadOnlyArgsEncoder=Fr;exports.getUserReadOnlyOrMutateArgsCodec=PE;exports.getUserReadOnlyOrMutateArgsDecoder=Ue;exports.getUserReadOnlyOrMutateArgsEncoder=_e;exports.getUserRoleCodec=UE;exports.getUserRoleDecoder=Le;exports.getUserRoleEncoder=We;exports.getWalletAddressFromIndex=pd;exports.getWalletAddressFromSettings=Ce;exports.getWhitelistedAddressTreeCodec=Wh;exports.getWhitelistedAddressTreeDecoder=Fs;exports.getWhitelistedAddressTreeDiscriminatorBytes=Uh;exports.getWhitelistedAddressTreeEncoder=yp;exports.getWhitelistedAddressTreeFromIndex=bn;exports.getWhitelistedAddressTreeIndexFromAddress=aO;exports.getWhitelistedAddressTreesAddress=nd;exports.identifyMultiWalletAccount=TW;exports.identifyMultiWalletInstruction=fW;exports.initialize=OL;exports.isConfigAction=OD;exports.isMultiWalletError=MW;exports.isUserReadOnlyOrMutateArgs=vE;exports.migrateSettings=Dw;exports.migrateUsers=bw;exports.nativeTransferIntent=Bk;exports.parseAddWhitelistedAddressTreesInstruction=eP;exports.parseChangeConfigCompressedInstruction=SP;exports.parseChangeConfigInstruction=uP;exports.parseCompressSettingsAccountInstruction=RP;exports.parseCreateDomainConfigInstruction=kP;exports.parseCreateDomainUserAccountInstruction=qP;exports.parseCreateGlobalCounterInstruction=nR;exports.parseCreateMultiWalletCompressedInstruction=yR;exports.parseCreateUserAccountsInstruction=DR;exports.parseDecompressSettingsAccountInstruction=UR;exports.parseDisableDomainConfigInstruction=HR;exports.parseEditDomainConfigInstruction=ZR;exports.parseEditTransactionManagerUrlInstruction=ov;exports.parseEditUserDelegateInstruction=pv;exports.parseMigrateCompressedSettingsInstruction=Dv;exports.parseMigrateCompressedUsersInstruction=Uv;exports.parseNativeTransferIntentCompressedInstruction=Xv;exports.parseNativeTransferIntentInstruction=Gv;exports.parseSecp256r1VerifyInstruction=rB;exports.parseTokenTransferIntentCompressedInstruction=fb;exports.parseTokenTransferIntentInstruction=ab;exports.parseTransactionBufferCloseCompressedInstruction=Ob;exports.parseTransactionBufferCloseInstruction=hb;exports.parseTransactionBufferCreateCompressedInstruction=Qb;exports.parseTransactionBufferCreateInstruction=zb;exports.parseTransactionBufferExecuteCompressedInstruction=f_;exports.parseTransactionBufferExecuteInstruction=i_;exports.parseTransactionBufferExtendCompressedInstruction=W_;exports.parseTransactionBufferExtendInstruction=E_;exports.parseTransactionBufferVoteCompressedInstruction=X_;exports.parseTransactionBufferVoteInstruction=G_;exports.parseTransactionExecuteCompressedInstruction=yU;exports.parseTransactionExecuteInstruction=oU;exports.parseTransactionExecuteSyncCompressedInstruction=_U;exports.parseTransactionExecuteSyncInstruction=CU;exports.pollJitoBundleConfirmation=_O;exports.prepareTransactionBundle=p2;exports.prepareTransactionMessage=P2;exports.prepareTransactionSync=U2;exports.retrieveTransactionManager=UO;exports.sendJitoBundle=AC;exports.signAndSendBundledTransactions=vO;exports.signAndSendTransaction=bO;exports.signMessageWithPasskey=FN;exports.signTransactionWithPasskey=YN;exports.tokenTransferIntent=Jk;exports.uninitialize=LL;exports.userReadOnlyOrMutateArgs=RE;exports.vaultTransactionMessageDeserialize=Ui;exports.vaultTransactionMessageSerialize=_i;exports.verifyMessage=r2;exports.voteTransactionBuffer=kd;//# sourceMappingURL=index.cjs.map
|
|
1
|
+
'use strict';var gill=require('gill'),vn=require('bn.js'),stateless_js=require('@lightprotocol/stateless.js'),sha2_js=require('@noble/hashes/sha2.js'),web3_js=require('@solana/web3.js'),superstruct=require('superstruct'),programs=require('gill/programs'),tinyCbor=require('@levischuck/tiny-cbor'),nist_js=require('@noble/curves/nist.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var vn__default=/*#__PURE__*/_interopDefault(vn);var wn=new Uint8Array([201,232,212,229,59,241,106,197]);function VC(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(wn)}function Yd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["authority",gill.getAddressEncoder()],["rpIdHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["bump",gill.getU8Encoder()],["isDisabled",gill.getU8Encoder()],["rpIdLength",gill.getU8Encoder()],["numOrigins",gill.getU8Encoder()],["rpId",gill.fixEncoderSize(gill.getBytesEncoder(),255)],["origins",gill.fixEncoderSize(gill.getBytesEncoder(),515)]]),e=>({...e,discriminator:wn}))}function kn(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["authority",gill.getAddressDecoder()],["rpIdHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["bump",gill.getU8Decoder()],["isDisabled",gill.getU8Decoder()],["rpIdLength",gill.getU8Decoder()],["numOrigins",gill.getU8Decoder()],["rpId",gill.fixDecoderSize(gill.getBytesDecoder(),255)],["origins",gill.fixDecoderSize(gill.getBytesDecoder(),515)]])}function GC(){return gill.combineCodec(Yd(),kn())}function Nn(e){return gill.decodeAccount(e,kn())}async function Hn(e,n,r){let s=await Zd(e,n,r);return gill.assertAccountExists(s),s}async function Zd(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Nn(s)}async function FC(e,n,r){let s=await Xd(e,n,r);return gill.assertAccountsExist(s),s}async function Xd(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Nn(t))}function zC(){return 846}var Fn=new Uint8Array([42,206,176,58,175,129,130,233]);function jC(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Fn)}function Au(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()]]),e=>({...e,discriminator:Fn}))}function zn(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()]])}function qC(){return gill.combineCodec(Au(),zn())}function Kn(e){return gill.decodeAccount(e,zn())}async function YC(e,n,r){let s=await gu(e,n,r);return gill.assertAccountExists(s),s}async function gu(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Kn(s)}async function ZC(e,n,r){let s=await yu(e,n,r);return gill.assertAccountsExist(s),s}async function yu(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Kn(t))}function XC(){return 24}function Ar(){return gill.getStructEncoder([["memberKey",$()],["permissions",Re()],["verifyArgs",gill.getOptionEncoder(B())],["userArgs",be()]])}function gr(){return gill.getStructDecoder([["memberKey",Q()],["permissions",ve()],["verifyArgs",gill.getOptionDecoder(w())],["userArgs",_e()]])}function tD(){return gill.combineCodec(Ar(),gr())}function yr(){return gill.getStructEncoder([["programAddressIndex",gill.getU8Encoder()],["accountIndices",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["data",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function mr(){return gill.getStructDecoder([["programAddressIndex",gill.getU8Decoder()],["accountIndices",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["data",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function sD(){return gill.combineCodec(yr(),mr())}function rt(){return gill.getStructEncoder([["treeInfo",st()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["outputStateTreeIndex",gill.getU8Encoder()]])}function nt(){return gill.getStructDecoder([["treeInfo",ot()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["outputStateTreeIndex",gill.getU8Decoder()]])}function iD(){return gill.combineCodec(rt(),nt())}function ct(){return gill.getStructEncoder([["treeInfo",st()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function at(){return gill.getStructDecoder([["treeInfo",ot()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function gD(){return gill.combineCodec(ct(),at())}function Sr(){return gill.getStructEncoder([["a",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["b",gill.fixEncoderSize(gill.getBytesEncoder(),64)],["c",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function xr(){return gill.getStructDecoder([["a",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["b",gill.fixDecoderSize(gill.getBytesDecoder(),64)],["c",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function pD(){return gill.combineCodec(Sr(),xr())}function it(){return gill.getStructEncoder([["data",gill.getOptionEncoder(dt())]])}function z(){return gill.getStructDecoder([["data",gill.getOptionDecoder(ut())]])}function SD(){return gill.combineCodec(it(),z())}function dt(){return gill.getStructEncoder([["threshold",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["index",gill.getU128Encoder()],["multiWalletBump",gill.getU8Encoder()],["members",gill.getArrayEncoder(At())],["settingsAddressTreeIndex",gill.getU8Encoder()]])}function ut(){return gill.getStructDecoder([["threshold",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["index",gill.getU128Decoder()],["multiWalletBump",gill.getU8Decoder()],["members",gill.getArrayDecoder(gt())],["settingsAddressTreeIndex",gill.getU8Decoder()]])}function DD(){return gill.combineCodec(dt(),ut())}function yt(){return gill.getDiscriminatedUnionEncoder([["EditPermissions",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Dr())])]])],["AddMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Ar())])]])],["RemoveMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Er())])]])],["SetThreshold",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getU8Encoder()])]])]])}function mt(){return gill.getDiscriminatedUnionDecoder([["EditPermissions",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(Mr())])]])],["AddMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(gr())])]])],["RemoveMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(hr())])]])],["SetThreshold",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getU8Decoder()])]])]])}function PD(){return gill.combineCodec(yt(),mt())}function RD(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function vD(e,n){return n.__kind===e}function Pr(){return gill.getStructEncoder([["member",gill.getAddressEncoder()],["role",Ue()],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userCreationArgs",ye()]])}function Rr(){return gill.getStructDecoder([["member",gill.getAddressDecoder()],["role",We()],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userCreationArgs",me()]])}function WD(){return gill.combineCodec(Pr(),Rr())}function Dr(){return gill.getStructEncoder([["memberKey",$()],["permissions",Re()]])}function Mr(){return gill.getStructDecoder([["memberKey",Q()],["permissions",ve()]])}function wD(){return gill.combineCodec(Dr(),Mr())}function pt(){return gill.getStructEncoder([["memberKey",$()],["messageHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function Tt(){return gill.getStructDecoder([["memberKey",Q()],["messageHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function VD(){return gill.combineCodec(pt(),Tt())}function vr(){return gill.getStructEncoder([["settingsMutArgs",de()],["transactionManager",gill.getOptionEncoder(fe())]])}function br(){return gill.getStructDecoder([["settingsMutArgs",ue()],["transactionManager",gill.getOptionDecoder(Se())]])}function KD(){return gill.combineCodec(vr(),br())}function At(){return gill.getStructEncoder([["pubkey",$()],["permissions",Re()],["role",gill.getU8Encoder()],["userAddressTreeIndex",gill.getU8Encoder()],["isDelegate",gill.getU8Encoder()]])}function gt(){return gill.getStructDecoder([["pubkey",Q()],["permissions",ve()],["role",gill.getU8Decoder()],["userAddressTreeIndex",gill.getU8Decoder()],["isDelegate",gill.getU8Decoder()]])}function YD(){return gill.combineCodec(At(),gt())}function $(){return gill.getStructEncoder([["keyType",gill.getU8Encoder()],["key",gill.fixEncoderSize(gill.getBytesEncoder(),33)]])}function Q(){return gill.getStructDecoder([["keyType",gill.getU8Decoder()],["key",gill.fixDecoderSize(gill.getBytesDecoder(),33)]])}function $D(){return gill.combineCodec($(),Q())}function Wr(){return gill.getStructEncoder([["authorityCreationArgs",ye()],["compressedProofArgs",D()]])}function Lr(){return gill.getStructDecoder([["authorityCreationArgs",me()],["compressedProofArgs",M()]])}function rM(){return gill.combineCodec(Wr(),Lr())}function lt(){return gill.getStructEncoder([["addressMerkleTreePubkeyIndex",gill.getU8Encoder()],["addressQueuePubkeyIndex",gill.getU8Encoder()],["rootIndex",gill.getU16Encoder()]])}function ft(){return gill.getStructDecoder([["addressMerkleTreePubkeyIndex",gill.getU8Decoder()],["addressQueuePubkeyIndex",gill.getU8Decoder()],["rootIndex",gill.getU16Decoder()]])}function oM(){return gill.combineCodec(lt(),ft())}function st(){return gill.getStructEncoder([["rootIndex",gill.getU16Encoder()],["proveByIndex",gill.getBooleanEncoder()],["merkleTreePubkeyIndex",gill.getU8Encoder()],["queuePubkeyIndex",gill.getU8Encoder()],["leafIndex",gill.getU32Encoder()]])}function ot(){return gill.getStructDecoder([["rootIndex",gill.getU16Decoder()],["proveByIndex",gill.getBooleanDecoder()],["merkleTreePubkeyIndex",gill.getU8Decoder()],["queuePubkeyIndex",gill.getU8Decoder()],["leafIndex",gill.getU32Decoder()]])}function iM(){return gill.combineCodec(st(),ot())}function Re(){return gill.getStructEncoder([["mask",gill.getU8Encoder()]])}function ve(){return gill.getStructDecoder([["mask",gill.getU8Decoder()]])}function AM(){return gill.combineCodec(Re(),ve())}function D(){return gill.getStructEncoder([["proof",gill.getOptionEncoder(Sr())],["lightCpiAccountsStartIndex",gill.getU8Encoder()]])}function M(){return gill.getStructDecoder([["proof",gill.getOptionDecoder(xr())],["lightCpiAccountsStartIndex",gill.getU8Decoder()]])}function pM(){return gill.combineCodec(D(),M())}function Er(){return gill.getStructEncoder([["memberKey",$()],["userArgs",be()]])}function hr(){return gill.getStructDecoder([["memberKey",Q()],["userArgs",_e()]])}function SM(){return gill.combineCodec(Er(),hr())}function Or(){return gill.getTupleEncoder([gill.fixEncoderSize(gill.getBytesEncoder(),33)])}function St(){return gill.getTupleDecoder([gill.fixDecoderSize(gill.getBytesDecoder(),33)])}function CM(){return gill.combineCodec(Or(),St())}function B(){return gill.getStructEncoder([["signedMessageIndex",gill.getU8Encoder()],["slotNumber",gill.getU64Encoder()],["originIndex",gill.getU8Encoder()],["crossOrigin",gill.getBooleanEncoder()],["truncatedClientDataJson",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["clientAndDeviceHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function w(){return gill.getStructDecoder([["signedMessageIndex",gill.getU8Decoder()],["slotNumber",gill.getU64Decoder()],["originIndex",gill.getU8Decoder()],["crossOrigin",gill.getBooleanDecoder()],["truncatedClientDataJson",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["clientAndDeviceHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function EM(){return gill.combineCodec(B(),w())}function ee(){return gill.getStructEncoder([["domainConfigKey",gill.getAddressEncoder()],["verifyArgs",B()]])}function te(){return gill.getStructDecoder([["domainConfigKey",gill.getAddressDecoder()],["verifyArgs",w()]])}function vM(){return gill.combineCodec(ee(),te())}function xt(){return gill.getStructEncoder([["addressTreeInfo",lt()],["outputStateTreeIndex",gill.getU8Encoder()]])}function It(){return gill.getStructDecoder([["addressTreeInfo",ft()],["outputStateTreeIndex",gill.getU8Decoder()]])}function WM(){return gill.combineCodec(xt(),It())}function Ct(){return gill.getStructEncoder([["index",gill.getU128Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()]])}function Dt(){return gill.getStructDecoder([["index",gill.getU128Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()]])}function BM(){return gill.combineCodec(Ct(),Dt())}function de(){return gill.getStructEncoder([["accountMeta",rt()],["data",it()]])}function ue(){return gill.getStructDecoder([["accountMeta",nt()],["data",z()]])}function HM(){return gill.combineCodec(de(),ue())}function ne(){return gill.getStructEncoder([["accountMeta",ct()],["data",it()]])}function se(){return gill.getStructDecoder([["accountMeta",at()],["data",z()]])}function zM(){return gill.combineCodec(ne(),se())}function Mt(){return gill.getStructEncoder([["bufferIndex",gill.getU8Encoder()],["preauthorizeExecution",gill.getBooleanEncoder()],["bufferExtendHashes",gill.getArrayEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))],["finalBufferHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["finalBufferSize",gill.getU16Encoder()],["expectedSecp256r1Signers",gill.getOptionEncoder(gill.getArrayEncoder(pt()))]])}function Et(){return gill.getStructDecoder([["bufferIndex",gill.getU8Decoder()],["preauthorizeExecution",gill.getBooleanDecoder()],["bufferExtendHashes",gill.getArrayDecoder(gill.fixDecoderSize(gill.getBytesDecoder(),32))],["finalBufferHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["finalBufferSize",gill.getU16Decoder()],["expectedSecp256r1Signers",gill.getOptionDecoder(gill.getArrayDecoder(Tt()))]])}function qM(){return gill.combineCodec(Mt(),Et())}function ht(){return gill.getStructEncoder([["numSigners",gill.getU8Encoder()],["numWritableSigners",gill.getU8Encoder()],["numWritableNonSigners",gill.getU8Encoder()],["numAccountKeys",gill.getU8Encoder()],["instructions",gill.getArrayEncoder(yr())],["addressTableLookups",gill.getArrayEncoder(Br())]])}function Pt(){return gill.getStructDecoder([["numSigners",gill.getU8Decoder()],["numWritableSigners",gill.getU8Decoder()],["numWritableNonSigners",gill.getU8Decoder()],["numAccountKeys",gill.getU8Decoder()],["instructions",gill.getArrayDecoder(mr())],["addressTableLookups",gill.getArrayDecoder(wr())]])}function $M(){return gill.combineCodec(ht(),Pt())}function Br(){return gill.getStructEncoder([["lookupTableAddressIndex",gill.getU8Encoder()],["writableIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["readonlyIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function wr(){return gill.getStructDecoder([["lookupTableAddressIndex",gill.getU8Decoder()],["writableIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["readonlyIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function tE(){return gill.combineCodec(Br(),wr())}function Le(){return gill.getStructEncoder([["member",$()],["domainConfig",gill.getOptionEncoder(gill.getAddressEncoder())],["role",Ue()],["delegatedTo",gill.getOptionEncoder(Ct())],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userAddressTreeIndex",gill.getU8Encoder()]])}function J(){return gill.getStructDecoder([["member",Q()],["domainConfig",gill.getOptionDecoder(gill.getAddressDecoder())],["role",We()],["delegatedTo",gill.getOptionDecoder(Dt())],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userAddressTreeIndex",gill.getU8Decoder()]])}function oE(){return gill.combineCodec(Le(),J())}function ye(){return gill.getStructEncoder([["addressTreeInfo",lt()],["outputStateTreeIndex",gill.getU8Encoder()]])}function me(){return gill.getStructDecoder([["addressTreeInfo",ft()],["outputStateTreeIndex",gill.getU8Decoder()]])}function dE(){return gill.combineCodec(ye(),me())}function fe(){return gill.getStructEncoder([["accountMeta",rt()],["data",Le()]])}function Se(){return gill.getStructDecoder([["accountMeta",nt()],["data",J()]])}function yE(){return gill.combineCodec(fe(),Se())}function Hr(){return gill.getStructEncoder([["accountMeta",ct()],["data",Le()]])}function Vr(){return gill.getStructDecoder([["accountMeta",at()],["data",J()]])}function lE(){return gill.combineCodec(Hr(),Vr())}function be(){return gill.getDiscriminatedUnionEncoder([["Read",gill.getStructEncoder([["fields",gill.getTupleEncoder([Hr()])]])],["Mutate",gill.getStructEncoder([["fields",gill.getTupleEncoder([fe()])]])]])}function _e(){return gill.getDiscriminatedUnionDecoder([["Read",gill.getStructDecoder([["fields",gill.getTupleDecoder([Vr()])]])],["Mutate",gill.getStructDecoder([["fields",gill.getTupleDecoder([Se()])]])]])}function IE(){return gill.combineCodec(be(),_e())}function CE(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function DE(e,n){return n.__kind===e}var Oe=(t=>(t[t.Member=0]="Member",t[t.PermanentMember=1]="PermanentMember",t[t.TransactionManager=2]="TransactionManager",t[t.Administrator=3]="Administrator",t))(Oe||{});function Ue(){return gill.getEnumEncoder(Oe)}function We(){return gill.getEnumDecoder(Oe)}function hE(){return gill.combineCodec(Ue(),We())}var hs=new Uint8Array([223,179,163,190,177,224,67,173]);function yh(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(hs)}function Iy(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()],["members",gill.getArrayEncoder(At(),{size:4})],["membersLen",gill.getU8Encoder()],["threshold",gill.getU8Encoder()],["multiWalletBump",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()],["padding",gill.fixEncoderSize(gill.getBytesEncoder(),3)]]),e=>({...e,discriminator:hs}))}function Ps(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()],["members",gill.getArrayDecoder(gt(),{size:4})],["membersLen",gill.getU8Decoder()],["threshold",gill.getU8Decoder()],["multiWalletBump",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()],["padding",gill.fixDecoderSize(gill.getBytesDecoder(),3)]])}function mh(){return gill.combineCodec(Iy(),Ps())}function Rs(e){return gill.decodeAccount(e,Ps())}async function ph(e,n,r){let s=await zr(e,n,r);return gill.assertAccountExists(s),s}async function zr(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Rs(s)}async function Th(e,n,r){let s=await Cy(e,n,r);return gill.assertAccountsExist(s),s}async function Cy(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Rs(t))}function lh(){return 184}var Ws=new Uint8Array([90,36,35,219,93,225,110,96]);function Ih(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Ws)}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",$()],["executor",$()],["bufferExtendHashes",gill.getArrayEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))],["voters",gill.getArrayEncoder($())],["expectedSecp256r1Signers",gill.getOptionEncoder(gill.getArrayEncoder(pt()))],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:Ws}))}function Ls(){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",Q()],["executor",Q()],["bufferExtendHashes",gill.getArrayDecoder(gill.fixDecoderSize(gill.getBytesDecoder(),32))],["voters",gill.getArrayDecoder(Q())],["expectedSecp256r1Signers",gill.getOptionDecoder(gill.getArrayDecoder(Tt()))],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function Ch(){return gill.combineCodec(Gy(),Ls())}function Os(e){return gill.decodeAccount(e,Ls())}async function Bs(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 Os(s)}async function Dh(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=>Os(t))}var Ns=new Uint8Array([105,23,173,2,197,255,80,87]);function hh(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Ns)}function im(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["whitelistedAddressTrees",gill.getArrayEncoder(gill.getAddressEncoder())],["bump",gill.getU8Encoder()]]),e=>({...e,discriminator:Ns}))}function Hs(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["whitelistedAddressTrees",gill.getArrayDecoder(gill.getAddressDecoder())],["bump",gill.getU8Decoder()]])}function Ph(){return gill.combineCodec(im(),Hs())}function Vs(e){return gill.decodeAccount(e,Hs())}async function Gs(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 Vs(s)}async function Rh(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=>Vs(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 zs(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}function K(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:K(r.value),role:Fs(r.value)?gill.upgradeRoleToSigner(s):s,...Fs(r.value)?{signer:r.value}:{}})}}function Fs(e){return !!e&&typeof e=="object"&&"address"in e&&gill.isTransactionSigner(e)}var Js=new Uint8Array([8]);function Kh(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Js)}function $r(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["addressTree",gill.getAddressEncoder()]]),e=>({...e,discriminator:Js}))}function js(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["addressTree",gill.getAddressDecoder()]])}function Jh(){return gill.combineCodec($r(),js())}async function qs(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...a],data:$r().encode(c),programAddress:r})}function jh(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...a],data:$r().encode(c),programAddress:r})}function qh(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:js().decode(e.data)}}var $s=new Uint8Array([9]);function tP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode($s)}function Qr(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsIndex",gill.getU128Encoder()],["configActions",gill.getArrayEncoder(yt())],["compressedProofArgs",gill.getOptionEncoder(D())]]),e=>({...e,discriminator:$s}))}function Qs(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsIndex",gill.getU128Decoder()],["configActions",gill.getArrayDecoder(mt())],["compressedProofArgs",gill.getOptionDecoder(M())]])}function rP(){return gill.combineCodec(Qr(),Qs())}async function eo(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.settings.value||(t.settings.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getU128Encoder().encode(zs(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(K(t.settings.value)),gill.getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.authority),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Qr().encode(c),programAddress:r})}function nP(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.authority),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Qr().encode(c),programAddress:r})}function sP(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),authority:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Qs().decode(e.data)}}var no=new Uint8Array([20]);function AP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(no)}function so(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["configActions",gill.getArrayEncoder(yt())],["settingsMut",de()],["compressedProofArgs",D()]]),e=>({...e,discriminator:no}))}function oo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["configActions",gill.getArrayDecoder(mt())],["settingsMut",ue()],["compressedProofArgs",M()]])}function gP(){return gill.combineCodec(so(),oo())}function co(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.authority),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:so().encode(c),programAddress:r})}function yP(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),authority:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:oo().decode(e.data)}}var uo=new Uint8Array([17]);function xP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(uo)}function Ao(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",D()],["settingsMutArgs",de()],["secp256r1VerifyArgs",gill.getArrayEncoder(ee())]]),e=>({...e,discriminator:uo}))}function go(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",M()],["settingsMutArgs",ue()],["secp256r1VerifyArgs",gill.getArrayDecoder(te())]])}function IP(){return gill.combineCodec(Ao(),go())}function yo(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Ao().encode(c),programAddress:r})}function CP(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:go().decode(e.data)}}var Io=new Uint8Array([0]);function vP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Io)}function tn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["rpId",gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())],["origins",gill.getArrayEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["authorityCreationArgs",ye()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Io}))}function Co(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["rpId",gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())],["origins",gill.getArrayDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["authorityCreationArgs",me()],["compressedProofArgs",M()]])}function bP(){return gill.combineCodec(tn(),Co())}async function Do(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:tn().encode(c),programAddress:r})}function _P(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:tn().encode(c),programAddress:r})}function UP(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:Co().decode(e.data)}}var Eo=new Uint8Array([4]);function NP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Eo)}function nn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",D()],["member",Or()],["role",Ue()],["userAccountCreationArgs",ye()],["linkWalletArgs",gill.getOptionEncoder(vr())]]),e=>({...e,discriminator:Eo}))}function ho(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",M()],["member",St()],["role",We()],["userAccountCreationArgs",me()],["linkWalletArgs",gill.getOptionDecoder(br())]])}function HP(){return gill.combineCodec(nn(),ho())}async function Po(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...a],data:nn().encode(c),programAddress:r})}function VP(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...a],data:nn().encode(c),programAddress:r})}function GP(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:ho().decode(e.data)}}var vo=new Uint8Array([3]);function qP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(vo)}function on(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:vo}))}function bo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function YP(){return gill.combineCodec(on(),bo())}async function _o(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(c),a=p(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:on().encode({}),programAddress:r})}function ZP(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(c),a=p(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:on().encode({}),programAddress:r})}function XP(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:bo().decode(e.data)}}var Lo=new Uint8Array([19]);function sR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Lo)}function cn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["compressedProofArgs",D()],["settingsCreation",xt()],["userArgs",be()],["settingsIndex",gill.getU128Encoder()]]),e=>({...e,discriminator:Lo}))}function Oo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["compressedProofArgs",M()],["settingsCreation",It()],["userArgs",_e()],["settingsIndex",gill.getU128Decoder()]])}function oR(){return gill.combineCodec(cn(),Oo())}async function Bo(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.globalCounter.value||(t.globalCounter.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),o(t.globalCounter),o(t.whitelistedAddressTrees),...a],data:cn().encode(c),programAddress:r})}function cR(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),o(t.globalCounter),o(t.whitelistedAddressTrees),...a],data:cn().encode(c),programAddress:r})}function aR(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s(),globalCounter:r(),whitelistedAddressTrees:r()},data:Oo().decode(e.data)}}var ko=new Uint8Array([5]);function mR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ko)}function dn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",D()],["createUserArgs",gill.getArrayEncoder(Pr())]]),e=>({...e,discriminator:ko}))}function No(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",M()],["createUserArgs",gill.getArrayDecoder(Rr())]])}function pR(){return gill.combineCodec(dn(),No())}async function Ho(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:dn().encode(c),programAddress:r})}function TR(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:dn().encode(c),programAddress:r})}function lR(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:No().decode(e.data)}}var Fo=new Uint8Array([18]);function MR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Fo)}function zo(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsMut",de()],["compressedProofArgs",D()],["secp256r1VerifyArgs",gill.getArrayEncoder(ee())]]),e=>({...e,discriminator:Fo}))}function Ko(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsMut",ue()],["compressedProofArgs",M()],["secp256r1VerifyArgs",gill.getArrayDecoder(te())]])}function ER(){return gill.combineCodec(zo(),Ko())}function Jo(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:zo().encode(c),programAddress:r})}function hR(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Ko().decode(e.data)}}var Yo=new Uint8Array([2]);function UR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Yo)}function Zo(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["disable",gill.getBooleanEncoder()]]),e=>({...e,discriminator:Yo}))}function Xo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["disable",gill.getBooleanDecoder()]])}function WR(){return gill.combineCodec(Zo(),Xo())}function $o(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},a=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),...a],data:Zo().encode(c),programAddress:r})}function LR(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:Xo().decode(e.data)}}var rc=new Uint8Array([1]);function VR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(rc)}function An(){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(Wr())]]),e=>({...e,discriminator:rc}))}function nc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["newOrigins",gill.getOptionDecoder(gill.getArrayDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())))],["newAuthorityArgs",gill.getOptionDecoder(Lr())]])}function GR(){return gill.combineCodec(An(),nc())}async function FR(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...a],data:An().encode(c),programAddress:r})}function sc(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...a],data:An().encode(c),programAddress:r})}function zR(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:s(),whitelistedAddressTrees:s(),systemProgram:r()},data:nc().decode(e.data)}}var ac=new Uint8Array([6]);function XR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ac)}function ic(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",fe()],["transactionManagerUrl",gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())],["compressedProofArgs",D()]]),e=>({...e,discriminator:ac}))}function dc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",Se()],["transactionManagerUrl",gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())],["compressedProofArgs",M()]])}function $R(){return gill.combineCodec(ic(),dc())}function uc(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.authority),...a],data:ic().encode(c),programAddress:r})}function QR(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:dc().decode(e.data)}}var yc=new Uint8Array([7]);function cv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(yc)}function mc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",fe()],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["delegateTo",gill.getOptionEncoder(Ct())],["oldSettingsMutArgs",gill.getOptionEncoder(de())],["newSettingsMutArgs",gill.getOptionEncoder(de())],["compressedProofArgs",D()]]),e=>({...e,discriminator:yc}))}function pc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",Se()],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["delegateTo",gill.getOptionDecoder(Dt())],["oldSettingsMutArgs",gill.getOptionDecoder(ue())],["newSettingsMutArgs",gill.getOptionDecoder(ue())],["compressedProofArgs",M()]])}function av(){return gill.combineCodec(mc(),pc())}function Tc(e,n){let r=n?.programAddress??A,t={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},oldSettings:{value:e.oldSettings??null,isWritable:true},newSettings:{value:e.newSettings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.feePayer),o(t.signer),o(t.oldSettings),o(t.newSettings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),...a],data:mc().encode(c),programAddress:r})}function iv(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{feePayer:r(),signer:s(),oldSettings:s(),newSettings:s(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s()},data:pc().decode(e.data)}}var Sc=new Uint8Array([33]);function pv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Sc)}function xc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",dt()],["compressedProofArgs",D()],["settingsCreationArgs",xt()]]),e=>({...e,discriminator:Sc}))}function Ic(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",ut()],["compressedProofArgs",M()],["settingsCreationArgs",It()]])}function Tv(){return gill.combineCodec(xc(),Ic())}function Cc(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.authority),...a],data:xc().encode(c),programAddress:r})}function lv(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 Ec=new Uint8Array([32]);function Mv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ec)}function hc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Le()],["compressedProofArgs",D()],["userCreationArgs",ye()]]),e=>({...e,discriminator:Ec}))}function Pc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",J()],["compressedProofArgs",M()],["userCreationArgs",me()]])}function Ev(){return gill.combineCodec(hc(),Pc())}function Rc(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.authority),...a],data:hc().encode(c),programAddress:r})}function hv(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 bc=new Uint8Array([30]);function Wv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(bc)}function gn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(ee())]]),e=>({...e,discriminator:bc}))}function _c(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(te())]])}function Lv(){return gill.combineCodec(gn(),_c())}async function Ov(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getAddressEncoder().encode(K(t.settings.value)),gill.getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...a],data:gn().encode(c),programAddress:r})}function Uc(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...a],data:gn().encode(c),programAddress:r})}function Bv(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:_c().decode(e.data)}}var Oc=new Uint8Array([28]);function Fv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Oc)}function Bc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(ee())],["settingsReadonlyArgs",ne()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Oc}))}function wc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(te())],["settingsReadonlyArgs",se()],["compressedProofArgs",M()]])}function zv(){return gill.combineCodec(Bc(),wc())}function kc(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...a],data:Bc().encode(c),programAddress:r})}function Kv(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:wc().decode(e.data)}}var Hc=new Uint8Array([31]);function $v(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Hc)}function mn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["createAtaIfNeeded",gill.getBooleanEncoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(ee())]]),e=>({...e,discriminator:Hc}))}function Vc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["createAtaIfNeeded",gill.getBooleanDecoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(te())]])}function Qv(){return gill.combineCodec(mn(),Vc())}async function eb(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getAddressEncoder().encode(K(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(K(t.source.value)),gill.getAddressEncoder().encode(K(t.tokenProgram.value)),gill.getAddressEncoder().encode(K(t.mint.value))]})),t.destinationTokenAccount.value||(t.destinationTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(K(t.destination.value)),gill.getAddressEncoder().encode(K(t.tokenProgram.value)),gill.getAddressEncoder().encode(K(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...a],data:mn().encode(c),programAddress:r})}function Gc(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...a],data:mn().encode(c),programAddress:r})}function tb(e){if(e.accounts.length<11)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceTokenAccount:r(),destination:r(),destinationTokenAccount:r(),tokenProgram:r(),mint:r(),systemProgram:r(),associatedTokenProgram:r()},data:Vc().decode(e.data)}}var Jc=new Uint8Array([29]);function ib(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Jc)}function pn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["createAtaIfNeeded",gill.getBooleanEncoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(ee())],["settingsReadonlyArgs",ne()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Jc}))}function jc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["createAtaIfNeeded",gill.getBooleanDecoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(te())],["settingsReadonlyArgs",se()],["compressedProofArgs",M()]])}function db(){return gill.combineCodec(pn(),jc())}async function ub(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceTokenAccount.value||(t.sourceTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(K(t.source.value)),gill.getAddressEncoder().encode(K(t.tokenProgram.value)),gill.getAddressEncoder().encode(K(t.mint.value))]})),t.destinationTokenAccount.value||(t.destinationTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(K(t.destination.value)),gill.getAddressEncoder().encode(K(t.tokenProgram.value)),gill.getAddressEncoder().encode(K(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...a],data:pn().encode(c),programAddress:r})}function qc(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...a],data:pn().encode(c),programAddress:r})}function Ab(e){if(e.accounts.length<11)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceTokenAccount:r(),destination:r(),destinationTokenAccount:r(),tokenProgram:r(),mint:r(),systemProgram:r(),associatedTokenProgram:r()},data:jc().decode(e.data)}}var Xc=new Uint8Array([13]);function fb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Xc)}function $c(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())]]),e=>({...e,discriminator:Xc}))}function Qc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function Sb(){return gill.combineCodec($c(),Qc())}function ea(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:$c().encode(c),programAddress:r})}function xb(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:Qc().decode(e.data)}}var na=new Uint8Array([24]);function Pb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(na)}function sa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["settingsReadonlyArgs",ne()],["compressedProofArgs",D()]]),e=>({...e,discriminator:na}))}function oa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["settingsReadonlyArgs",se()],["compressedProofArgs",M()]])}function Rb(){return gill.combineCodec(sa(),oa())}function ca(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.rentCollector),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:sa().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===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:oa().decode(e.data)}}var da=new Uint8Array([10]);function Bb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(da)}function ua(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Mt()],["secp256r1VerifyArgs",gill.getOptionEncoder(B())]]),e=>({...e,discriminator:da}))}function Aa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",Et()],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function wb(){return gill.combineCodec(ua(),Aa())}function ga(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...a],data:ua().encode(c),programAddress:r})}function kb(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:Aa().decode(e.data)}}var pa=new Uint8Array([21]);function Kb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(pa)}function Ta(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Mt()],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["settingsReadonlyArgs",ne()],["compressedProofArgs",D()]]),e=>({...e,discriminator:pa}))}function la(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",Et()],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["settingsReadonlyArgs",se()],["compressedProofArgs",M()]])}function Jb(){return gill.combineCodec(Ta(),la())}function fa(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...a],data:Ta().encode(c),programAddress:r})}function jb(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:la().decode(e.data)}}var Ia=new Uint8Array([14]);function e_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ia)}function Ca(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())]]),e=>({...e,discriminator:Ia}))}function Da(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function t_(){return gill.combineCodec(Ca(),Da())}function Ma(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Ca().encode(c),programAddress:r})}function r_(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Da().decode(e.data)}}var Pa=new Uint8Array([25]);function d_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Pa)}function Ra(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["settingsReadonlyArgs",ne()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Pa}))}function va(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["settingsReadonlyArgs",se()],["compressedProofArgs",M()]])}function u_(){return gill.combineCodec(Ra(),va())}function ba(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Ra().encode(c),programAddress:r})}function A_(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:va().decode(e.data)}}var Wa=new Uint8Array([12]);function l_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Wa)}function La(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:Wa}))}function Oa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function f_(){return gill.combineCodec(La(),Oa())}function Ba(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.transactionBuffer),...a],data:La().encode(c),programAddress:r})}function S_(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:Oa().decode(e.data)}}var Na=new Uint8Array([23]);function E_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Na)}function Ha(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:Na}))}function Va(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["settingsKey",gill.getAddressDecoder()]])}function h_(){return gill.combineCodec(Ha(),Va())}function Ga(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.transactionBuffer),...a],data:Ha().encode(c),programAddress:r})}function P_(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:Va().decode(e.data)}}var Ka=new Uint8Array([11]);function L_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ka)}function Ja(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())]]),e=>({...e,discriminator:Ka}))}function ja(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function O_(){return gill.combineCodec(Ja(),ja())}function qa(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Ja().encode(c),programAddress:r})}function B_(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:ja().decode(e.data)}}var Xa=new Uint8Array([22]);function F_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Xa)}function $a(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["settingsReadonlyArgs",ne()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Xa}))}function Qa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["settingsReadonlyArgs",se()],["compressedProofArgs",M()]])}function z_(){return gill.combineCodec($a(),Qa())}function ei(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:$a().encode(c),programAddress:r})}function K_(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Qa().decode(e.data)}}var ni=new Uint8Array([15]);function X_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ni)}function si(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:ni}))}function oi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function $_(){return gill.combineCodec(si(),oi())}function ci(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},i=m({}),a=p(r);return Object.freeze({accounts:[a(t.settings),a(t.payer),a(t.transactionBuffer),...i],data:si().encode({}),programAddress:r})}function Q_(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:oi().decode(e.data)}}var di=new Uint8Array([26]);function oU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(di)}function ui(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:di}))}function Ai(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsKey",gill.getAddressDecoder()]])}function cU(){return gill.combineCodec(ui(),Ai())}function gi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.transactionBuffer),...a],data:ui().encode(c),programAddress:r})}function aU(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:Ai().decode(e.data)}}var pi=new Uint8Array([16]);function mU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(pi)}function Ti(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",ht()],["secp256r1VerifyArgs",gill.getArrayEncoder(ee())]]),e=>({...e,discriminator:pi}))}function li(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",Pt()],["secp256r1VerifyArgs",gill.getArrayDecoder(te())]])}function pU(){return gill.combineCodec(Ti(),li())}function fi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Ti().encode(c),programAddress:r})}function TU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:li().decode(e.data)}}var Ii=new Uint8Array([27]);function DU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ii)}function Ci(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",ht()],["secp256r1VerifyArgs",gill.getArrayEncoder(ee())],["settingsReadonlyArgs",ne()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Ii}))}function Di(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",Pt()],["secp256r1VerifyArgs",gill.getArrayDecoder(te())],["settingsReadonlyArgs",se()],["compressedProofArgs",M()]])}function MU(){return gill.combineCodec(Ci(),Di())}function Mi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Ci().encode(c),programAddress:r})}function EU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Di().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",JS=(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))(JS||{});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 jS=(l=>(l[l.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",l[l.ChangeConfig=1]="ChangeConfig",l[l.ChangeConfigCompressed=2]="ChangeConfigCompressed",l[l.CompressSettingsAccount=3]="CompressSettingsAccount",l[l.CreateDomainConfig=4]="CreateDomainConfig",l[l.CreateDomainUserAccount=5]="CreateDomainUserAccount",l[l.CreateGlobalCounter=6]="CreateGlobalCounter",l[l.CreateMultiWalletCompressed=7]="CreateMultiWalletCompressed",l[l.CreateUserAccounts=8]="CreateUserAccounts",l[l.DecompressSettingsAccount=9]="DecompressSettingsAccount",l[l.DisableDomainConfig=10]="DisableDomainConfig",l[l.EditDomainConfig=11]="EditDomainConfig",l[l.EditTransactionManagerUrl=12]="EditTransactionManagerUrl",l[l.EditUserDelegate=13]="EditUserDelegate",l[l.MigrateCompressedSettings=14]="MigrateCompressedSettings",l[l.MigrateCompressedUsers=15]="MigrateCompressedUsers",l[l.NativeTransferIntent=16]="NativeTransferIntent",l[l.NativeTransferIntentCompressed=17]="NativeTransferIntentCompressed",l[l.TokenTransferIntent=18]="TokenTransferIntent",l[l.TokenTransferIntentCompressed=19]="TokenTransferIntentCompressed",l[l.TransactionBufferClose=20]="TransactionBufferClose",l[l.TransactionBufferCloseCompressed=21]="TransactionBufferCloseCompressed",l[l.TransactionBufferCreate=22]="TransactionBufferCreate",l[l.TransactionBufferCreateCompressed=23]="TransactionBufferCreateCompressed",l[l.TransactionBufferExecute=24]="TransactionBufferExecute",l[l.TransactionBufferExecuteCompressed=25]="TransactionBufferExecuteCompressed",l[l.TransactionBufferExtend=26]="TransactionBufferExtend",l[l.TransactionBufferExtendCompressed=27]="TransactionBufferExtendCompressed",l[l.TransactionBufferVote=28]="TransactionBufferVote",l[l.TransactionBufferVoteCompressed=29]="TransactionBufferVoteCompressed",l[l.TransactionExecute=30]="TransactionExecute",l[l.TransactionExecuteCompressed=31]="TransactionExecuteCompressed",l[l.TransactionExecuteSync=32]="TransactionExecuteSync",l[l.TransactionExecuteSyncCompressed=33]="TransactionExecuteSyncCompressed",l))(jS||{});function AW(e){let n="data"in e?e.data:e;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([8])),0))return 0;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([9])),0))return 1;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([20])),0))return 2;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([17])),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([19])),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([18])),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([7])),0))return 13;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([33])),0))return 14;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([32])),0))return 15;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([30])),0))return 16;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([28])),0))return 17;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([31])),0))return 18;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([29])),0))return 19;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([13])),0))return 20;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([24])),0))return 21;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([10])),0))return 22;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([21])),0))return 23;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([14])),0))return 24;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([25])),0))return 25;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([12])),0))return 26;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([23])),0))return 27;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([11])),0))return 28;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([22])),0))return 29;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([15])),0))return 30;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([26])),0))return 31;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([16])),0))return 32;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([27])),0))return 33;throw new Error("The provided instruction could not be identified as a multiWallet instruction.")}var YS=6e3,ZS=6001,XS=6002,$S=6003,QS=6004,ex=6005,tx=6006,rx=6007,nx=6008,sx=6009,ox=6010,cx=6011,ax=6012,ix=6013,dx=6014,ux=6015,Ax=6016,gx=6017,yx=6018,mx=6019,px=6020,Tx=6021,lx=6022,fx=6023,Sx=6024,xx=6025,Ix=6026,Cx=6027,Dx=6028,Mx=6029,Ex=6030,hx=6031,Px=6032,Rx=6033,vx=6034,bx=6035,_x=6036,Ux=6037,Wx=6038,Lx=6039,Ox=6040,Bx=6041,wx=6042,kx=6043,Nx=6044,Hx=6045,Vx=6046,Gx=6047,Fx=6048,zx=6049,Kx=6050,Jx=6051,jx=6052,qx=6053,Ei;process.env.NODE_ENV!=="production"&&(Ei={[Ex]:"This member is already delegated to another wallet.",[rx]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[zx]:"The domain configuration account is disabled. Please contact support or try again later.",[Kx]:"Missing domain configuration account.",[ox]:"Duplicate public keys detected among members. Each member must have a unique key.",[sx]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[px]:"No members provided. A multisig wallet must contain at least one member.",[yx]:"Expected a User with Administrator role for this instruction.",[nx]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[Ax]:"Expected a User with Transaction Manager role for this instruction.",[Lx]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[Ox]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[Bx]:"Declared buffer size does not match the actual serialized size.",[Rx]:"Not enough members with vote permission to meet the approval threshold.",[hx]:"At least one signer with execute permission is required to proceed.",[Px]:"At least one signer with initiate permission is required to perform this action.",[xx]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[qx]:"Address Tree supplied is not part of the whitelisted address trees",[mx]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[Cx]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[Wx]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[vx]:"Only delegated members are allowed for this transaction.",[Sx]:"Unexpected number of accounts provided for this instruction.",[ix]:"User with Permanent Member role requires a must have a delegated wallet.",[ZS]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[QS]:"The extracted public key has an invalid length or encoding.",[YS]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[$S]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[Gx]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[lx]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[gx]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[ux]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[fx]:"Malformed transaction message: structure or formatting does not match the expected layout.",[Ix]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[ex]:"The extracted WebAuthn signed message payload is malformed.",[Hx]:"An input string exceeds the maximum allowed character length.",[Jx]:"This member is not registered under the provided domain configuration.",[Dx]:"A required account is missing from the instruction context.",[Vx]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[Mx]:"User mutation arguments are required when performing add or remove delegate operations.",[_x]:"No valid signer found in this transaction.",[ax]:"Only one permanent member is allowed per wallet.",[dx]:"Only one transaction manager is allowed per wallet.",[jx]:"The given origin index is not in the whitelisted origins.",[cx]:"Permanent members cannot be removed from a wallet.",[Nx]:"Writable CPI calls to protected accounts are not permitted.",[tx]:"The rpIdHash extracted from the signed message does not match the expected value.",[XS]:"The signature index provided is out of bounds for the secp256r1 instruction.",[Fx]:"The specified slot number was not found in the provided slot history.",[Tx]:"Too many members: a maximum of 4 members are supported.",[wx]:"This transaction has expired. It must be executed within 3 minutes of approval.",[kx]:"This transaction has not yet reached the required approval threshold.",[Ux]:"Only the transaction creator or rent payer may close this transaction buffer.",[bx]:"Member is not part of the expected signers for this transaction."});function lW(e){return process.env.NODE_ENV!=="production"?Ei[e]:"Error message not available in production bundles."}function fW(e,n,r){return gill.isProgramError(e,n,A,r)}var Ut={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 fn=33,Me=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!==fn)throw new Error(`Invalid public key length, expected ${fn} 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===fn)return n;throw new Error("Invalid public key input")}toBytes(){let n=this.toBuffer();return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}toString(){return this.toBase58()}toJSON(){return this.toBase58()}},C=class extends Me{verifyArgs;domainConfig;authData;signature;originIndex;crossOrigin;clientAndDeviceHash;authResponse;constructor(n,r){super(n),this.verifyArgs=r.verifyArgs,this.domainConfig=r.domainConfig,this.authData=r.authData,this.signature=r.signature,this.originIndex=r.originIndex,this.crossOrigin=r.crossOrigin,this.clientAndDeviceHash=r.clientAndDeviceHash,this.authResponse=r.authResponse;}};function Xx(){return gill.getStructCodec([["programAddressIndex",gill.getU8Codec()],["accountIndices",gill.getArrayCodec(gill.getU8Codec())],["data",gill.getArrayCodec(gill.getU8Codec())]])}function $x(){return gill.getStructCodec([["lookupTableAddress",gill.getAddressCodec()],["writableIndexes",gill.getArrayCodec(gill.getU8Codec())],["readonlyIndexes",gill.getArrayCodec(gill.getU8Codec())]])}var Pi=gill.getStructCodec([["numSigners",gill.getU8Codec()],["numWritableSigners",gill.getU8Codec()],["numWritableNonSigners",gill.getU8Codec()],["accountKeys",gill.getArrayCodec(gill.getAddressCodec())],["instructions",gill.getArrayCodec(Xx())],["addressTableLookups",gill.getArrayCodec($x())]]);function Ri(e){return Pi.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 vi(e){let n=Pi.decode(e);return {header:{numSignerAccounts:n.numSigners,numReadonlySignerAccounts:n.numSigners-n.numWritableSigners,numReadonlyNonSignerAccounts:n.accountKeys.length-n.numSigners-n.numWritableNonSigners},addressTableLookups:n.addressTableLookups.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes.map(Number),writableIndexes:r.writableIndexes.map(Number),readableIndices:r.readonlyIndexes.map(Number),writableIndices:r.writableIndexes.map(Number)})),instructions:n.instructions.map(r=>({accountIndices:r.accountIndices.map(Number),data:new Uint8Array(r.data),programAddressIndex:r.programAddressIndex})),lifetimeToken:A,staticAccounts:n.accountKeys,version:0}}stateless_js.featureFlags.version=stateless_js.VERSION.V2;var bi="revibase.com",_i="https://auth.revibase.com",Ui="https://api.revibase.com";var ze=null,Li=2e3,Oi=3e3,tI=300*1e3;async function tr({authUrl:e,popUp:n=null}){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");return new Promise((r,s)=>{let t=new URL(e).origin,c=null,i=setInterval(()=>{n&&n.closed&&(o(),s(new Error("User closed the authentication window")));},500),a=setTimeout(()=>{o(),s(new Error("Authentication timed out"));},tI);function o(){clearInterval(i),clearTimeout(a),c&&clearTimeout(c),ze&&window.removeEventListener("message",ze),n&&n.close();}if(n?n.location.replace(e):n=Hi(e),!n){s(new Error("Disable your popup blocker to continue."));return}let d=u=>{let g=u.origin===t,y=u.source===n;if(!(!g||!y||!u.isTrusted||!n))switch(u.data.type){case "popup-ready":c=setTimeout(()=>{o(),s(new Error("User closed the authentication window"));},Li+Oi);break;case "popup-complete":try{o(),r({result:"approved"});}catch{s(new Error("Failed to parse response payload"));}break;case "popup-heartbeat":c&&(clearTimeout(c),c=setTimeout(()=>{o(),s(new Error("User closed the authentication window"));},Li+Oi));break;case "popup-closed":o(),s(new Error("User closed the authentication window"));break}};ze&&window.removeEventListener("message",ze),ze=d,window.addEventListener("message",ze);})}function Bi(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ke(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,s=n.padEnd(n.length+r,"="),t=atob(s),c=new ArrayBuffer(t.length),i=new Uint8Array(c);for(let a=0;a<t.length;a++)i[a]=t.charCodeAt(a);return c}function rr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function rI(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 wi(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 ki(e,n){let r=[],s=0,t=new TextDecoder;for(let c=0;c<n;c++){if(s+2>e.length)throw new Error("MaxLengthExceeded");let i=e[s]|e[s+1]<<8;if(s+=2,s+i>e.length)throw new Error("MaxLengthExceeded");let a=e.slice(s,s+i),o=t.decode(a);r.push(o),s+=i;}return r}function Ni(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 h=n&127;r+=h;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let s=e[r+1],t=r+2,c=e.slice(t,t+s);if(r=t+s,e[r]!==2)throw new Error("Expected INTEGER for s");let i=e[r+1],a=r+2,o=e.slice(a,a+i),d=c[0]===0&&c.length>32?c.slice(1):c,u=o[0]===0&&o.length>32?o.slice(1):o;if(d.length>32||u.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(d,32-d.length);let y=nist_js.p256.Point.CURVE().n>>1n,T=BigInt("0x"+rr(u)),E=(T>y?nist_js.p256.Point.CURVE().n-T:T).toString(16).padStart(64,"0"),x=rI(E);return new Uint8Array([...g,...x])}function Hi(e=`${Ke()}/loading`){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");let n=window.innerWidth||screen.availWidth,r=window.innerHeight||screen.availHeight,s=n<=768,t,c,i,a;if(s)t=n,c=r,i=0,a=0;else {let u=window.screenLeft??window.screenX,g=window.screenTop??window.screenY,y=window.innerWidth??document.documentElement.clientWidth??screen.width,T=window.innerHeight??document.documentElement.clientHeight??screen.height;t=500,c=600,a=u+(y-t)/2,i=g+(T-c)/2;}let o=[`width=${t}`,`height=${c}`,`top=${i}`,`left=${a}`,"toolbar=no","location=no","status=no","menubar=no","scrollbars=yes","resizable=yes"].join(","),d=window.open(e,"_blank",o);return d&&d.focus(),d}function aL(e){let n=tinyCbor.decodeCBOR(e),r=nist_js.p256.Point.fromAffine({x:BigInt("0x"+rr(n.get(-2))),y:BigInt("0x"+rr(n.get(-3)))});return gill.getBase58Decoder().decode(r.toBytes(true))}function iL(e){let r=nist_js.p256.Point.fromBytes(new Uint8Array(gill.getBase58Encoder().encode(e))).toBytes(false),s=new Map;return s.set(1,2),s.set(3,-7),s.set(-1,1),s.set(-2,r.slice(1,33)),s.set(-3,r.slice(33,65)),new Uint8Array(tinyCbor.encodeCBOR(s))}async function dL(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=new Uint8Array(ke(n)),c=JSON.parse(new TextDecoder().decode(ke(r))),i=wi(c),a=Ni(new Uint8Array(ke(s))),o=await Je({rpIdHash:t.subarray(0,32)});return new C(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(ke(r)),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(gill.getBase58Encoder().encode(e.slotHash))},clientAndDeviceHash:aI(e.clientSignature.clientOrigin,e.deviceSignature.publicKey,e.nonce),domainConfig:o,authData:t,signature:a,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}async function uL(e,n){let{data:r}=await Hn(oe(),e),t=ki(new Uint8Array(r.origins),r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new Error("Origin not found in domain config");return t}function aI(e,n,r){return sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e),...gill.getBase58Encoder().encode(n),...new TextEncoder().encode(r)]))}function Gi(e){return sha2_js.sha256(Cn(e))}function Cn(e){return new Uint8Array([...new Uint8Array(ke(e.response.authenticatorData)),...sha2_js.sha256(new Uint8Array(ke(e.response.clientDataJSON)))])}async function Mn(e,n=false){let r=n?{blockhash:gill.getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await oe().getLatestBlockhash().send()).value;return await Promise.all(e.map(async s=>await gill.pipe(gill.createTransactionMessage({version:0}),c=>gill.appendTransactionMessageInstructions(s.instructions,c),c=>gill.setTransactionMessageFeePayerSigner(s.payer,c),c=>gill.setTransactionMessageLifetimeUsingBlockhash(r,c),c=>s.addressesByLookupTableAddress?gill.compressTransactionMessageUsingAddressLookupTables(c,s.addressesByLookupTableAddress):c,async c=>{let i=Math.ceil((s.unitsConsumed??0)*1.1)||8e5;return i>2e5?gill.prependTransactionMessageInstructions([programs.getSetComputeUnitLimitInstruction({units:i})],c):c},async c=>n?gill.compileTransaction(await c):await gill.signTransactionMessageWithSigners(await c))))}async function Ki(e,n){let s=(await e.getRecentPrioritizationFees(n.filter(c=>c.role===gill.AccountRole.WRITABLE||c.role===gill.AccountRole.WRITABLE_SIGNER).map(c=>c.address)).send()).map(c=>Number(c.prioritizationFee));s.sort((c,i)=>c-i);let t=Math.floor(s.length/2);return s.length%2===0?Math.round((s[t-1]+s[t])/2):s[t]}async function Ji(e,n){if(e.length===0)throw new Error("Bundle is empty.");for(let c=0;c<e.length;c++){if(e[c].length>1644)throw new Error(`Transaction ${c} exceeds maximum length, ${e[c].length}. Retry again.`);console.log(`Transaction ${c} length: ${e[c].length}`);}let r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:"2",method:"simulateBundle",params:[{encodedTransactions:e},{skipSigVerify:true,replaceRecentBlockhash:true,preExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]})),postExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]}))}]})});if(!r.ok)throw console.error(await r.json()),new Error("Failed to simulate bundle");let{result:s,error:t}=await r.json();if(!s||t)throw console.error(t??s),new Error(`Unable to simulate bundle: ${JSON.stringify(t??s)}`);if(typeof s.value.summary!="string"&&s.value.summary.failed){let{TransactionFailure:c}=s.value.summary.failed.error,[,i]=c;throw console.error(t??s),new Error(`Simulation failed: ${i}`)}return s.value.transactionResults.map(c=>c.unitsConsumed)}function G(e,n=0){let r=e instanceof C?e:void 0,s=r?.verifyArgs&&n!==-1?gill.some({signedMessageIndex:n,truncatedClientDataJson:r.verifyArgs.truncatedClientDataJson,slotNumber:r.verifyArgs.slotNumber,originIndex:r.originIndex,crossOrigin:r.crossOrigin,clientAndDeviceHash:r.clientAndDeviceHash}):null,t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,i=r?.authData&&r.verifyArgs?.clientDataJson?Cn(r.authResponse):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:i,publicKey:a}}function je(e){if(e instanceof Me)return {keyType:Ut.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:Ut.Ed25519,key:new Uint8Array([0,...gill.getAddressEncoder().encode(n)])}}}function zi(e){return e instanceof C?e.toString():e.address.toString()}function Ae(e){let n=new Set,r=[];for(let s of e)n.has(zi(s))||(r.push(s),n.add(zi(s)));if(r.filter(s=>s instanceof C).length>1)throw new Error("More than 1 Secp256r1 signers in an instruction is not supported.");return r}function ji({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 qi(e){let n=await fetch(`${e}/getRandomPayer`),{randomPayer:r}=await n.json();return {address:gill.address(r),async signTransactions(s){let t={publicKey:r,transactions:s.map(a=>gill.getBase64Decoder().decode(gill.getTransactionEncoder().encode(a)))},i=await(await fetch(`${e}/sign`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).json();if("error"in i)throw new Error(i.error);return i.signatures.map(a=>({[gill.address(r)]:gill.getBase58Encoder().encode(a)}))}}}var _={};function qe(){if(!_.solanaRpcEndpoint)throw new Error("Rpc is not initialized yet.");return _.solanaRpcEndpoint}function Ne(){if(!_.lightProtocolRpc)throw new Error("Rpc is not initialized yet");return _.lightProtocolRpc}function oe(){if(!_.solanaRpc)throw new Error("Rpc is not initialized yet");return _.solanaRpc}function Yi(){if(!_.sendAndConfirm)throw new Error("Rpc is not initialized yet.");return _.sendAndConfirm}function Zi(){if(!_.computeEstimate)throw new Error("Rpc is not initialized yet");return _.computeEstimate}async function hL(){return _.feePayer||(_.feePayer=await qi(_.apiEndpoint??Ui)),_.feePayer}function En(){if(!_.jitoTipsConfig)throw new Error("Jito Bundle Config is not set.");return _.jitoTipsConfig}function Ke(){return _.authEndpoint??_i}function PL(){return _.rpId??bi}function Ye(){if(!_.onClientAuthorizationCallback)throw new Error("No client transaction callback found.");return _.onClientAuthorizationCallback}function RL(){Object.keys(_).forEach(e=>{_[e]=void 0;});}function vL({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s,apiEndpoint:t,authEndpoint:c,rpId:i,onClientTransactionCallback:a}){_.solanaRpcEndpoint=e,_.lightProtocolRpc=stateless_js.createRpc(e,r,n);let{rpc:o,sendAndConfirmTransaction:d}=gill.createSolanaClient({urlOrMoniker:e});_.solanaRpc=o,_.sendAndConfirm=d,_.computeEstimate=programs.estimateComputeUnitLimitFactory({rpc:o}),_.apiEndpoint=t??null,_.jitoTipsConfig=s??null,_.authEndpoint=c??null,_.rpId=i??null,_.onClientAuthorizationCallback=a??null;}var U=class{preAccounts;systemAccounts;nextIndex;map;outputTreeIndex;constructor(){this.preAccounts=[],this.systemAccounts=[],this.nextIndex=0,this.map=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){this.preAccounts.push(...n);}getAccountRole(n,r){return n?r?gill.AccountRole.WRITABLE_SIGNER:gill.AccountRole.READONLY_SIGNER:r?gill.AccountRole.WRITABLE:gill.AccountRole.READONLY}async addSystemAccounts(){this.systemAccounts.push(...stateless_js.getLightSystemAccountMetasV2({selfProgram:new web3_js.PublicKey(A.toString())}).map(n=>({address:gill.address(n.pubkey.toString()),role:this.getAccountRole(n.isSigner,n.isWritable)})));}insertOrGet(n){return this.insertOrGetConfig(n,gill.AccountRole.WRITABLE)}insertOrGetConfig(n,r){if(!this.map.has(n)){let s=this.nextIndex++,t={address:gill.address(n),role:r};this.map.set(n,{index:s,accountMeta:t});}return this.map.get(n).index}packOutputTreeIndex(n){if(n.treeType===stateless_js.TreeType.StateV1)return this.insertOrGet(n.tree.toString());if(n.treeType===stateless_js.TreeType.StateV2)return this.insertOrGet(n.queue.toString());throw new Error("Tree type not supported")}async getOutputTreeIndex(){if(this.outputTreeIndex!==-1)return this.outputTreeIndex;let n=qe().includes("devnet")?stateless_js.localTestActiveStateTreeInfos():await Ne().getStateTreeInfos(),r=stateless_js.selectStateTreeInfo(n);return this.packOutputTreeIndex(r)}packTreeInfos(n,r){let s=[],t=[];for(let c of n){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());s.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:i,queuePubkeyIndex:a,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let o=c.treeInfo.nextTreeInfo??c.treeInfo,d=this.packOutputTreeIndex(o);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let c of r){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:i,addressQueuePubkeyIndex:a});}return {stateTrees:s.length>0?{packedTreeInfos:s,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(){return Array.from(this.map.entries()).sort((r,s)=>r[1].index-s[1].index).map(([,{accountMeta:r}])=>({...r}))}getOffsets(){let n=this.preAccounts.length,r=n+this.systemAccounts.length;return [n,r]}toAccountMetas(){let n=this.hashSetAccountsToMetas(),[r,s]=this.getOffsets();return {remainingAccounts:[...this.preAccounts,...this.systemAccounts,...n],systemOffset:r,packedOffset:s}}};async function nr(e,n){let r=n?.get(e.toString());if(r)return r;{let s=await Qi(e);return s&&n?.set(e.toString(),s),s}}async function ce(e,n){let s=(await Promise.all(e.map(async t=>nr(t.address,n)))).filter(t=>t!==null).filter(t=>t.data!==null&&t.address!==null);if(s.length!==e.length)throw new Error("Unable to find compressed account.");return s.map((t,c)=>({...t,type:e[c].type,tree:t.treeInfo.tree,queue:t.treeInfo.queue}))}function b(e,n){return {proof:e?.compressedProof?gill.some({a:new Uint8Array(e.compressedProof.a),b:new Uint8Array(e.compressedProof.b),c:new Uint8Array(e.compressedProof.c)}):null,lightCpiAccountsStartIndex:n}}async function ae(e,n,r,s,t){if(t.length===0)return [];let c=t.map((d,u)=>({treeInfo:n[u],root:r[u],rootIndex:s[u],address:d.address.toArray()})),{addressTrees:i}=e.packTreeInfos([],c),a=await e.getOutputTreeIndex();return t.map((d,u)=>({addressTreeInfo:i[u],outputStateTreeIndex:a,address:d.address,type:d.type}))}function Y(e,n,r,s,t,c,i){let a=[];for(let u=0;u<n.length;u++)a.push({treeInfo:n[u],rootIndex:s[u],leafIndex:r[u],proveByIndex:t[u],hash:c[u].hash});let o=e.packTreeInfos(a,[]).stateTrees;if(!o)throw new Error("Unable to parsed data.");return c.map((u,g)=>({data:i.decode(u.data.data),accountMeta:{treeInfo:o.packedTreeInfos[g],address:new Uint8Array(u.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function Te(e,n,r,s,t){let c=null,i=null,a=new U;if(e){await a.addSystemAccounts();let{address:o}=await j(n,r),d=(await ce([{address:o,type:"Settings"}],t))[0];s?i={rootIndices:[0],roots:[],leafIndices:[d.leafIndex],leaves:[],treeInfos:[d.treeInfo],proveByIndices:[d.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:i=await k([d],[]);let u=a.packTreeInfos([{treeInfo:i.treeInfos[0],rootIndex:i.rootIndices[0],leafIndex:i.leafIndices[0],proveByIndex:i.proveByIndices[0],hash:d.hash}],[]).stateTrees;if(!u)throw new Error("Unable to parsed data.");c={accountMeta:{address:new Uint8Array(d.address),treeInfo:u.packedTreeInfos[0]},data:z().decode(d.data?.data)};}return {settingsReadonlyArgs:c,proof:i,packedAccounts:a}}async function k(e,n,r=10,s=400){let t=1;for(;t<r;)try{return await Ne().getValidityProofV0(e,n)}catch(c){if(console.error(`Attempt ${t}, Get Validity Proof failed. ${c}`),t++,t>=r)throw new Error(`Failed to get validity proof after ${r} attempts: ${c}`);await new Promise(i=>setTimeout(i,s));}throw new Error(`Failed to get validity proof after ${r} attempts`)}async function le(){return (await sr()).length-1}var hn;async function sr(){if(!hn){let{data:e}=await Gs(oe(),await ed());hn=e.whitelistedAddressTrees;}return hn}async function or(e,n,r){let s=await KI(e,n,r);if(!s)throw new Error("User cannot be found.");return s}async function KI(e,n,r){let{address:s}=await N(e,n),t=await nr(s,r);return t?.data?.data?J().decode(t.data.data):null}async function Lt(e,n,r){let s=await JI(e,n,r);if(!s)throw new Error("Settings cannot be found.");return s}async function JI(e,n,r){try{let{address:s}=await j(e,n),t=await nr(s,r);if(!t?.data?.data)throw new Error("No compressed settings account found.");let c=z().decode(t.data.data);if(c.data.__option==="None")throw new Error("No compressed settings account found.");return {...c.data.value,isCompressed:!0}}catch{let s=await zr(oe(),await Z(e));return s.exists?{...s.data,members:s.data.members.slice(0,s.data.membersLen),isCompressed:false}:null}}async function Pn(e){let n=await sr();if(e<0||e>=n.length)throw new Error(`Invalid address tree index: ${e}`);return n[e]}async function tO(e){let r=(await sr()).findIndex(s=>s===e);if(r===-1)throw new Error(`Address tree not found: ${e}`);return r}async function Qi(e){let n=await stateless_js.rpcRequest(Ne().compressionApiEndpoint,stateless_js.versionedEndpoint("getCompressedAccount"),{hash:void 0,address:e?stateless_js.encodeBN254toBase58(e):void 0}),r;if(stateless_js.featureFlags.isV2()?r=superstruct.create(n,stateless_js.jsonRpcResultAndContext(superstruct.nullable(stateless_js.CompressedAccountResultV2))):r=superstruct.create(n,stateless_js.jsonRpcResultAndContext(superstruct.nullable(stateless_js.CompressedAccountResult))),"error"in r)throw new web3_js.SolanaJSONRPCError(r.error,`failed to get info for compressed account ${e?e.toString():""}`);if(r.result.value===null)return null;let s=stateless_js.featureFlags.isV2()?r.result.value.merkleContext.tree:r.result.value.tree,t=qe().includes("devnet")?stateless_js.localTestActiveStateTreeInfos():await Ne().getStateTreeInfos(),c=stateless_js.getStateTreeInfoByPubkey(t,s),i=r.result.value;return stateless_js.createCompressedAccountWithMerkleContextLegacy(stateless_js.createMerkleContextLegacy(c,i.hash,i.leafIndex),i.owner,stateless_js.bn(i.lamports),i.data?stateless_js.parseAccountData(i.data):void 0,i.address||void 0)}async function j(e,n=0){let r=await Pn(n),s=stateless_js.deriveAddressSeedV2([new Uint8Array(gill.getUtf8Encoder().encode("multi_wallet")),new Uint8Array(gill.getU128Encoder().encode(e))]);return {address:stateless_js.createBN254(stateless_js.deriveAddressV2(s,new web3_js.PublicKey(r),new web3_js.PublicKey(A)).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function N(e,n=0){let r=await Pn(n),s=stateless_js.deriveAddressSeedV2([new Uint8Array(gill.getUtf8Encoder().encode("user")),e instanceof Me?e.toTruncatedBuffer():new Uint8Array(gill.getAddressEncoder().encode(e))]);return {address:stateless_js.createBN254(stateless_js.deriveAddressV2(s,new web3_js.PublicKey(r),new web3_js.PublicKey(A.toString())).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function Je({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha2_js.sha256(new Uint8Array(gill.getUtf8Encoder().encode(n)));else throw new Error("RpId not found.");if(!e)throw new Error("RpIdHash not found.");let[r]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("domain_config"),e]});return r}async function dd(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("global_counter")]});return e}async function ed(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function ud(e,n,r){if(r>255)throw new Error("Index cannot be greater than 255.");let[s]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("transaction_buffer"),n instanceof Me?n.toTruncatedBuffer():gill.getAddressEncoder().encode(n),gill.getU8Encoder().encode(r)]});return s}async function Ie(e){let[n]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("vault")]});return n}async function Z(e){let[n]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getU128Encoder().encode(e)]});return n}async function Ad(e){let n=await Z(e);return await Ie(n)}async function uO(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("cpi_authority")]});return e}async function IO(e){let n=await Mn(e,true),r=await Ji(n.map(gill.getBase64EncodedWireTransaction),qe()),s=await Mn(e.map((c,i)=>({...c,unitsConsumed:r[i]})));return await dC(s.map(gill.getBase64EncodedWireTransaction))}async function CO({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await oe().getLatestBlockhash().send(),t=await gill.pipe(gill.createTransactionMessage({version:0}),c=>gill.appendTransactionMessageInstructions([...e],c),c=>gill.setTransactionMessageFeePayerSigner(n,c),c=>gill.setTransactionMessageLifetimeUsingBlockhash(s.value,c),c=>r?gill.compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[i,a]=await Promise.all([Zi()(c),Ki(oe(),c.instructions.flatMap(d=>d.accounts??[]))]),o=Math.ceil(i*1.1);return gill.prependTransactionMessageInstructions([...o>2e5?[programs.getSetComputeUnitLimitInstruction({units:o})]:[],...a>0?[programs.getSetComputeUnitPriceInstruction({microLamports:a})]:[]],c)},async c=>await gill.signTransactionMessageWithSigners(await c));return await Yi()(t,{commitment:"confirmed",skipPreflight:true}),gill.getSignatureFromTransaction(t)}async function dC(e,n=10,r=1e3,s=En()){let{blockEngineUrl:t}=s;for(let c=1;c<=n;c++){let i=await fetch(`${t}/bundles`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"sendBundle",params:[e,{encoding:"base64"}]})});if(i.status===429&&c<n){await new Promise(o=>setTimeout(o,r));continue}let a=await i.json();if(a.error)throw new Error(`Error sending bundles: ${JSON.stringify(a.error,null,2)}`);return a.result}throw new Error("Failed to send bundle after retries.")}async function DO(e,n=30,r=3e3,s=En()){let{blockEngineUrl:t}=s;for(let c=1;c<=n;c++){let i=await fetch(`${t}/getBundleStatuses`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});if(i.status===429&&c<n){await new Promise(d=>setTimeout(d,r));continue}let a=await i.json();if(a.error)throw new Error(`Error sending bundles: ${JSON.stringify(a.error,null,2)}`);let o=a.result;if(o.value.length){let d=o.value[0];if(d.confirmation_status==="confirmed"||d.confirmation_status==="finalized")return d.transactions[d.transactions.length-1]}if(c<n){await new Promise(d=>setTimeout(d,r));continue}}throw new Error("Failed to get bundle status after retries.")}async function MO(e,n,r,s){let t=await Lt(n,r,s);if(t.threshold>1)throw new Error("Multi-signature transactions with threshold > 1 are not supported yet.");let{permissions:c}=t.members.find(u=>yd(u.pubkey)===e)??{};if(!c)throw new Error("No permissions found for the current member.");let i=De.has(c,xe.InitiateTransaction),a=De.has(c,xe.VoteTransaction),o=De.has(c,xe.ExecuteTransaction);if(i&&a&&o)return {};if(!a||!o)throw new Error("Signer lacks the required Vote/Execute permissions.");let d=t.members.find(u=>u.role===2);if(!d)throw new Error("No transaction manager available in wallet.");return {transactionManagerAddress:gill.address(yd(d.pubkey)),userAddressTreeIndex:d.userAddressTreeIndex}}async function EO({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await or(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new Error("Transaction manager endpoint is missing for this account.");return uC(n,c.transactionManagerUrl.value,e,s)}function uC(e,n,r,s){return {address:e,async signTransactions(t){let c={publicKey:e.toString(),transactions:t.map(gill.getBase64EncodedWireTransaction)};s&&(c.transactionMessageBytes=gill.getBase64Decoder().decode(s)),r&&(c.authResponses=r);let a=await(await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})).json();if("error"in a)throw new Error(a.error);return a.signatures.map(o=>({[e]:gill.getBase58Encoder().encode(o)}))}}}function yd(e){return e.keyType===Ut.Ed25519?gill.getBase58Decoder().decode(e.key.subarray(1,33)):gill.getBase58Decoder().decode(e.key)}async function zO({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,payer:s,compressed:t=false,cachedAccounts:c}){let i=await pC(r),a=new U,o=null,d=null,u=[];if(i.length||t){let h=await TC({packedAccounts:a,userAccounts:i,compressed:t,index:e,settingsAddressTreeIndex:n,cachedAccounts:c});o=h.proof,d=h.settingsMutArgs??null,u=h.userMutArgs??[];}let{configActions:g,secp256r1VerifyInput:y}=await lC({configActionsArgs:r,packedAccounts:a,userMutArgs:u,index:e}),{remainingAccounts:T,systemOffset:f}=a.toAccountMetas(),E=b(o,f);return {instructions:t?[co({configActions:g,payer:s,authority:gill.createNoopSigner(await Ad(e)),compressedProofArgs:E,settingsMut:d,remainingAccounts:T})]:[await eo({settingsIndex:e,configActions:g,payer:s,compressedProofArgs:E,remainingAccounts:T})],secp256r1VerifyInput:y}}async function pC(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let s=await Promise.all(r.members.map(t=>N(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}case "RemoveMembers":{let s=await Promise.all(r.members.map(t=>N(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}}return n}async function TC({packedAccounts:e,userAccounts:n,compressed:r,index:s,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let i=[];if(r){let T=(await j(s,t)).address;i.push({address:T,type:"Settings"});}n.length&&i.push(...n);let a=i.length?await ce(i,c):[];if(!a.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let o=await k(a,[]),d=[],u=[];for(let T of a)T.type==="Settings"?d.push(T):T.type==="User"&&u.push(T);let g,y=[];if(r&&o&&(g=Y(e,o.treeInfos.slice(0,1),o.leafIndices.slice(0,1),o.rootIndices.slice(0,1),o.proveByIndices.slice(0,1),d,z())[0]),u.length&&o){let T=r?1:0;y=Y(e,o.treeInfos.slice(T),o.leafIndices.slice(T),o.rootIndices.slice(T),o.proveByIndices.slice(T),u,J());}return {proof:o,settingsMutArgs:g,userMutArgs:y}}async function lC({index:e,configActionsArgs:n,packedAccounts:r,userMutArgs:s}){let t=[],c=[];for(let i of n)switch(i.type){case "AddMembers":{let a=[];for(let o of i.members)if(o.member instanceof C){let d=t.length,{message:u,signature:g,publicKey:y,domainConfig:T}=G(o.member,d);u&&g&&y&&t.push({message:u,signature:g,publicKey:y}),T&&r.addPreAccounts([{address:T,role:gill.AccountRole.READONLY}]);let f=await N(o.member,o.userAddressTreeIndex).then(E=>s.find(x=>new vn__default.default(new Uint8Array(x.accountMeta.address)).eq(E.address)));if(!f)throw new Error("Unable to find user account");a.push(md({permissionArgs:o.permissions,index:d,userMutArgs:f,pubkey:o.member}));}else {let d=await N(o.member,o.userAddressTreeIndex).then(u=>s.find(g=>new vn__default.default(new Uint8Array(g.accountMeta.address)).eq(u.address)));if(!d)throw new Error("Unable to find user account");a.push(md({permissionArgs:o.permissions,index:-1,userMutArgs:d,pubkey:o.member}));}c.push({__kind:i.type,fields:[a]});break}case "RemoveMembers":{let a=await Promise.all(i.members.map(o=>N(o.member,o.userAddressTreeIndex).then(d=>{let u=s.find(g=>new vn__default.default(new Uint8Array(g.accountMeta.address)).eq(d.address));if(!u)throw new Error("Unable to find user account");return SC({pubkey:o.member,userMutArgs:u,index:e})})));c.push({__kind:i.type,fields:[a]});break}case "EditPermissions":{let a=i.members.map(o=>fC({permissionArgs:o.permissions,pubkey:o.member}));c.push({__kind:i.type,fields:[a]});break}default:c.push({__kind:i.type,fields:[i.threshold]});}return {configActions:c,secp256r1VerifyInput:t}}function fC({pubkey:e,permissionArgs:n}){return {memberKey:je(e),permissions:pd(n)}}function SC({pubkey:e,userMutArgs:n,index:r}){if(n.data.role===1)throw new Error("Permanent Member cannot be removed from the wallet.");let s=n.data.delegatedTo.__option==="Some"?Number(n.data.delegatedTo.value.index.toString())===r:false;return {memberKey:je(e),userArgs:s?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function md({pubkey:e,permissionArgs:n,index:r,userMutArgs:s}){if(s.data.role===1){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&&(n.execute||n.vote))throw new Error("Transaction Manager can only have initiate permission");return {memberKey:je(e),permissions:pd(n),verifyArgs:e instanceof C&&e.verifyArgs&&r!==-1?gill.some({truncatedClientDataJson:e.verifyArgs.truncatedClientDataJson,slotNumber:e.verifyArgs.slotNumber,signedMessageIndex:r,originIndex:e.originIndex,crossOrigin:e.crossOrigin,clientAndDeviceHash:e.clientAndDeviceHash}):gill.none(),userArgs:s.data.role===1?{__kind:"Mutate",fields:[s]}:{__kind:"Read",fields:[s]}}}function pd(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 Xe=33,$e=64,Wn=14,hC=2,PC=gill.address("Secp256r1SigVerify1111111111111111111111111");function RC(){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 vC(){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 Sd(){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=vC();for(let a=0;a<r;a++)t.push(c.decode(e,n)),n+=Wn;let i=[];for(let a=0;a<r;a++){let o=gill.fixDecoderSize(gill.getBytesDecoder(),Xe).decode(e,n);n+=Xe;let d=gill.fixDecoderSize(gill.getBytesDecoder(),$e).decode(e,n);n+=$e;let u=t[a].messageDataSize,g=gill.fixDecoderSize(gill.getBytesDecoder(),u).decode(e,n);n+=u,i.push({publicKey:o,signature:d,message:g});}return [{numSignatures:r,padding:s,offsets:t,payload:i},n]}})}function xd(){return gill.createEncoder({getSizeFromValue:e=>{let n=Wn*e.offsets.length,r=e.payload.reduce((s,t)=>s+Xe+$e+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=RC();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=gill.fixEncoderSize(gill.getBytesEncoder(),Xe).write(t.publicKey,n,r),r=gill.fixEncoderSize(gill.getBytesEncoder(),$e).write(t.signature,n,r),r=gill.getBytesEncoder().write(t.message,n,r);return r}})}function jO(){return gill.combineCodec(xd(),Sd())}function F(e,n){let r=e.length,s=hC+r*Wn,t=[];for(let o=0;o<r;o++){let{message:d}=e[o],u=s,g=u+Xe,y=g+$e;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:y,messageDataSize:d.length,messageInstructionIndex:65535}),s+=Xe+$e+d.length;}let c=n?.programAddress??PC,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:xd().encode(i)}}function qO(e){return {programAddress:e.programAddress,accounts:{},data:Sd().decode(e.data)}}async function sB({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let c=new U;await c.addSystemAccounts();let i=await Z(e),{address:a}=await j(e,n),o=await ce([{address:a,type:"Settings"}],t),d=await k(o,[]),u=Y(c,d.treeInfos,d.leafIndices,d.rootIndices,d.proveByIndices,o.filter(S=>S.type==="Settings"),z())[0],g=Ae(s),y=g.filter(S=>S instanceof C),T=[],f=[];for(let S of y){let L=T.length,{domainConfig:W,verifyArgs:q,signature:H,publicKey:V,message:O}=G(S,L);O&&H&&V&&T.push({message:O,signature:H,publicKey:V}),W&&(c.addPreAccounts([{address:W,role:gill.AccountRole.READONLY}]),q?.__option==="Some"&&f.push({domainConfigKey:W,verifyArgs:q.value}));}c.addPreAccounts(g.filter(S=>"address"in S).map(S=>({address:S.address,role:gill.AccountRole.READONLY_SIGNER,signer:S})));let{remainingAccounts:E,systemOffset:x}=c.toAccountMetas(),h=b(d,x),I=[];return T.length>0&&I.push(F(T)),I.push(yo({settings:i,settingsMutArgs:u,compressedProofArgs:h,payer:r,secp256r1VerifyArgs:f,remainingAccounts:E})),I}async function aB({admin:e,addressTree:n}){return qs({payer:e,addressTree:n,remainingAccounts:[]})}async function mB({payer:e,rpId:n,origins:r,authority:s}){let t=await Je({rpId:n}),c=new U;await c.addSystemAccounts();let i=await le(),{address:a,addressTree:o}=await N(s.address,i),d=[{address:a,tree:o,queue:o,type:"User"}],u=await k([],d),g=(await ae(c,u.treeInfos,u.roots,u.rootIndices,d))[0],{remainingAccounts:y,systemOffset:T}=c.toAccountMetas(),f=b(u,T);return await Do({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:f,payer:e,domainConfig:t,rpId:n,remainingAccounts:y})}async function MB({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new U;await c.addSystemAccounts();let i=[];r.index&&(i.push({address:(await j(r.index,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&i.push({address:(await N(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let a=i.length?await ce(i,t):[],o=await le(),{address:d,addressTree:u}=await N(r.member,o),g=[{address:d,type:"User",tree:u,queue:u}],y=await k(a,g),T=null,f=null,E=a.filter(W=>W.type==="Settings"),x=a.filter(W=>W.type==="User");E.length&&(T=Y(c,y.treeInfos.slice(0,1),y.leafIndices.slice(0,1),y.rootIndices.slice(0,1),y.proveByIndices.slice(0,1),E,z())[0]),x.length&&(f=Y(c,y.treeInfos.slice(1,2),y.leafIndices.slice(1,2),y.rootIndices.slice(1,2),y.proveByIndices.slice(1,2),x,J())[0]);let h=await ae(c,y.treeInfos.slice(a.length),y.roots.slice(a.length),y.rootIndices.slice(a.length),g),{remainingAccounts:I,systemOffset:S}=c.toAccountMetas(),L=b(y,S);return await Po({payer:n,authority:e,compressedProofArgs:L,member:St().decode(r.member.toBuffer()),role:r.role,linkWalletArgs:T?gill.some({settingsMutArgs:T,transactionManager:f?gill.some(f):gill.none()}):gill.none(),userAccountCreationArgs:h[0],domainConfig:s,remainingAccounts:I})}async function RB({payer:e}){let n=await dd();return _o({payer:e,globalCounter:n})}async function OB({createUserArgs:e,payer:n}){let r=new U;await r.addSystemAccounts(),r.addPreAccounts(e.map(u=>({address:u.member.address,role:gill.AccountRole.READONLY_SIGNER,signer:u.member})));let s=await le(),t=await Promise.all(e.map(async u=>{let{address:g,addressTree:y}=await N(u.member.address,s);return {address:g,tree:y,queue:y,type:"User"}})),c=await k([],t),i=await ae(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:a,systemOffset:o}=r.toAccountMetas(),d=b(c,o);return await Ho({compressedProofArgs:d,payer:n,createUserArgs:e.map((u,g)=>({member:u.member.address,role:u.role,userCreationArgs:i[g],transactionManagerUrl:u.role===2?u.transactionManagerUrl:null})),remainingAccounts:a})}async function NB({admin:e,rpId:n,disable:r}){let s=await Je({rpId:n});return $o({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function JB({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,c=[];if(r){let i=new U;await i.addSystemAccounts();let a=await le(),{address:o,addressTree:d}=await N(r.address,a),u=[{address:o,tree:d,queue:d,type:"User"}],g=await k([],u),y=(await ae(i,g.treeInfos,g.roots,g.rootIndices,u))[0],T=i.toAccountMetas();c=T.remainingAccounts,t={compressedProofArgs:b(g,T.systemOffset),authorityCreationArgs:y};}return sc({domainConfig:n,authority:e,newOrigins:s?gill.some(s):gill.none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function $B({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new U;await s.addSystemAccounts();let t=await ce([{address:(await N(e.address,n)).address,type:"User"}]),c=await k(t,[]),i=Y(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,J())[0],{remainingAccounts:a,systemOffset:o}=s.toAccountMetas(),d=b(c,o);return uc({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function iw({payer:e,user:n,userAddressTreeIndex:r,newDelegate:s,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:i,message:a,signature:o,publicKey:d}=G(n),u=[];a&&o&&d&&u.push({message:a,signature:o,publicKey:d});let g=await or(n instanceof C?n:n.address,r,t),y=[];y.push({address:(await N(n instanceof C?n:n.address,r)).address,type:"User"});let T,f=null,E,x=null;g.delegatedTo.__option==="Some"&&((await Lt(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex,t)).isCompressed?(y.push({address:(await j(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex)).address,type:"Settings"}),f={start:y.length-1,end:y.length}):T=await Z(g.delegatedTo.value.index)),s&&((await Lt(s.index,s.settingsAddressTreeIndex,t)).isCompressed?(y.push({address:(await j(s.index,s.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:y.length-1,end:y.length}):E=await Z(s.index));let h=new U;await h.addSystemAccounts();let I=await ce(y,t),S=await k(I,[]),L=Y(h,S.treeInfos.slice(0,1),S.leafIndices.slice(0,1),S.rootIndices.slice(0,1),S.proveByIndices.slice(0,1),I.slice(0,1),J())[0],W=f?gill.some(Y(h,S.treeInfos.slice(f.start,f.end),S.leafIndices.slice(f.start,f.end),S.rootIndices.slice(f.start,f.end),S.proveByIndices.slice(f.start,f.end),I.slice(f.start,f.end),z())[0]):gill.none(),q=x?gill.some(Y(h,S.treeInfos.slice(x.start,x.end),S.leafIndices.slice(x.start,x.end),S.rootIndices.slice(x.start,x.end),S.proveByIndices.slice(x.start,x.end),I.slice(x.start,x.end),z())[0]):gill.none(),{remainingAccounts:H,systemOffset:V}=h.toAccountMetas(),O=b(S,V),re=[];return u.length>0&&re.push(F(u)),re.push(Tc({secp256r1VerifyArgs:i,domainConfig:c,delegateTo:s?gill.some(s):gill.none(),feePayer:e,signer:n instanceof C?void 0:n,oldSettings:T,oldSettingsMutArgs:W,newSettings:E,newSettingsMutArgs:q,compressedProofArgs:O,userMutArgs:L,remainingAccounts:H})),re}async function pw({args:e,authority:n,index:r,settingsAddressTreeIndex:s}){let t=new U;await t.addSystemAccounts();let{address:c,addressTree:i}=await j(r,s),a=[{address:c,tree:i,queue:i,type:"Settings"}],o=await k([],a),d=(await ae(t,o.treeInfos,o.roots,o.rootIndices,a))[0],{remainingAccounts:u,systemOffset:g}=t.toAccountMetas(),y=b(o,g);return Cc({compressedProofArgs:y,args:e,authority:n,settingsCreationArgs:d,remainingAccounts:u})}async function Cw({args:e,authority:n,member:r,userAddressTreeIndex:s}){let t=new U;await t.addSystemAccounts();let{address:c,addressTree:i}=await N(r,s),a=[{address:c,tree:i,queue:i,type:"User"}],o=await k([],a),d=(await ae(t,o.treeInfos,o.roots,o.rootIndices,a))[0],{remainingAccounts:u,systemOffset:g}=t.toAccountMetas(),y=b(o,g);return Rc({compressedProofArgs:y,args:e,authority:n,userCreationArgs:d,remainingAccounts:u})}async function zw({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,cachedAccounts:t}){let{domainConfig:c,verifyArgs:i,message:a,signature:o,publicKey:d}=G(r),u=[];a&&o&&d&&u.push({message:a,signature:o,publicKey:d});let g=new U;await g.addSystemAccounts();let y=[],T=[];T.push(...await ce([{address:(await N("address"in r?r.address:r,s)).address,type:"User"}],t));let f=await le(),{address:E,addressTree:x}=await j(e,f);y.push({address:E,queue:x,tree:x,type:"Settings"});let h=T.length,I=await k(T,y),S=Y(g,I.treeInfos.slice(0,h),I.leafIndices.slice(0,h),I.rootIndices.slice(0,h),I.proveByIndices.slice(0,h),T.filter(re=>re.type==="User"),J())[0],W=(await ae(g,I.treeInfos.slice(h),I.roots.slice(h),I.rootIndices.slice(h),y)).find(re=>re.type==="Settings")??null;c?g.addPreAccounts([{address:c,role:gill.AccountRole.READONLY}]):"address"in r&&g.addPreAccounts([{address:r.address,role:gill.AccountRole.READONLY_SIGNER,signer:r}]);let{remainingAccounts:q,systemOffset:H}=g.toAccountMetas(),V=b(I,H),O=[];if(!W)throw new Error("Settings creation args is missing.");return u.length>0&&O.push(F(u)),O.push(await Bo({settingsIndex:e,payer:n,initialMember:r instanceof C?void 0:r,secp256r1VerifyArgs:i,domainConfig:c,userArgs:S.data.role===1?{__kind:"Mutate",fields:[S]}:{__kind:"Read",fields:[S]},compressedProofArgs:V,settingsCreation:W,remainingAccounts:q})),O}async function ek({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let c=new U;await c.addSystemAccounts();let i=await ce([{address:(await j(e,n)).address,type:"Settings"}],t),a=await k(i,[]),o=Y(c,a.treeInfos,a.leafIndices,a.rootIndices,a.proveByIndices,i.filter(I=>I.type==="Settings"),z())[0],d=Ae(s),u=d.filter(I=>I instanceof C),g=[],y=[];for(let I of u){let S=g.length,{domainConfig:L,verifyArgs:W,signature:q,publicKey:H,message:V}=G(I,S);V&&q&&H&&g.push({message:V,signature:q,publicKey:H}),L&&(c.addPreAccounts([{address:L,role:gill.AccountRole.READONLY}]),W?.__option==="Some"&&y.push({domainConfigKey:L,verifyArgs:W.value}));}c.addPreAccounts(d.filter(I=>"address"in I).map(I=>({address:I.address,role:gill.AccountRole.READONLY_SIGNER,signer:I})));let{remainingAccounts:T,systemOffset:f}=c.toAccountMetas(),E=b(a,f),x=[];g.length>0&&x.push(F(g));let h=await Z(e);return x.push(Jo({settings:h,payer:r,settingsMut:o,compressedProofArgs:E,secp256r1VerifyArgs:y,remainingAccounts:T})),x}function LC(e,n,r,s){let t=OC(e,n),c=BC(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 OC(e,n){let r=e.staticAccounts.length,{numSignerAccounts:s,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,i=s-t,a=r-s-c;return n>=r?false:n<i?true:n>=s?n-s<a:false}function BC(e,n){return n<e.header.numSignerAccounts}async function ar({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=vi(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=r??(t.addressTableLookups?await gill.fetchAddressesForLookupTables(t.addressTableLookups.map(a=>a.lookupTableAddress),oe()):{}),i=[];i.push(...t.addressTableLookups?.map(a=>({role:gill.AccountRole.READONLY,address:a.lookupTableAddress}))??[]);for(let[a,o]of t.staticAccounts.entries())i.push({address:o,role:LC(t,a,o,e)});if(t.addressTableLookups)for(let a of t.addressTableLookups){let o=c[a.lookupTableAddress];if(!o)throw new Error(`Address lookup table account ${a.lookupTableAddress} not found`);for(let d of a.writableIndexes){let u=o[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:gill.AccountRole.WRITABLE});}for(let d of a.readonlyIndexes){let u=o[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:gill.AccountRole.READONLY});}}for(let a of s?.filter(o=>o.address!==e)??[]){let o=i.findIndex(d=>d.address===a.address);o===-1?i.push({address:a.address,role:gill.AccountRole.READONLY_SIGNER,signer:a}):i[o].role===gill.AccountRole.READONLY||i[o].role===gill.AccountRole.READONLY_SIGNER?i[o]={address:a.address,role:gill.AccountRole.READONLY_SIGNER,signer:a}:(i[o].role===gill.AccountRole.WRITABLE||i[o].role===gill.AccountRole.WRITABLE_SIGNER)&&(i[o]={address:a.address,role:gill.AccountRole.WRITABLE_SIGNER,signer:a});}return {accountMetas:i,addressLookupTableAccounts:c,transactionMessage:t}}async function hd({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:i=[],jitoBundlesTipAmount:a,compressed:o=false}){let d=await Ie(e),{accountMetas:u,addressLookupTableAccounts:g}=await ar({transactionMessageBytes:r,walletAddress:d,additionalSigners:i,addressesByLookupTableAddress:t}),y=[];return c.length>0&&y.push(F(c)),y.push(o?gi({transactionBuffer:n,payer:s.address,remainingAccounts:u,settingsKey:e}):ci({transactionBuffer:n,payer:s.address,settings:e})),a&&y.push(ji({payer:s,tipAmount:a})),{instructions:y,addressLookupTableAccounts:g}}async function Pd({index:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:i=[],compressed:a=false,simulateProof:o=false,cachedAccounts:d}){let u=Ae(s),g=await Z(e),y=await Ie(g),[{accountMetas:T,addressLookupTableAccounts:f,transactionMessage:E},{settingsReadonlyArgs:x,proof:h,packedAccounts:I}]=await Promise.all([ar({transactionMessageBytes:r,walletAddress:y,additionalSigners:u.filter(O=>!(O instanceof C)),addressesByLookupTableAddress:c}),Te(a,e,n,o,d)]);I.addPreAccounts(T);let S=u.filter(O=>O instanceof C),L=[];for(let O of S){let re=i.length,{domainConfig:pe,verifyArgs:he,signature:Ce,publicKey:Pe,message:Ot}=G(O,re);Ot&&Ce&&Pe&&i.push({message:Ot,signature:Ce,publicKey:Pe}),pe&&(I.addPreAccounts([{address:pe,role:gill.AccountRole.READONLY}]),he?.__option==="Some"&&L.push({domainConfigKey:pe,verifyArgs:he.value}));}let{remainingAccounts:W,systemOffset:q}=I.toAccountMetas(),H=[];i.length>0&&H.push(F(i));let V=kC(E,T);if(a){if(!t||!x)throw new Error("Payer not found or proof args is missing.");let O=b(h,q);H.push(Mi({secp256r1VerifyArgs:L,transactionMessage:V,settingsReadonlyArgs:x,compressedProofArgs:O,payer:t,remainingAccounts:W}));}else H.push(fi({secp256r1VerifyArgs:L,settings:g,transactionMessage:V,remainingAccounts:W}));return {instructions:H,addressLookupTableAccounts:f}}function kC(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 Rk({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:i,compressed:a=false}){let o=Ae(s),d=await Z(e),u=await Ie(d),{settingsReadonlyArgs:g,proof:y,packedAccounts:T}=await Te(a,e,n,false,t),f=[],E=[];for(let S of o)if(S instanceof C){let L=f.length,{domainConfig:W,verifyArgs:q,signature:H,publicKey:V,message:O}=G(S,L);O&&H&&V&&f.push({message:O,signature:H,publicKey:V}),W&&(T.addPreAccounts([{address:W,role:gill.AccountRole.READONLY}]),q?.__option==="Some"&&E.push({domainConfigKey:W,verifyArgs:q.value}));}else T.addPreAccounts([{address:S.address,role:gill.AccountRole.READONLY_SIGNER,signer:S}]);let{remainingAccounts:x,systemOffset:h}=T.toAccountMetas(),I=[];if(f.length>0&&I.push(F(f)),a){if(!i||!g)throw new Error("Payer not found or proof args is missing.");let S=b(y,h);I.push(kc({amount:c,settingsReadonlyArgs:g,compressedProofArgs:S,payer:i,secp256r1VerifyArgs:E,source:u,destination:r,remainingAccounts:x}));}else I.push(Uc({amount:c,secp256r1VerifyArgs:E,source:u,destination:r,settings:d,remainingAccounts:x}));return I}async function kk({index:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:i,payer:a,tokenProgram:o,createAtaIfNeeded:d=true,compressed:u=false}){let g=Ae(t),y=await Z(e),T=await Ie(y),[f,E]=await Promise.all([programs.getAssociatedTokenAccountAddress(s,T,o),programs.getAssociatedTokenAccountAddress(s,r,o)]),{settingsReadonlyArgs:x,proof:h,packedAccounts:I}=await Te(u,e,n,false,c),S=[],L=[];for(let V of g)if(V instanceof C){let O=S.length,{domainConfig:re,verifyArgs:pe,signature:he,publicKey:Ce,message:Pe}=G(V,O);Pe&&he&&Ce&&S.push({message:Pe,signature:he,publicKey:Ce}),re&&(I.addPreAccounts([{address:re,role:gill.AccountRole.READONLY}]),pe?.__option==="Some"&&L.push({domainConfigKey:re,verifyArgs:pe.value}));}else I.addPreAccounts([{address:V.address,role:gill.AccountRole.READONLY_SIGNER,signer:V}]);let{remainingAccounts:W,systemOffset:q}=I.toAccountMetas(),H=[];if(S.length>0&&H.push(F(S)),u){if(!a||!x)throw new Error("Payer not found or proof args is missing.");let V=b(h,q);H.push(qc({amount:i,createAtaIfNeeded:d,settingsReadonlyArgs:x,compressedProofArgs:V,payer:a,secp256r1VerifyArgs:L,source:T,sourceTokenAccount:f,destination:r,destinationTokenAccount:E,mint:s,tokenProgram:o,remainingAccounts:W}));}else H.push(Gc({amount:i,createAtaIfNeeded:d,secp256r1VerifyArgs:L,source:T,sourceTokenAccount:f,destination:r,destinationTokenAccount:E,settings:y,mint:s,tokenProgram:o,remainingAccounts:W}));return H}async function Yk({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:i}){let a=await Bs(oe(),s),o=a.data.multiWalletSettings,{settingsReadonlyArgs:d,proof:u,packedAccounts:g}=await Te(c,e,n,false,i),{remainingAccounts:y,systemOffset:T}=g.toAccountMetas(),{domainConfig:f,verifyArgs:E,message:x,signature:h,publicKey:I}=G(r),S=[];if(x&&h&&I&&S.push(F([{message:x,signature:h,publicKey:I}])),c){if(!t||!d)throw new Error("Payer not found or proof args is missing.");let L=b(u,T);S.push(ca({transactionBuffer:s,domainConfig:f,closer:r instanceof C?void 0:r,rentCollector:a.data.payer,secp256r1VerifyArgs:E,settingsReadonlyArgs:d,payer:t,compressedProofArgs:L,remainingAccounts:y}));}else S.push(ea({transactionBuffer:s,domainConfig:f,closer:r instanceof C?void 0:r,settings:o,payer:a.data.payer,secp256r1VerifyArgs:E,remainingAccounts:[]}));return S}function _d({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:o,compressedArgs:d,expectedSecp256r1Signers:u}){let{domainConfig:g,verifyArgs:y,message:T,signature:f,publicKey:E}=G(n),x=[];if(T&&f&&E&&x.push(F([{message:T,signature:f,publicKey:E}])),d){let{settingsReadonlyArgs:h,compressedProofArgs:I,remainingAccounts:S}=d;x.push(fa({transactionBuffer:t,payer:e,secp256r1VerifyArgs:y,creator:n instanceof C?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:o,preauthorizeExecution:a,expectedSecp256r1Signers:u},settingsReadonlyArgs:h,compressedProofArgs:I,remainingAccounts:S}));}else x.push(ga({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:y,creator:n instanceof C?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:o,preauthorizeExecution:a,expectedSecp256r1Signers:u},remainingAccounts:[]}));return x}function Ud({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:i,message:a,publicKey:o}=G(e),d=[];return a&&i&&o&&d.push(F([{message:a,signature:i,publicKey:o}])),s?d.push(ba({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof C?void 0:e,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(Ma({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof C?void 0:e,remainingAccounts:[]})),d}function Wd({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?Ga({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Ba({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function Ld({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:i,publicKey:a,message:o}=G(n),d=[];return o&&i&&a&&d.push(F([{message:o,signature:i,publicKey:a}])),s?d.push(ei({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof C?void 0:n,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(qa({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof C?void 0:n,remainingAccounts:[]})),d}async function LN({message:e,signer:n,popUp:r}){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");let s=window.origin,t={type:"message",payload:e},c=await Ye()({phase:"start",data:t,redirectOrigin:s,signer:n});return await tr({authUrl:`${Ke()}&sessionToken=${c}`,popUp:r}),await Ye()({phase:"complete",data:{type:"message",sessionToken:c}})}async function NN({transactionActionType:e,transactionAddress:n,transactionMessageBytes:r,signer:s,popUp:t}){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");let c=window.origin,i={type:"transaction",payload:{transactionActionType:e,transactionAddress:n,transactionMessageBytes:Bi(r)}},a=await Ye()({phase:"start",data:i,redirectOrigin:c,signer:s});return await tr({authUrl:`${Ke()}&sessionToken=${a}`,popUp:t}),await Ye()({phase:"complete",data:{type:"transaction",sessionToken:a}})}async function ZN({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:o,compressed:d=false,additionalVoters:u=[],additionalSigners:g=[],chunkSize:y=Math.ceil(s.length/2),cachedAccounts:T}){let f=await Z(n),E=Math.floor(Math.random()*255),x=await ud(f,t instanceof C?t:t.address,E),h=[],I=[];for(let X=0;X<s.length;X+=y){let Bn=s.subarray(X,X+y);h.push(Bn),I.push(sha2_js.sha256(Bn));}let S=sha2_js.sha256(new Uint8Array(s)),{settingsReadonlyArgs:L,proof:W,packedAccounts:q}=await Te(d,n,r,false,T),{remainingAccounts:H,systemOffset:V}=q.toAccountMetas(),O=L?{settingsReadonlyArgs:L,compressedProofArgs:b(W,V),remainingAccounts:H,payer:e}:null,re=Ae([t,...c?[c]:[],...u]).filter(X=>X instanceof C).map(X=>({memberKey:je(X),messageHash:Gi(X.authResponse)})),pe=_d({finalBufferHash:S,finalBufferSize:s.length,bufferIndex:E,payer:e,transactionBufferAddress:x,settings:f,creator:t,preauthorizeExecution:!c,bufferExtendHashes:I,compressedArgs:O,expectedSecp256r1Signers:re}),he=h.map(X=>Wd({transactionMessageBytes:X,transactionBufferAddress:x,settings:f,compressed:d})),Ce=u.map(X=>Ld({voter:X,transactionBufferAddress:x,settings:f,compressedArgs:O})),Pe=Ud({compressedArgs:O,settings:f,executor:c,transactionBufferAddress:x}),{instructions:Ot,addressLookupTableAccounts:wd}=await hd({compressed:d,settings:f,transactionMessageBytes:s,transactionBufferAddress:x,payer:e,additionalSigners:g,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:o}),Qe=X=>({payer:e,instructions:X,addressesByLookupTableAddress:wd});return [Qe(pe),...he.map(X=>Qe([X])),...Ce.length?[Qe(Ce.flat())]:[],Qe(Pe),Qe(Ot)]}var dr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let s=new Map,t=i=>{let a=s.get(i);return a===void 0&&(a={isSigner:false,isWritable:false,isInvoked:false},s.set(i,a)),a},c=t(r);c.isSigner=true,c.isWritable=true;for(let i of n){t(i.programAddress).isInvoked=false;for(let a of i.accounts??[]){let o=t(a.address);o.isSigner||=a.role===gill.AccountRole.READONLY_SIGNER||a.role===gill.AccountRole.WRITABLE_SIGNER,o.isWritable||=a.role===gill.AccountRole.WRITABLE||a.role===gill.AccountRole.WRITABLE_SIGNER;}}return new e(r,s)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,o])=>o.isSigner&&o.isWritable),s=n.filter(([,o])=>o.isSigner&&!o.isWritable),t=n.filter(([,o])=>!o.isSigner&&o.isWritable),c=n.filter(([,o])=>!o.isSigner&&!o.isWritable),i={numSignerAccounts:r.length+s.length,numReadonlySignerAccounts:s.length,numReadonlyNonSignerAccounts:c.length};{if(r.length===0)throw new Error("Expected at least one writable signer key");let[o]=r[0];if(o!==this.payer)throw new Error("Expected first writable signer key to be the fee payer")}let a=[...r.map(([o])=>o),...s.map(([o])=>o),...t.map(([o])=>o),...c.map(([o])=>o)];return [i,a]}extractTableLookup(n){let[r,s]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&i.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&!i.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:s,readonly:c}}}drainKeysFoundInLookupTable(n,r){let s=new Array,t=new Array;for(let[c,i]of this.keyMetaMap.entries())if(r(i)){let a=c,o=n.findIndex(d=>d===a);if(o>=0){if(o>=256)throw new Error("Max lookup table index exceeded");s.push(o),t.push(a),this.keyMetaMap.delete(c);}}return [s,t]}};var ur=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let s=new Map;this.keySegments().flat().forEach((c,i)=>{s.set(c,i);});let t=c=>{let i=s.get(c);if(i===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return i};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(i=>t(i.address))??[],data:c.data}))}};function Bd({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=dr.compile(r,e),c=new Array,i={writable:[],readonly:[]},a=Object.entries(s??{});for(let y of a){let T=t.extractTableLookup(y);if(T!==void 0){let{addressTableLookup:f,drainedKeys:E}=T;c.push({readonlyIndexes:f.readonlyIndexes,readableIndices:f.readonlyIndexes,writableIndexes:f.writableIndexes,writableIndices:f.writableIndexes,lookupTableAddress:gill.address(f.lookupTableAddress)}),i.writable.push(...E.writable),i.readonly.push(...E.readonly);}}let[o,d]=t.getMessageComponents(),g=new ur(d,i).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function d2({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=Bd({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return Ri(s)}async function m2({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:i,cachedAccounts:a,compressed:o=false,simulateProof:d=false}){let{instructions:u,addressLookupTableAccounts:g}=await Pd({index:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:i,simulateProof:d,cachedAccounts:a});return {payer:e,instructions:u,addressesByLookupTableAddress:g}}
|
|
2
|
+
exports.ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR=Js;exports.CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR=no;exports.CHANGE_CONFIG_DISCRIMINATOR=$s;exports.COMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR=uo;exports.CREATE_DOMAIN_CONFIG_DISCRIMINATOR=Io;exports.CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR=Eo;exports.CREATE_GLOBAL_COUNTER_DISCRIMINATOR=vo;exports.CREATE_MULTI_WALLET_COMPRESSED_DISCRIMINATOR=Lo;exports.CREATE_USER_ACCOUNTS_DISCRIMINATOR=ko;exports.DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR=Fo;exports.DISABLE_DOMAIN_CONFIG_DISCRIMINATOR=Yo;exports.DOMAIN_CONFIG_DISCRIMINATOR=wn;exports.EDIT_DOMAIN_CONFIG_DISCRIMINATOR=rc;exports.EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR=ac;exports.EDIT_USER_DELEGATE_DISCRIMINATOR=yc;exports.GLOBAL_COUNTER_DISCRIMINATOR=Fn;exports.KeyType=Ut;exports.MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR=Sc;exports.MIGRATE_COMPRESSED_USERS_DISCRIMINATOR=Ec;exports.MULTI_WALLET_ERROR__ALREADY_DELEGATED=Ex;exports.MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH=rx;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED=zx;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING=Kx;exports.MULTI_WALLET_ERROR__DUPLICATE_MEMBER=ox;exports.MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED=sx;exports.MULTI_WALLET_ERROR__EMPTY_MEMBERS=px;exports.MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH=yx;exports.MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH=nx;exports.MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH=Ax;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH=Lx;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED=Ox;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH=Bx;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION=Rx;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION=hx;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION=Px;exports.MULTI_WALLET_ERROR__INVALID_ACCOUNT=xx;exports.MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE=qx;exports.MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG=mx;exports.MULTI_WALLET_ERROR__INVALID_ARGUMENTS=Cx;exports.MULTI_WALLET_ERROR__INVALID_BUFFER=Wx;exports.MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS=vx;exports.MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS=Sx;exports.MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG=ix;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION=ZS;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY=QS;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG=YS;exports.MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS=$S;exports.MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT=Gx;exports.MULTI_WALLET_ERROR__INVALID_THRESHOLD=lx;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG=gx;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION=ux;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE=fx;exports.MULTI_WALLET_ERROR__INVALID_USER_ROLE=Ix;exports.MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE=ex;exports.MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED=Hx;exports.MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG=Jx;exports.MULTI_WALLET_ERROR__MISSING_ACCOUNT=Dx;exports.MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY=Vx;exports.MULTI_WALLET_ERROR__MISSING_USER_ARGS=Mx;exports.MULTI_WALLET_ERROR__NO_SIGNER_FOUND=_x;exports.MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED=ax;exports.MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED=dx;exports.MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS=jx;exports.MULTI_WALLET_ERROR__PERMANENT_MEMBER=cx;exports.MULTI_WALLET_ERROR__PROTECTED_ACCOUNT=Nx;exports.MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH=tx;exports.MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS=XS;exports.MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND=Fx;exports.MULTI_WALLET_ERROR__TOO_MANY_MEMBERS=Tx;exports.MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED=wx;exports.MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED=kx;exports.MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER=Ux;exports.MULTI_WALLET_ERROR__UNEXPECTED_SIGNER=bx;exports.MULTI_WALLET_PROGRAM_ADDRESS=A;exports.MultiWalletAccount=JS;exports.MultiWalletInstruction=jS;exports.NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=Oc;exports.NATIVE_TRANSFER_INTENT_DISCRIMINATOR=bc;exports.Permission=xe;exports.Permissions=De;exports.SETTINGS_DISCRIMINATOR=hs;exports.Secp256r1Key=Me;exports.SignedSecp256r1Key=C;exports.TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=Jc;exports.TOKEN_TRANSFER_INTENT_DISCRIMINATOR=Hc;exports.TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR=na;exports.TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR=Xc;exports.TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR=pa;exports.TRANSACTION_BUFFER_CREATE_DISCRIMINATOR=da;exports.TRANSACTION_BUFFER_DISCRIMINATOR=Ws;exports.TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR=Pa;exports.TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR=Ia;exports.TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR=Na;exports.TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR=Wa;exports.TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR=Xa;exports.TRANSACTION_BUFFER_VOTE_DISCRIMINATOR=Ka;exports.TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR=di;exports.TRANSACTION_EXECUTE_DISCRIMINATOR=ni;exports.TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR=Ii;exports.TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR=pi;exports.UserRole=Oe;exports.WHITELISTED_ADDRESS_TREE_DISCRIMINATOR=Ns;exports.addWhitelistedAddressTrees=aB;exports.changeConfig=zO;exports.closeTransactionBuffer=Yk;exports.compressSettingsAccount=sB;exports.configAction=RD;exports.convertMemberKeyToString=yd;exports.convertPubkeyCompressedToCose=iL;exports.convertPubkeyCoseToCompressed=aL;exports.createDomainConfig=mB;exports.createDomainUserAccounts=MB;exports.createGlobalCounter=RB;exports.createPopUp=Hi;exports.createTransactionBuffer=_d;exports.createTransactionManagerSigner=uC;exports.createUserAccounts=OB;exports.createWallet=zw;exports.decodeDomainConfig=Nn;exports.decodeGlobalCounter=Kn;exports.decodeSettings=Rs;exports.decodeTransactionBuffer=Os;exports.decodeWhitelistedAddressTree=Vs;exports.decompressSettingsAccount=ek;exports.disableDomainConfig=NB;exports.editDomainConfig=JB;exports.editTransactionManagerUrl=$B;exports.editUserDelegate=iw;exports.executeTransaction=hd;exports.executeTransactionBuffer=Ud;exports.executeTransactionSync=Pd;exports.extendTransactionBuffer=Wd;exports.fetchAllDomainConfig=FC;exports.fetchAllGlobalCounter=ZC;exports.fetchAllMaybeDomainConfig=Xd;exports.fetchAllMaybeGlobalCounter=yu;exports.fetchAllMaybeSettings=Cy;exports.fetchAllMaybeTransactionBuffer=zy;exports.fetchAllMaybeWhitelistedAddressTree=um;exports.fetchAllSettings=Th;exports.fetchAllTransactionBuffer=Dh;exports.fetchAllWhitelistedAddressTree=Rh;exports.fetchCompressedAccount=Qi;exports.fetchDomainConfig=Hn;exports.fetchGlobalCounter=YC;exports.fetchMaybeDomainConfig=Zd;exports.fetchMaybeGlobalCounter=gu;exports.fetchMaybeSettings=zr;exports.fetchMaybeSettingsAccountData=JI;exports.fetchMaybeTransactionBuffer=Fy;exports.fetchMaybeUserAccountData=KI;exports.fetchMaybeWhitelistedAddressTree=dm;exports.fetchSettings=ph;exports.fetchSettingsAccountData=Lt;exports.fetchTransactionBuffer=Bs;exports.fetchUserAccountData=or;exports.fetchWhitelistedAddressTree=Gs;exports.getAddMemberArgsCodec=tD;exports.getAddMemberArgsDecoder=gr;exports.getAddMemberArgsEncoder=Ar;exports.getAddWhitelistedAddressTreesDiscriminatorBytes=Kh;exports.getAddWhitelistedAddressTreesInstruction=jh;exports.getAddWhitelistedAddressTreesInstructionAsync=qs;exports.getAddWhitelistedAddressTreesInstructionDataCodec=Jh;exports.getAddWhitelistedAddressTreesInstructionDataDecoder=js;exports.getAddWhitelistedAddressTreesInstructionDataEncoder=$r;exports.getAuthEndpoint=Ke;exports.getChangeConfigCompressedDiscriminatorBytes=AP;exports.getChangeConfigCompressedInstruction=co;exports.getChangeConfigCompressedInstructionDataCodec=gP;exports.getChangeConfigCompressedInstructionDataDecoder=oo;exports.getChangeConfigCompressedInstructionDataEncoder=so;exports.getChangeConfigDiscriminatorBytes=tP;exports.getChangeConfigInstruction=nP;exports.getChangeConfigInstructionAsync=eo;exports.getChangeConfigInstructionDataCodec=rP;exports.getChangeConfigInstructionDataDecoder=Qs;exports.getChangeConfigInstructionDataEncoder=Qr;exports.getClientAndDeviceHash=aI;exports.getCompiledInstructionCodec=sD;exports.getCompiledInstructionDecoder=mr;exports.getCompiledInstructionEncoder=yr;exports.getCompressSettingsAccountDiscriminatorBytes=xP;exports.getCompressSettingsAccountInstruction=yo;exports.getCompressSettingsAccountInstructionDataCodec=IP;exports.getCompressSettingsAccountInstructionDataDecoder=go;exports.getCompressSettingsAccountInstructionDataEncoder=Ao;exports.getCompressedAccountMetaCodec=iD;exports.getCompressedAccountMetaDecoder=nt;exports.getCompressedAccountMetaEncoder=rt;exports.getCompressedAccountMetaReadOnlyCodec=gD;exports.getCompressedAccountMetaReadOnlyDecoder=at;exports.getCompressedAccountMetaReadOnlyEncoder=ct;exports.getCompressedProofCodec=pD;exports.getCompressedProofDecoder=xr;exports.getCompressedProofEncoder=Sr;exports.getCompressedSettingsAddressFromIndex=j;exports.getCompressedSettingsCodec=SD;exports.getCompressedSettingsDataCodec=DD;exports.getCompressedSettingsDataDecoder=ut;exports.getCompressedSettingsDataEncoder=dt;exports.getCompressedSettingsDecoder=z;exports.getCompressedSettingsEncoder=it;exports.getComputeBudgetEstimate=Zi;exports.getConfigActionCodec=PD;exports.getConfigActionDecoder=mt;exports.getConfigActionEncoder=yt;exports.getCreateDomainConfigDiscriminatorBytes=vP;exports.getCreateDomainConfigInstruction=_P;exports.getCreateDomainConfigInstructionAsync=Do;exports.getCreateDomainConfigInstructionDataCodec=bP;exports.getCreateDomainConfigInstructionDataDecoder=Co;exports.getCreateDomainConfigInstructionDataEncoder=tn;exports.getCreateDomainUserAccountDiscriminatorBytes=NP;exports.getCreateDomainUserAccountInstruction=VP;exports.getCreateDomainUserAccountInstructionAsync=Po;exports.getCreateDomainUserAccountInstructionDataCodec=HP;exports.getCreateDomainUserAccountInstructionDataDecoder=ho;exports.getCreateDomainUserAccountInstructionDataEncoder=nn;exports.getCreateGlobalCounterDiscriminatorBytes=qP;exports.getCreateGlobalCounterInstruction=ZP;exports.getCreateGlobalCounterInstructionAsync=_o;exports.getCreateGlobalCounterInstructionDataCodec=YP;exports.getCreateGlobalCounterInstructionDataDecoder=bo;exports.getCreateGlobalCounterInstructionDataEncoder=on;exports.getCreateMultiWalletCompressedDiscriminatorBytes=sR;exports.getCreateMultiWalletCompressedInstruction=cR;exports.getCreateMultiWalletCompressedInstructionAsync=Bo;exports.getCreateMultiWalletCompressedInstructionDataCodec=oR;exports.getCreateMultiWalletCompressedInstructionDataDecoder=Oo;exports.getCreateMultiWalletCompressedInstructionDataEncoder=cn;exports.getCreateUserAccountArgsCodec=WD;exports.getCreateUserAccountArgsDecoder=Rr;exports.getCreateUserAccountArgsEncoder=Pr;exports.getCreateUserAccountsDiscriminatorBytes=mR;exports.getCreateUserAccountsInstruction=TR;exports.getCreateUserAccountsInstructionAsync=Ho;exports.getCreateUserAccountsInstructionDataCodec=pR;exports.getCreateUserAccountsInstructionDataDecoder=No;exports.getCreateUserAccountsInstructionDataEncoder=dn;exports.getDecompressSettingsAccountDiscriminatorBytes=MR;exports.getDecompressSettingsAccountInstruction=Jo;exports.getDecompressSettingsAccountInstructionDataCodec=ER;exports.getDecompressSettingsAccountInstructionDataDecoder=Ko;exports.getDecompressSettingsAccountInstructionDataEncoder=zo;exports.getDisableDomainConfigDiscriminatorBytes=UR;exports.getDisableDomainConfigInstruction=$o;exports.getDisableDomainConfigInstructionDataCodec=WR;exports.getDisableDomainConfigInstructionDataDecoder=Xo;exports.getDisableDomainConfigInstructionDataEncoder=Zo;exports.getDomainConfigAddress=Je;exports.getDomainConfigCodec=GC;exports.getDomainConfigDecoder=kn;exports.getDomainConfigDiscriminatorBytes=VC;exports.getDomainConfigEncoder=Yd;exports.getDomainConfigSize=zC;exports.getEditDomainConfigDiscriminatorBytes=VR;exports.getEditDomainConfigInstruction=sc;exports.getEditDomainConfigInstructionAsync=FR;exports.getEditDomainConfigInstructionDataCodec=GR;exports.getEditDomainConfigInstructionDataDecoder=nc;exports.getEditDomainConfigInstructionDataEncoder=An;exports.getEditMemberArgsCodec=wD;exports.getEditMemberArgsDecoder=Mr;exports.getEditMemberArgsEncoder=Dr;exports.getEditTransactionManagerUrlDiscriminatorBytes=XR;exports.getEditTransactionManagerUrlInstruction=uc;exports.getEditTransactionManagerUrlInstructionDataCodec=$R;exports.getEditTransactionManagerUrlInstructionDataDecoder=dc;exports.getEditTransactionManagerUrlInstructionDataEncoder=ic;exports.getEditUserDelegateDiscriminatorBytes=cv;exports.getEditUserDelegateInstruction=Tc;exports.getEditUserDelegateInstructionDataCodec=av;exports.getEditUserDelegateInstructionDataDecoder=pc;exports.getEditUserDelegateInstructionDataEncoder=mc;exports.getExpectedSecp256r1SignersCodec=VD;exports.getExpectedSecp256r1SignersDecoder=Tt;exports.getExpectedSecp256r1SignersEncoder=pt;exports.getFeePayer=hL;exports.getGlobalCounterAddress=dd;exports.getGlobalCounterCodec=qC;exports.getGlobalCounterDecoder=zn;exports.getGlobalCounterDiscriminatorBytes=jC;exports.getGlobalCounterEncoder=Au;exports.getGlobalCounterSize=XC;exports.getJitoTipsConfig=En;exports.getLightCpiSigner=uO;exports.getLightProtocolRpc=Ne;exports.getLinkWalletArgsCodec=KD;exports.getLinkWalletArgsDecoder=br;exports.getLinkWalletArgsEncoder=vr;exports.getMemberCodec=YD;exports.getMemberDecoder=gt;exports.getMemberEncoder=At;exports.getMemberKeyCodec=$D;exports.getMemberKeyDecoder=Q;exports.getMemberKeyEncoder=$;exports.getMigrateCompressedSettingsDiscriminatorBytes=pv;exports.getMigrateCompressedSettingsInstruction=Cc;exports.getMigrateCompressedSettingsInstructionDataCodec=Tv;exports.getMigrateCompressedSettingsInstructionDataDecoder=Ic;exports.getMigrateCompressedSettingsInstructionDataEncoder=xc;exports.getMigrateCompressedUsersDiscriminatorBytes=Mv;exports.getMigrateCompressedUsersInstruction=Rc;exports.getMigrateCompressedUsersInstructionDataCodec=Ev;exports.getMigrateCompressedUsersInstructionDataDecoder=Pc;exports.getMigrateCompressedUsersInstructionDataEncoder=hc;exports.getMultiWalletErrorMessage=lW;exports.getNativeTransferIntentCompressedDiscriminatorBytes=Fv;exports.getNativeTransferIntentCompressedInstruction=kc;exports.getNativeTransferIntentCompressedInstructionDataCodec=zv;exports.getNativeTransferIntentCompressedInstructionDataDecoder=wc;exports.getNativeTransferIntentCompressedInstructionDataEncoder=Bc;exports.getNativeTransferIntentDiscriminatorBytes=Wv;exports.getNativeTransferIntentInstruction=Uc;exports.getNativeTransferIntentInstructionAsync=Ov;exports.getNativeTransferIntentInstructionDataCodec=Lv;exports.getNativeTransferIntentInstructionDataDecoder=_c;exports.getNativeTransferIntentInstructionDataEncoder=gn;exports.getNewAuthorityArgsCodec=rM;exports.getNewAuthorityArgsDecoder=Lr;exports.getNewAuthorityArgsEncoder=Wr;exports.getOnClientAuthorizationCallback=Ye;exports.getOriginIndex=uL;exports.getPackedAddressTreeInfoCodec=oM;exports.getPackedAddressTreeInfoDecoder=ft;exports.getPackedAddressTreeInfoEncoder=lt;exports.getPackedStateTreeInfoCodec=iM;exports.getPackedStateTreeInfoDecoder=ot;exports.getPackedStateTreeInfoEncoder=st;exports.getPermissionsCodec=AM;exports.getPermissionsDecoder=ve;exports.getPermissionsEncoder=Re;exports.getProofArgsCodec=pM;exports.getProofArgsDecoder=M;exports.getProofArgsEncoder=D;exports.getRemoveMemberArgsCodec=SM;exports.getRemoveMemberArgsDecoder=hr;exports.getRemoveMemberArgsEncoder=Er;exports.getRpId=PL;exports.getSecp256r1Message=Cn;exports.getSecp256r1MessageHash=Gi;exports.getSecp256r1PubkeyCodec=CM;exports.getSecp256r1PubkeyDecoder=St;exports.getSecp256r1PubkeyEncoder=Or;exports.getSecp256r1SignatureOffsetsDataDecoder=vC;exports.getSecp256r1SignatureOffsetsDataEncoder=RC;exports.getSecp256r1VerifyArgsCodec=EM;exports.getSecp256r1VerifyArgsDecoder=w;exports.getSecp256r1VerifyArgsEncoder=B;exports.getSecp256r1VerifyArgsWithDomainAddressCodec=vM;exports.getSecp256r1VerifyArgsWithDomainAddressDecoder=te;exports.getSecp256r1VerifyArgsWithDomainAddressEncoder=ee;exports.getSecp256r1VerifyInstruction=F;exports.getSecp256r1VerifyInstructionDataCodec=jO;exports.getSecp256r1VerifyInstructionDataDecoder=Sd;exports.getSecp256r1VerifyInstructionDataEncoder=xd;exports.getSendAndConfirmTransaction=Yi;exports.getSettingsCodec=mh;exports.getSettingsCreationArgsCodec=WM;exports.getSettingsCreationArgsDecoder=It;exports.getSettingsCreationArgsEncoder=xt;exports.getSettingsDecoder=Ps;exports.getSettingsDiscriminatorBytes=yh;exports.getSettingsEncoder=Iy;exports.getSettingsFromIndex=Z;exports.getSettingsIndexWithAddressCodec=BM;exports.getSettingsIndexWithAddressDecoder=Dt;exports.getSettingsIndexWithAddressEncoder=Ct;exports.getSettingsMutArgsCodec=HM;exports.getSettingsMutArgsDecoder=ue;exports.getSettingsMutArgsEncoder=de;exports.getSettingsReadonlyArgsCodec=zM;exports.getSettingsReadonlyArgsDecoder=se;exports.getSettingsReadonlyArgsEncoder=ne;exports.getSettingsSize=lh;exports.getSignedSecp256r1Key=dL;exports.getSignedTransactionManager=EO;exports.getSolanaRpc=oe;exports.getSolanaRpcEndpoint=qe;exports.getTokenTransferIntentCompressedDiscriminatorBytes=ib;exports.getTokenTransferIntentCompressedInstruction=qc;exports.getTokenTransferIntentCompressedInstructionAsync=ub;exports.getTokenTransferIntentCompressedInstructionDataCodec=db;exports.getTokenTransferIntentCompressedInstructionDataDecoder=jc;exports.getTokenTransferIntentCompressedInstructionDataEncoder=pn;exports.getTokenTransferIntentDiscriminatorBytes=$v;exports.getTokenTransferIntentInstruction=Gc;exports.getTokenTransferIntentInstructionAsync=eb;exports.getTokenTransferIntentInstructionDataCodec=Qv;exports.getTokenTransferIntentInstructionDataDecoder=Vc;exports.getTokenTransferIntentInstructionDataEncoder=mn;exports.getTransactionBufferAddress=ud;exports.getTransactionBufferCloseCompressedDiscriminatorBytes=Pb;exports.getTransactionBufferCloseCompressedInstruction=ca;exports.getTransactionBufferCloseCompressedInstructionDataCodec=Rb;exports.getTransactionBufferCloseCompressedInstructionDataDecoder=oa;exports.getTransactionBufferCloseCompressedInstructionDataEncoder=sa;exports.getTransactionBufferCloseDiscriminatorBytes=fb;exports.getTransactionBufferCloseInstruction=ea;exports.getTransactionBufferCloseInstructionDataCodec=Sb;exports.getTransactionBufferCloseInstructionDataDecoder=Qc;exports.getTransactionBufferCloseInstructionDataEncoder=$c;exports.getTransactionBufferCodec=Ch;exports.getTransactionBufferCreateArgsCodec=qM;exports.getTransactionBufferCreateArgsDecoder=Et;exports.getTransactionBufferCreateArgsEncoder=Mt;exports.getTransactionBufferCreateCompressedDiscriminatorBytes=Kb;exports.getTransactionBufferCreateCompressedInstruction=fa;exports.getTransactionBufferCreateCompressedInstructionDataCodec=Jb;exports.getTransactionBufferCreateCompressedInstructionDataDecoder=la;exports.getTransactionBufferCreateCompressedInstructionDataEncoder=Ta;exports.getTransactionBufferCreateDiscriminatorBytes=Bb;exports.getTransactionBufferCreateInstruction=ga;exports.getTransactionBufferCreateInstructionDataCodec=wb;exports.getTransactionBufferCreateInstructionDataDecoder=Aa;exports.getTransactionBufferCreateInstructionDataEncoder=ua;exports.getTransactionBufferDecoder=Ls;exports.getTransactionBufferDiscriminatorBytes=Ih;exports.getTransactionBufferEncoder=Gy;exports.getTransactionBufferExecuteCompressedDiscriminatorBytes=d_;exports.getTransactionBufferExecuteCompressedInstruction=ba;exports.getTransactionBufferExecuteCompressedInstructionDataCodec=u_;exports.getTransactionBufferExecuteCompressedInstructionDataDecoder=va;exports.getTransactionBufferExecuteCompressedInstructionDataEncoder=Ra;exports.getTransactionBufferExecuteDiscriminatorBytes=e_;exports.getTransactionBufferExecuteInstruction=Ma;exports.getTransactionBufferExecuteInstructionDataCodec=t_;exports.getTransactionBufferExecuteInstructionDataDecoder=Da;exports.getTransactionBufferExecuteInstructionDataEncoder=Ca;exports.getTransactionBufferExtendCompressedDiscriminatorBytes=E_;exports.getTransactionBufferExtendCompressedInstruction=Ga;exports.getTransactionBufferExtendCompressedInstructionDataCodec=h_;exports.getTransactionBufferExtendCompressedInstructionDataDecoder=Va;exports.getTransactionBufferExtendCompressedInstructionDataEncoder=Ha;exports.getTransactionBufferExtendDiscriminatorBytes=l_;exports.getTransactionBufferExtendInstruction=Ba;exports.getTransactionBufferExtendInstructionDataCodec=f_;exports.getTransactionBufferExtendInstructionDataDecoder=Oa;exports.getTransactionBufferExtendInstructionDataEncoder=La;exports.getTransactionBufferVoteCompressedDiscriminatorBytes=F_;exports.getTransactionBufferVoteCompressedInstruction=ei;exports.getTransactionBufferVoteCompressedInstructionDataCodec=z_;exports.getTransactionBufferVoteCompressedInstructionDataDecoder=Qa;exports.getTransactionBufferVoteCompressedInstructionDataEncoder=$a;exports.getTransactionBufferVoteDiscriminatorBytes=L_;exports.getTransactionBufferVoteInstruction=qa;exports.getTransactionBufferVoteInstructionDataCodec=O_;exports.getTransactionBufferVoteInstructionDataDecoder=ja;exports.getTransactionBufferVoteInstructionDataEncoder=Ja;exports.getTransactionExecuteCompressedDiscriminatorBytes=oU;exports.getTransactionExecuteCompressedInstruction=gi;exports.getTransactionExecuteCompressedInstructionDataCodec=cU;exports.getTransactionExecuteCompressedInstructionDataDecoder=Ai;exports.getTransactionExecuteCompressedInstructionDataEncoder=ui;exports.getTransactionExecuteDiscriminatorBytes=X_;exports.getTransactionExecuteInstruction=ci;exports.getTransactionExecuteInstructionDataCodec=$_;exports.getTransactionExecuteInstructionDataDecoder=oi;exports.getTransactionExecuteInstructionDataEncoder=si;exports.getTransactionExecuteSyncCompressedDiscriminatorBytes=DU;exports.getTransactionExecuteSyncCompressedInstruction=Mi;exports.getTransactionExecuteSyncCompressedInstructionDataCodec=MU;exports.getTransactionExecuteSyncCompressedInstructionDataDecoder=Di;exports.getTransactionExecuteSyncCompressedInstructionDataEncoder=Ci;exports.getTransactionExecuteSyncDiscriminatorBytes=mU;exports.getTransactionExecuteSyncInstruction=fi;exports.getTransactionExecuteSyncInstructionDataCodec=pU;exports.getTransactionExecuteSyncInstructionDataDecoder=li;exports.getTransactionExecuteSyncInstructionDataEncoder=Ti;exports.getTransactionMessageAddressTableLookupCodec=tE;exports.getTransactionMessageAddressTableLookupDecoder=wr;exports.getTransactionMessageAddressTableLookupEncoder=Br;exports.getTransactionMessageCodec=$M;exports.getTransactionMessageDecoder=Pt;exports.getTransactionMessageEncoder=ht;exports.getUserAccountAddress=N;exports.getUserCodec=oE;exports.getUserCreationArgsCodec=dE;exports.getUserCreationArgsDecoder=me;exports.getUserCreationArgsEncoder=ye;exports.getUserDecoder=J;exports.getUserEncoder=Le;exports.getUserMutArgsCodec=yE;exports.getUserMutArgsDecoder=Se;exports.getUserMutArgsEncoder=fe;exports.getUserReadOnlyArgsCodec=lE;exports.getUserReadOnlyArgsDecoder=Vr;exports.getUserReadOnlyArgsEncoder=Hr;exports.getUserReadOnlyOrMutateArgsCodec=IE;exports.getUserReadOnlyOrMutateArgsDecoder=_e;exports.getUserReadOnlyOrMutateArgsEncoder=be;exports.getUserRoleCodec=hE;exports.getUserRoleDecoder=We;exports.getUserRoleEncoder=Ue;exports.getWalletAddressFromIndex=Ad;exports.getWalletAddressFromSettings=Ie;exports.getWhitelistedAddressTreeCodec=Ph;exports.getWhitelistedAddressTreeDecoder=Hs;exports.getWhitelistedAddressTreeDiscriminatorBytes=hh;exports.getWhitelistedAddressTreeEncoder=im;exports.getWhitelistedAddressTreeFromIndex=Pn;exports.getWhitelistedAddressTreeIndexFromAddress=tO;exports.getWhitelistedAddressTreesAddress=ed;exports.identifyMultiWalletAccount=uW;exports.identifyMultiWalletInstruction=AW;exports.initialize=vL;exports.isConfigAction=vD;exports.isMultiWalletError=fW;exports.isUserReadOnlyOrMutateArgs=DE;exports.migrateSettings=pw;exports.migrateUsers=Cw;exports.nativeTransferIntent=Rk;exports.parseAddWhitelistedAddressTreesInstruction=qh;exports.parseChangeConfigCompressedInstruction=yP;exports.parseChangeConfigInstruction=sP;exports.parseCompressSettingsAccountInstruction=CP;exports.parseCreateDomainConfigInstruction=UP;exports.parseCreateDomainUserAccountInstruction=GP;exports.parseCreateGlobalCounterInstruction=XP;exports.parseCreateMultiWalletCompressedInstruction=aR;exports.parseCreateUserAccountsInstruction=lR;exports.parseDecompressSettingsAccountInstruction=hR;exports.parseDisableDomainConfigInstruction=LR;exports.parseEditDomainConfigInstruction=zR;exports.parseEditTransactionManagerUrlInstruction=QR;exports.parseEditUserDelegateInstruction=iv;exports.parseMigrateCompressedSettingsInstruction=lv;exports.parseMigrateCompressedUsersInstruction=hv;exports.parseNativeTransferIntentCompressedInstruction=Kv;exports.parseNativeTransferIntentInstruction=Bv;exports.parseSecp256r1VerifyInstruction=qO;exports.parseTokenTransferIntentCompressedInstruction=Ab;exports.parseTokenTransferIntentInstruction=tb;exports.parseTransactionBufferCloseCompressedInstruction=vb;exports.parseTransactionBufferCloseInstruction=xb;exports.parseTransactionBufferCreateCompressedInstruction=jb;exports.parseTransactionBufferCreateInstruction=kb;exports.parseTransactionBufferExecuteCompressedInstruction=A_;exports.parseTransactionBufferExecuteInstruction=r_;exports.parseTransactionBufferExtendCompressedInstruction=P_;exports.parseTransactionBufferExtendInstruction=S_;exports.parseTransactionBufferVoteCompressedInstruction=K_;exports.parseTransactionBufferVoteInstruction=B_;exports.parseTransactionExecuteCompressedInstruction=aU;exports.parseTransactionExecuteInstruction=Q_;exports.parseTransactionExecuteSyncCompressedInstruction=EU;exports.parseTransactionExecuteSyncInstruction=TU;exports.pollJitoBundleConfirmation=DO;exports.prepareTransactionBundle=ZN;exports.prepareTransactionMessage=d2;exports.prepareTransactionSync=m2;exports.retrieveTransactionManager=MO;exports.sendJitoBundle=dC;exports.signAndSendBundledTransactions=IO;exports.signAndSendTransaction=CO;exports.signMessageWithPasskey=LN;exports.signTransactionWithPasskey=NN;exports.tokenTransferIntent=kk;exports.uninitialize=RL;exports.userReadOnlyOrMutateArgs=CE;exports.vaultTransactionMessageDeserialize=vi;exports.vaultTransactionMessageSerialize=Ri;exports.voteTransactionBuffer=Ld;//# sourceMappingURL=index.cjs.map
|
|
3
3
|
//# sourceMappingURL=index.cjs.map
|