@revibase/core 0.0.24 → 0.0.25
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,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'),nist_js=require('@noble/curves/nist.js'),tinyCbor=require('@levischuck/tiny-cbor');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 KC(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Hn)}function $d(){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 JC(){return gill.combineCodec($d(),Vn())}function Gn(e){return gill.decodeAccount(e,Vn())}async function Fn(e,n,r){let s=await Qd(e,n,r);return gill.assertAccountExists(s),s}async function Qd(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Gn(s)}async function jC(e,n,r){let s=await eu(e,n,r);return gill.assertAccountsExist(s),s}async function eu(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Gn(t))}function qC(){return 846}var Jn=new Uint8Array([42,206,176,58,175,129,130,233]);function XC(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Jn)}function pu(){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 $C(){return gill.combineCodec(pu(),jn())}function qn(e){return gill.decodeAccount(e,jn())}async function QC(e,n,r){let s=await mu(e,n,r);return gill.assertAccountExists(s),s}async function mu(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return qn(s)}async function eD(e,n,r){let s=await Tu(e,n,r);return gill.assertAccountsExist(s),s}async function Tu(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>qn(t))}function tD(){return 24}function mr(){return gill.getStructEncoder([["memberKey",$()],["permissions",ve()],["verifyArgs",gill.getOptionEncoder(B())],["userArgs",_e()]])}function Tr(){return gill.getStructDecoder([["memberKey",Q()],["permissions",be()],["verifyArgs",gill.getOptionDecoder(w())],["userArgs",Ue()]])}function oD(){return gill.combineCodec(mr(),Tr())}function lr(){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 iD(){return gill.combineCodec(lr(),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 gD(){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 TD(){return gill.combineCodec(at(),it())}function Dr(){return gill.getStructEncoder([["a",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["b",gill.fixEncoderSize(gill.getBytesEncoder(),64)],["c",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function Mr(){return gill.getStructDecoder([["a",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["b",gill.fixDecoderSize(gill.getBytesDecoder(),64)],["c",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function SD(){return gill.combineCodec(Dr(),Mr())}function dt(){return gill.getStructEncoder([["data",gill.getOptionEncoder(ut())]])}function z(){return gill.getStructDecoder([["data",gill.getOptionDecoder(At())]])}function DD(){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 PD(){return gill.combineCodec(ut(),At())}function pt(){return gill.getDiscriminatedUnionEncoder([["EditPermissions",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Pr())])]])],["AddMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(mr())])]])],["RemoveMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(vr())])]])],["SetThreshold",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getU8Encoder()])]])]])}function mt(){return gill.getDiscriminatedUnionDecoder([["EditPermissions",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(Rr())])]])],["AddMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(Tr())])]])],["RemoveMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(br())])]])],["SetThreshold",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getU8Decoder()])]])]])}function _D(){return gill.combineCodec(pt(),mt())}function UD(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function WD(e,n){return n.__kind===e}function _r(){return gill.getStructEncoder([["member",gill.getAddressEncoder()],["role",We()],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userCreationArgs",ye()]])}function Ur(){return gill.getStructDecoder([["member",gill.getAddressDecoder()],["role",Le()],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userCreationArgs",pe()]])}function wD(){return gill.combineCodec(_r(),Ur())}function Pr(){return gill.getStructEncoder([["memberKey",$()],["permissions",ve()]])}function Rr(){return gill.getStructDecoder([["memberKey",Q()],["permissions",be()]])}function VD(){return gill.combineCodec(Pr(),Rr())}function Tt(){return gill.getStructEncoder([["memberKey",$()],["messageHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function lt(){return gill.getStructDecoder([["memberKey",Q()],["messageHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function KD(){return gill.combineCodec(Tt(),lt())}function Wr(){return gill.getStructEncoder([["settingsMutArgs",de()],["transactionManager",gill.getOptionEncoder(fe())]])}function Lr(){return gill.getStructDecoder([["settingsMutArgs",ue()],["transactionManager",gill.getOptionDecoder(Se())]])}function YD(){return gill.combineCodec(Wr(),Lr())}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 QD(){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 rM(){return gill.combineCodec($(),Q())}function wr(){return gill.getStructEncoder([["authorityCreationArgs",ye()],["compressedProofArgs",M()]])}function kr(){return gill.getStructDecoder([["authorityCreationArgs",pe()],["compressedProofArgs",E()]])}function cM(){return gill.combineCodec(wr(),kr())}function ft(){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 dM(){return gill.combineCodec(ft(),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 gM(){return gill.combineCodec(ot(),ct())}function ve(){return gill.getStructEncoder([["mask",gill.getU8Encoder()]])}function be(){return gill.getStructDecoder([["mask",gill.getU8Decoder()]])}function mM(){return gill.combineCodec(ve(),be())}function M(){return gill.getStructEncoder([["proof",gill.getOptionEncoder(Dr())],["lightCpiAccountsStartIndex",gill.getU8Encoder()]])}function E(){return gill.getStructDecoder([["proof",gill.getOptionDecoder(Mr())],["lightCpiAccountsStartIndex",gill.getU8Decoder()]])}function SM(){return gill.combineCodec(M(),E())}function vr(){return gill.getStructEncoder([["memberKey",$()],["userArgs",_e()]])}function br(){return gill.getStructDecoder([["memberKey",Q()],["userArgs",Ue()]])}function DM(){return gill.combineCodec(vr(),br())}function Nr(){return gill.getTupleEncoder([gill.fixEncoderSize(gill.getBytesEncoder(),33)])}function xt(){return gill.getTupleDecoder([gill.fixDecoderSize(gill.getBytesDecoder(),33)])}function hM(){return gill.combineCodec(Nr(),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 vM(){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 WM(){return gill.combineCodec(ee(),te())}function It(){return gill.getStructEncoder([["addressTreeInfo",ft()],["outputStateTreeIndex",gill.getU8Encoder()]])}function Ct(){return gill.getStructDecoder([["addressTreeInfo",St()],["outputStateTreeIndex",gill.getU8Decoder()]])}function wM(){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 HM(){return gill.combineCodec(Dt(),Mt())}function de(){return gill.getStructEncoder([["accountMeta",nt()],["data",dt()]])}function ue(){return gill.getStructDecoder([["accountMeta",st()],["data",z()]])}function zM(){return gill.combineCodec(de(),ue())}function se(){return gill.getStructEncoder([["accountMeta",at()],["data",dt()]])}function oe(){return gill.getStructDecoder([["accountMeta",it()],["data",z()]])}function qM(){return gill.combineCodec(se(),oe())}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(lt()))]])}function $M(){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(lr())],["addressTableLookups",gill.getArrayEncoder(Hr())]])}function Rt(){return gill.getStructDecoder([["numSigners",gill.getU8Decoder()],["numWritableSigners",gill.getU8Decoder()],["numWritableNonSigners",gill.getU8Decoder()],["numAccountKeys",gill.getU8Decoder()],["instructions",gill.getArrayDecoder(fr())],["addressTableLookups",gill.getArrayDecoder(Vr())]])}function rE(){return gill.combineCodec(Pt(),Rt())}function Hr(){return gill.getStructEncoder([["lookupTableAddressIndex",gill.getU8Encoder()],["writableIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["readonlyIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function Vr(){return gill.getStructDecoder([["lookupTableAddressIndex",gill.getU8Decoder()],["writableIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["readonlyIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function oE(){return gill.combineCodec(Hr(),Vr())}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 dE(){return gill.combineCodec(Oe(),J())}function ye(){return gill.getStructEncoder([["addressTreeInfo",ft()],["outputStateTreeIndex",gill.getU8Encoder()]])}function pe(){return gill.getStructDecoder([["addressTreeInfo",St()],["outputStateTreeIndex",gill.getU8Decoder()]])}function yE(){return gill.combineCodec(ye(),pe())}function fe(){return gill.getStructEncoder([["accountMeta",nt()],["data",Oe()]])}function Se(){return gill.getStructDecoder([["accountMeta",st()],["data",J()]])}function lE(){return gill.combineCodec(fe(),Se())}function zr(){return gill.getStructEncoder([["accountMeta",at()],["data",Oe()]])}function Kr(){return gill.getStructDecoder([["accountMeta",it()],["data",J()]])}function IE(){return gill.combineCodec(zr(),Kr())}function _e(){return gill.getDiscriminatedUnionEncoder([["Read",gill.getStructEncoder([["fields",gill.getTupleEncoder([zr()])]])],["Mutate",gill.getStructEncoder([["fields",gill.getTupleEncoder([fe()])]])]])}function Ue(){return gill.getDiscriminatedUnionDecoder([["Read",gill.getStructDecoder([["fields",gill.getTupleDecoder([Kr()])]])],["Mutate",gill.getStructDecoder([["fields",gill.getTupleDecoder([Se()])]])]])}function EE(){return gill.combineCodec(_e(),Ue())}function hE(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function PE(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 bE(){return gill.combineCodec(We(),Le())}var vs=new Uint8Array([223,179,163,190,177,224,67,173]);function lh(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(vs)}function My(){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 fh(){return gill.combineCodec(My(),bs())}function _s(e){return gill.decodeAccount(e,bs())}async function Sh(e,n,r){let s=await qr(e,n,r);return gill.assertAccountExists(s),s}async function qr(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return _s(s)}async function xh(e,n,r){let s=await Ey(e,n,r);return gill.assertAccountsExist(s),s}async function Ey(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>_s(t))}function Ih(){return 184}var Bs=new Uint8Array([90,36,35,219,93,225,110,96]);function Eh(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Bs)}function Ky(){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(lt()))],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function hh(){return gill.combineCodec(Ky(),ws())}function ks(e){return gill.decodeAccount(e,ws())}async function Ns(e,n,r){let s=await Jy(e,n,r);return gill.assertAccountExists(s),s}async function Jy(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return ks(s)}async function Ph(e,n,r){let s=await jy(e,n,r);return gill.assertAccountsExist(s),s}async function jy(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 bh(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Gs)}function Ap(){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 _h(){return gill.combineCodec(Ap(),Fs())}function zs(e){return gill.decodeAccount(e,Fs())}async function Ks(e,n,r){let s=await gp(e,n,r);return gill.assertAccountExists(s),s}async function gp(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return zs(s)}async function Uh(e,n,r){let s=await yp(e,n,r);return gill.assertAccountsExist(s),s}async function yp(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 Yh(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ys)}function rn(){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 Zh(){return gill.combineCodec(rn(),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:rn().encode(c),programAddress:r})}function Xh(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:rn().encode(c),programAddress:r})}function $h(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 oP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(to)}function nn(){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 cP(){return gill.combineCodec(nn(),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:nn().encode(c),programAddress:r})}function aP(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:nn().encode(c),programAddress:r})}function iP(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 mP(){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 TP(){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 lP(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 MP(){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 EP(){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 hP(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 WP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Mo)}function on(){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",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",pe()],["compressedProofArgs",E()]])}function LP(){return gill.combineCodec(on(),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:on().encode(c),programAddress:r})}function OP(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:on().encode(c),programAddress:r})}function BP(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 FP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ro)}function an(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",M()],["member",Nr()],["role",We()],["userAccountCreationArgs",ye()],["linkWalletArgs",gill.getOptionEncoder(Wr())]]),e=>({...e,discriminator:Ro}))}function vo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",E()],["member",xt()],["role",Le()],["userAccountCreationArgs",pe()],["linkWalletArgs",gill.getOptionDecoder(Lr())]])}function zP(){return gill.combineCodec(an(),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:an().encode(c),programAddress:r})}function KP(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:an().encode(c),programAddress:r})}function JP(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 $P(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Uo)}function un(){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 QP(){return gill.combineCodec(un(),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:un().encode({}),programAddress:r})}function eR(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:un().encode({}),programAddress:r})}function tR(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 iR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(wo)}function An(){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 dR(){return gill.combineCodec(An(),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:An().encode(c),programAddress:r})}function uR(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:An().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:ko().decode(e.data)}}var Vo=new Uint8Array([5]);function fR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Vo)}function yn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",M()],["createUserArgs",gill.getArrayEncoder(_r())]]),e=>({...e,discriminator:Vo}))}function Go(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",E()],["createUserArgs",gill.getArrayDecoder(Ur())]])}function SR(){return gill.combineCodec(yn(),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:yn().encode(c),programAddress:r})}function xR(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:yn().encode(c),programAddress:r})}function IR(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 RR(){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 vR(){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 bR(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 BR(){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 wR(){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 kR(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 KR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(oc)}function mn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["newOrigins",gill.getOptionEncoder(gill.getArrayEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())))],["newAuthorityArgs",gill.getOptionEncoder(wr())]]),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(kr())]])}function JR(){return gill.combineCodec(mn(),cc())}async function jR(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:mn().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:mn().encode(c),programAddress:r})}function qR(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 tv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(uc)}function Ac(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",fe()],["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",Se()],["transactionManagerUrl",gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())],["compressedProofArgs",E()]])}function rv(){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 nv(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 uv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Tc)}function lc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",fe()],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["delegateTo",gill.getOptionEncoder(Dt())],["oldSettingsMutArgs",gill.getOptionEncoder(de())],["newSettingsMutArgs",gill.getOptionEncoder(de())],["compressedProofArgs",M()]]),e=>({...e,discriminator:Tc}))}function fc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",Se()],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["delegateTo",gill.getOptionDecoder(Mt())],["oldSettingsMutArgs",gill.getOptionDecoder(ue())],["newSettingsMutArgs",gill.getOptionDecoder(ue())],["compressedProofArgs",E()]])}function Av(){return gill.combineCodec(lc(),fc())}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:lc().encode(c),programAddress:r})}function gv(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:fc().decode(e.data)}}var Cc=new Uint8Array([33]);function Sv(){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 xv(){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 Iv(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 Rv(){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",ye()]]),e=>({...e,discriminator:Rc}))}function bc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",J()],["compressedProofArgs",E()],["userCreationArgs",pe()]])}function vv(){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 bv(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 wv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Wc)}function Tn(){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 kv(){return gill.combineCodec(Tn(),Lc())}async function Nv(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},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:Tn().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:Tn().encode(c),programAddress:r})}function Hv(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 jv(){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",se()],["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",oe()],["compressedProofArgs",E()]])}function qv(){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 Yv(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 rb(){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 nb(){return gill.combineCodec(fn(),zc())}async function sb(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 ob(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 gb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Yc)}function Sn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["createAtaIfNeeded",gill.getBooleanEncoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(ee())],["settingsReadonlyArgs",se()],["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",oe()],["compressedProofArgs",E()]])}function yb(){return gill.combineCodec(Sn(),Zc())}async function pb(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:Sn().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:Sn().encode(c),programAddress:r})}function mb(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 Cb(){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 Db(){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 Mb(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{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 _b(){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",se()],["compressedProofArgs",M()]]),e=>({...e,discriminator:ca}))}function ia(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["settingsReadonlyArgs",oe()],["compressedProofArgs",E()]])}function Ub(){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 Wb(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:ia().decode(e.data)}}var ga=new Uint8Array([10]);function Hb(){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 Vb(){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 Gb(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 fa=new Uint8Array([21]);function Yb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(fa)}function Sa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Et()],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["settingsReadonlyArgs",se()],["compressedProofArgs",M()]]),e=>({...e,discriminator:fa}))}function xa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",ht()],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["settingsReadonlyArgs",oe()],["compressedProofArgs",E()]])}function Zb(){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 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:{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 s_(){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 o_(){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 c_(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 y_(){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",se()],["compressedProofArgs",M()]]),e=>({...e,discriminator:ba}))}function Ua(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["settingsReadonlyArgs",oe()],["compressedProofArgs",E()]])}function p_(){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 m_(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 I_(){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 C_(){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 D_(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 v_(){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 b_(){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 __(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 k_(){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 N_(){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 H_(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 j_(){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",se()],["compressedProofArgs",M()]]),e=>({...e,discriminator:ei}))}function ri(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["settingsReadonlyArgs",oe()],["compressedProofArgs",E()]])}function q_(){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 Y_(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 tU(){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 rU(){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 nU(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 dU(){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 uU(){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 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:pi().decode(e.data)}}var fi=new Uint8Array([16]);function fU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(fi)}function Si(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",Pt()],["secp256r1VerifyArgs",gill.getArrayEncoder(ee())]]),e=>({...e,discriminator:fi}))}function xi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",Rt()],["secp256r1VerifyArgs",gill.getArrayDecoder(te())]])}function SU(){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 xU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:xi().decode(e.data)}}var Mi=new Uint8Array([27]);function PU(){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",se()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Mi}))}function hi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",Rt()],["secp256r1VerifyArgs",gill.getArrayDecoder(te())],["settingsReadonlyArgs",oe()],["compressedProofArgs",E()]])}function RU(){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 vU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:hi().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",YS=(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))(YS||{});function pW(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 ZS=(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))(ZS||{});function mW(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 $S=6e3,QS=6001,ex=6002,tx=6003,rx=6004,nx=6005,sx=6006,ox=6007,cx=6008,ax=6009,ix=6010,dx=6011,ux=6012,Ax=6013,gx=6014,yx=6015,px=6016,mx=6017,Tx=6018,lx=6019,fx=6020,Sx=6021,xx=6022,Ix=6023,Cx=6024,Dx=6025,Mx=6026,Ex=6027,hx=6028,Px=6029,Rx=6030,vx=6031,bx=6032,_x=6033,Ux=6034,Wx=6035,Lx=6036,Ox=6037,Bx=6038,wx=6039,kx=6040,Nx=6041,Hx=6042,Vx=6043,Gx=6044,Fx=6045,zx=6046,Kx=6047,Jx=6048,jx=6049,qx=6050,Yx=6051,Zx=6052,Xx=6053,Ri;process.env.NODE_ENV!=="production"&&(Ri={[Rx]:"This member is already delegated to another wallet.",[ox]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[jx]:"The domain configuration account is disabled. Please contact support or try again later.",[qx]:"Missing domain configuration account.",[ix]:"Duplicate public keys detected among members. Each member must have a unique key.",[ax]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[fx]:"No members provided. A multisig wallet must contain at least one member.",[Tx]:"Expected a User with Administrator role for this instruction.",[cx]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[px]:"Expected a User with Transaction Manager role for this instruction.",[wx]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[kx]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[Nx]:"Declared buffer size does not match the actual serialized size.",[_x]:"Not enough members with vote permission to meet the approval threshold.",[vx]:"At least one signer with execute permission is required to proceed.",[bx]:"At least one signer with initiate permission is required to perform this action.",[Dx]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[Xx]:"Address Tree supplied is not part of the whitelisted address trees",[lx]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[Ex]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[Bx]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[Ux]:"Only delegated members are allowed for this transaction.",[Cx]:"Unexpected number of accounts provided for this instruction.",[Ax]:"User with Permanent Member role requires a must have a delegated wallet.",[QS]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[rx]:"The extracted public key has an invalid length or encoding.",[$S]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[tx]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[Kx]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[xx]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[mx]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[yx]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[Ix]:"Malformed transaction message: structure or formatting does not match the expected layout.",[Mx]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[nx]:"The extracted WebAuthn signed message payload is malformed.",[Fx]:"An input string exceeds the maximum allowed character length.",[Yx]:"This member is not registered under the provided domain configuration.",[hx]:"A required account is missing from the instruction context.",[zx]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[Px]:"User mutation arguments are required when performing add or remove delegate operations.",[Lx]:"No valid signer found in this transaction.",[ux]:"Only one permanent member is allowed per wallet.",[gx]:"Only one transaction manager is allowed per wallet.",[Zx]:"The given origin index is not in the whitelisted origins.",[dx]:"Permanent members cannot be removed from a wallet.",[Gx]:"Writable CPI calls to protected accounts are not permitted.",[sx]:"The rpIdHash extracted from the signed message does not match the expected value.",[ex]:"The signature index provided is out of bounds for the secp256r1 instruction.",[Jx]:"The specified slot number was not found in the provided slot history.",[Sx]:"Too many members: a maximum of 4 members are supported.",[Hx]:"This transaction has expired. It must be executed within 3 minutes of approval.",[Vx]:"This transaction has not yet reached the required approval threshold.",[Ox]:"Only the transaction creator or rent payer may close this transaction buffer.",[Wx]:"Member is not part of the expected signers for this transaction."});function IW(e){return process.env.NODE_ENV!=="production"?Ri[e]:"Error message not available in production bundles."}function CW(e,n,r){return gill.isProgramError(e,n,A,r)}var Wt={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 Cn=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!==Cn)throw new Error(`Invalid public key length, expected ${Cn} 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===Cn)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 eI(){return gill.getStructCodec([["programAddressIndex",gill.getU8Codec()],["accountIndices",gill.getArrayCodec(gill.getU8Codec())],["data",gill.getArrayCodec(gill.getU8Codec())]])}function tI(){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(eI())],["addressTableLookups",gill.getArrayCodec(tI())]]);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";function ki(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 iL(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 dL(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 uL(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=new Uint8Array(he(n)),c=JSON.parse(new TextDecoder().decode(he(r))),i=Hi(c),a=Gi(new Uint8Array(he(s))),o=await Je({rpIdHash:t.subarray(0,32)});return new C(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(he(r)),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(gill.getBase58Encoder().encode(e.slotHash))},clientAndDeviceHash:Mn(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 AL(e,n){let{data:r}=await Fn(re(),e),t=Vi(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.getUtf8Encoder().encode(e),...gill.getBase58Encoder().encode(n),...new TextEncoder().encode(r)]))}function gL(e){return sha2_js.sha256(new Uint8Array(gill.getUtf8Encoder().encode(JSON.stringify(e))))}function yL(e){return En(e.data.payload.authResponse)}function pL(e,n,r,s){return sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e),...Mn(n,r,s)]))}async function mL(e,n,r,s){let t=(await re().getAccountInfo(gill.address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed"}).send()).value?.data;if(!t)throw new Error("Unable to fetch slot sysvar");let c=gill.getBase64Encoder().encode(t[0]),i=gill.getU64Decoder().decode(c.subarray(8,16)).toString(),a=c.subarray(16,48),o=gill.getBase58Decoder().decode(a),d=sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e.transactionActionType),...gill.getBase58Encoder().encode(e.transactionAddress),...sha2_js.sha256(typeof e.transactionMessageBytes=="string"?new Uint8Array(he(e.transactionMessageBytes)):e.transactionMessageBytes),...a,...Mn(n,r,s)]));return {slotNumber:i,slotHash:o,challenge:d}}function En(e){return sha2_js.sha256(or(e))}function Ni(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function he(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}var je=null,zi=2e3,Ki=3e3,uI=300*1e3;async function cr({authUrl:e,payload:n,signature:r,popUp:s=null}){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(()=>{s&&s.closed&&(u(),c(new Error("User closed the authentication window")));},500),d=setTimeout(()=>{u(),c(new Error("Authentication timed out"));},uI);function u(){clearInterval(o),clearTimeout(d),a&&clearTimeout(a),je&&window.removeEventListener("message",je),s&&s.close();}if(s?s.location.replace(e):s=ki(e),!s){c(new Error("Disable your popup blocker to continue."));return}let g=y=>{let T=y.origin===i,f=y.source===s;if(!(!T||!f||!y.isTrusted||!s))switch(y.data.type){case "popup-ready":s.postMessage({type:"popup-init",payload:n,signature:r},i),a=setTimeout(()=>{u(),c(new Error("User closed the authentication window"));},zi+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"));},zi+Ki));break;case "popup-closed":u(),c(new Error("User closed the authentication window"));break}};je&&window.removeEventListener("message",je),je=g,window.addEventListener("message",je);})}function rr(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 Hi(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 Vi(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 Gi(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)),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 or(e){return new Uint8Array([...new Uint8Array(he(e.response.authenticatorData)),...sha2_js.sha256(new Uint8Array(he(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 re().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 qi(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 Yi(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?or(r.authResponse):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:i,publicKey:a}}function qe(e){if(e instanceof Me)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 Ae(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 Zi({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 Xi(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 Ne(){if(!_.lightProtocolRpc)throw new Error("Rpc is not initialized yet");return _.lightProtocolRpc}function re(){if(!_.solanaRpc)throw new Error("Rpc is not initialized yet");return _.solanaRpc}function $i(){if(!_.sendAndConfirm)throw new Error("Rpc is not initialized yet.");return _.sendAndConfirm}function Qi(){if(!_.computeEstimate)throw new Error("Rpc is not initialized yet");return _.computeEstimate}async function WL(){return _.feePayer||(_.feePayer=await Xi(_.apiEndpoint??Oi)),_.feePayer}function Rn(){if(!_.jitoTipsConfig)throw new Error("Jito Bundle Config is not set.");return _.jitoTipsConfig}function Ke(){return _.authEndpoint??Li}function LL(){return _.rpId??Wi}function Ze(){if(!_.onClientAuthorizationCallback)throw new Error("No client authorization callback found.");return _.onClientAuthorizationCallback}function OL(){Object.keys(_).forEach(e=>{_[e]=void 0;});}function BL({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s,apiEndpoint:t,authEndpoint:c,rpId:i,onClientAuthorizationCallback: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=Ye().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 ar(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=>ar(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 ir()).length-1}var vn;async function ir(){if(!vn){let{data:e}=await Ks(re(),await nd());vn=e.whitelistedAddressTrees;}return vn}async function dr(e,n,r){let s=await YI(e,n,r);if(!s)throw new Error("User cannot be found.");return s}async function YI(e,n,r){let{address:s}=await N(e,n),t=await ar(s,r);return t?.data?.data?J().decode(t.data.data):null}async function Ot(e,n,r){let s=await ZI(e,n,r);if(!s)throw new Error("Settings cannot be found.");return s}async function ZI(e,n,r){try{let{address:s}=await j(e,n),t=await ar(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 qr(re(),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 ir();if(e<0||e>=n.length)throw new Error(`Invalid address tree index: ${e}`);return n[e]}async function iO(e){let r=(await ir()).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(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=Ye().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 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 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 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 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 pd(e){let n=await Z(e);return await Ie(n)}async function lO(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("cpi_authority")]});return e}async function bO(e){let n=await Pn(e,true),r=await Yi(n.map(gill.getBase64EncodedWireTransaction),Ye()),s=await Pn(e.map((c,i)=>({...c,unitsConsumed:r[i]})));return await yC(s.map(gill.getBase64EncodedWireTransaction))}async function _O({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await re().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([Qi()(c),qi(re(),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 $i()(t,{commitment:"confirmed",skipPreflight:true}),gill.getSignatureFromTransaction(t)}async function yC(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 UO(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 WO(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=>Td(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(Td(d.pubkey)),userAddressTreeIndex:d.userAddressTreeIndex}}async function LO({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await dr(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new Error("Transaction manager endpoint is missing for this account.");return pC(n,c.transactionManagerUrl.value,e,s)}function pC(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 Td(e){return e.keyType===Wt.Ed25519?gill.getBase58Decoder().decode(e.key.subarray(1,33)):gill.getBase58Decoder().decode(e.key)}async function QO({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,payer:s,compressed:t=false,cachedAccounts:c}){let i=await SC(r),a=new U,o=null,d=null,u=[];if(i.length||t){let h=await xC({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 IC({configActionsArgs:r,packedAccounts:a,userMutArgs:u,index:e}),{remainingAccounts:T,systemOffset:f}=a.toAccountMetas(),D=b(o,f);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 SC(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 xC({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 IC({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(D=>s.find(x=>new Un__default.default(new Uint8Array(x.accountMeta.address)).eq(D.address)));if(!f)throw new Error("Unable to find user account");a.push(ld({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 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 DC({pubkey:o.member,userMutArgs:u,index:e})})));c.push({__kind:i.type,fields:[a]});break}case "EditPermissions":{let a=i.members.map(o=>CC({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 CC({pubkey:e,permissionArgs:n}){return {memberKey:qe(e),permissions:fd(n)}}function DC({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:fd(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 fd(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 $e=33,Qe=64,Bn=14,bC=2,_C=gill.address("Secp256r1SigVerify1111111111111111111111111");function UC(){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 WC(){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 Cd(){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=WC();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 Dd(){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=UC();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 rB(){return gill.combineCodec(Dd(),Cd())}function F(e,n){let r=e.length,s=bC+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??_C,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:Dd().encode(i)}}function nB(e){return {programAddress:e.programAddress,accounts:{},data:Cd().decode(e.data)}}async function yB({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: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:f,remainingAccounts:D})),I}async function TB({admin:e,addressTree:n}){return Xs({payer:e,addressTree:n,remainingAccounts:[]})}async function DB({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 ho({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:f,payer:e,domainConfig:t,rpId:n,remainingAccounts:y})}async function WB({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,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&&(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 bo({payer:n,authority:e,compressedProofArgs:L,member:xt().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 wB({payer:e}){let n=await gd();return Lo({payer:e,globalCounter:n})}async function zB({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 qB({admin:e,rpId:n,disable:r}){let s=await Je({rpId:n});return tc({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function tw({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 aw({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 lw({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 dr(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,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"}),f={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=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),ne=[];return u.length>0&&ne.push(F(u)),ne.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})),ne}async function Mw({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 _w({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 Qw({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:D,addressTree:x}=await j(e,f);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(ne=>ne.type==="User"),J())[0],W=(await ae(g,I.treeInfos.slice(h),I.roots.slice(h),I.rootIndices.slice(h),y)).find(ne=>ne.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 dk({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(),D=b(a,f),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 kC(e,n,r,s){let t=NC(e,n),c=HC(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 NC(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 HC(e,n){return n<e.header.numSignerAccounts}async function Ar({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),re()):{}),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:kC(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 vd({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?mi({transactionBuffer:n,payer:s.address,remainingAccounts:u,settingsKey:e}):di({transactionBuffer:n,payer:s.address,settings:e})),a&&y.push(Zi({payer:s,tipAmount:a})),{instructions:y,addressLookupTableAccounts:g}}async function bd({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:D},{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 ne=i.length,{domainConfig:me,verifyArgs:Pe,signature:Ce,publicKey:Re,message:Bt}=G(O,ne);Bt&&Ce&&Re&&i.push({message:Bt,signature:Ce,publicKey:Re}),me&&(I.addPreAccounts([{address:me,role:gill.AccountRole.READONLY}]),Pe?.__option==="Some"&&L.push({domainConfigKey:me,verifyArgs:Pe.value}));}let{remainingAccounts:W,systemOffset:q}=I.toAccountMetas(),H=[];i.length>0&&H.push(F(i));let V=GC(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:f}}function GC(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 wk({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=[],D=[];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"&&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(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(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=Ae(t),y=await Z(e),T=await Ie(y),[f,D]=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:ne,verifyArgs:me,signature:Pe,publicKey:Ce,message:Re}=G(V,O);Re&&Pe&&Ce&&S.push({message:Re,signature:Pe,publicKey:Ce}),ne&&(I.addPreAccounts([{address:ne,role:gill.AccountRole.READONLY}]),me?.__option==="Some"&&L.push({domainConfigKey:ne,verifyArgs:me.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:f,destination:r,destinationTokenAccount:D,mint:s,tokenProgram:o,remainingAccounts:W}));}else H.push(Kc({amount:i,createAtaIfNeeded:d,secp256r1VerifyArgs:L,source:T,sourceTokenAccount:f,destination:r,destinationTokenAccount:D,settings:y,mint:s,tokenProgram:o,remainingAccounts:W}));return H}async function sN({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:i}){let a=await Ns(re(),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: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:f,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:f,closer:r instanceof C?void 0:r,settings:o,payer:a.data.payer,secp256r1VerifyArgs:D,remainingAccounts:[]}));return S}function Ld({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:D}=G(n),x=[];if(T&&f&&D&&x.push(F([{message:T,signature:f,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 Od({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 Bd({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 wd({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({id:e,message:n,signer:r,popUp:s}){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");let t=window.origin,c={phase:"start",data:{id:e,type:"message",payload:n},redirectOrigin:t,signer:r},i=await Ze()(c),a=await cr({authUrl:`${Ke()}?redirectOrigin=${t}`,payload:c,signature:i,popUp:s});if(a.data.type!=="message")throw new Error("Expected Message Response");return {...a.data.payload,clientSignature:{...a.data.payload.clientSignature,signature:await Ze()(a)}}}async function YN({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={phase:"start",data:{type:"transaction",payload:{transactionActionType:e,transactionAddress:n,transactionMessageBytes:Ni(r)}},redirectOrigin:c,signer:s},a=await Ze()(i),o=await cr({authUrl:`${Ke()}?redirectOrigin=${c}`,payload:i,signature:a,popUp:t});if(o.data.type!=="transaction")throw new Error("Expected Transaction Response");return {...o.data.payload,clientSignature:{...o.data.payload.clientSignature,signature:await Ze()(o)}}}async function c2({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),D=Math.floor(Math.random()*255),x=await yd(f,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 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,ne=Ae([t,...c?[c]:[],...u]).filter(X=>X instanceof C).map(X=>({memberKey:qe(X),messageHash:En(X.authResponse)})),me=Ld({finalBufferHash:S,finalBufferSize:s.length,bufferIndex:D,payer:e,transactionBufferAddress:x,settings:f,creator:t,preauthorizeExecution:!c,bufferExtendHashes:I,compressedArgs:O,expectedSecp256r1Signers:ne}),Pe=h.map(X=>Bd({transactionMessageBytes:X,transactionBufferAddress:x,settings:f,compressed:d})),Ce=u.map(X=>wd({voter:X,transactionBufferAddress:x,settings:f,compressedArgs:O})),Re=Od({compressedArgs:O,settings:f,executor:c,transactionBufferAddress:x}),{instructions:Bt,addressLookupTableAccounts:Hd}=await vd({compressed:d,settings:f,transactionMessageBytes:s,transactionBufferAddress:x,payer:e,additionalSigners:g,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:o}),et=X=>({payer:e,instructions:X,addressesByLookupTableAddress:Hd});return [et(me),...Pe.map(X=>et([X])),...Ce.length?[et(Ce.flat())]:[],et(Re),et(Bt)]}var yr=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 pr=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let s=new Map;this.keySegments().flat().forEach((c,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 Nd({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=yr.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:D}=T;c.push({readonlyIndexes:f.readonlyIndexes,readableIndices:f.readonlyIndexes,writableIndexes:f.writableIndexes,writableIndices:f.writableIndexes,lookupTableAddress:gill.address(f.lookupTableAddress)}),i.writable.push(...D.writable),i.readonly.push(...D.readonly);}}let[o,d]=t.getMessageComponents(),g=new pr(d,i).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function S2({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=Nd({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return _i(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 bd({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=Rx;exports.MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH=ox;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED=jx;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING=qx;exports.MULTI_WALLET_ERROR__DUPLICATE_MEMBER=ix;exports.MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED=ax;exports.MULTI_WALLET_ERROR__EMPTY_MEMBERS=fx;exports.MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH=Tx;exports.MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH=cx;exports.MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH=px;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH=wx;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED=kx;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH=Nx;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION=_x;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION=vx;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION=bx;exports.MULTI_WALLET_ERROR__INVALID_ACCOUNT=Dx;exports.MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE=Xx;exports.MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG=lx;exports.MULTI_WALLET_ERROR__INVALID_ARGUMENTS=Ex;exports.MULTI_WALLET_ERROR__INVALID_BUFFER=Bx;exports.MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS=Ux;exports.MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS=Cx;exports.MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG=Ax;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION=QS;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY=rx;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG=$S;exports.MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS=tx;exports.MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT=Kx;exports.MULTI_WALLET_ERROR__INVALID_THRESHOLD=xx;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG=mx;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION=yx;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE=Ix;exports.MULTI_WALLET_ERROR__INVALID_USER_ROLE=Mx;exports.MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE=nx;exports.MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED=Fx;exports.MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG=Yx;exports.MULTI_WALLET_ERROR__MISSING_ACCOUNT=hx;exports.MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY=zx;exports.MULTI_WALLET_ERROR__MISSING_USER_ARGS=Px;exports.MULTI_WALLET_ERROR__NO_SIGNER_FOUND=Lx;exports.MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED=ux;exports.MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED=gx;exports.MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS=Zx;exports.MULTI_WALLET_ERROR__PERMANENT_MEMBER=dx;exports.MULTI_WALLET_ERROR__PROTECTED_ACCOUNT=Gx;exports.MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH=sx;exports.MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS=ex;exports.MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND=Jx;exports.MULTI_WALLET_ERROR__TOO_MANY_MEMBERS=Sx;exports.MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED=Hx;exports.MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED=Vx;exports.MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER=Ox;exports.MULTI_WALLET_ERROR__UNEXPECTED_SIGNER=Wx;exports.MULTI_WALLET_PROGRAM_ADDRESS=A;exports.MultiWalletAccount=YS;exports.MultiWalletInstruction=ZS;exports.NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=kc;exports.NATIVE_TRANSFER_INTENT_DISCRIMINATOR=Wc;exports.Permission=xe;exports.Permissions=De;exports.SETTINGS_DISCRIMINATOR=vs;exports.Secp256r1Key=Me;exports.SignedSecp256r1Key=C;exports.TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=Yc;exports.TOKEN_TRANSFER_INTENT_DISCRIMINATOR=Fc;exports.TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR=ca;exports.TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR=ea;exports.TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR=fa;exports.TRANSACTION_BUFFER_CREATE_DISCRIMINATOR=ga;exports.TRANSACTION_BUFFER_DISCRIMINATOR=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=fi;exports.UserRole=Be;exports.WHITELISTED_ADDRESS_TREE_DISCRIMINATOR=Gs;exports.addWhitelistedAddressTrees=TB;exports.base64URLStringToBuffer=he;exports.bufferToBase64URLString=Ni;exports.changeConfig=QO;exports.closeTransactionBuffer=sN;exports.compressSettingsAccount=yB;exports.configAction=UD;exports.convertMemberKeyToString=Td;exports.convertPubkeyCompressedToCose=dL;exports.convertPubkeyCoseToCompressed=iL;exports.createClientAuthorizationCompleteRequestChallenge=yL;exports.createClientAuthorizationStartRequestChallenge=gL;exports.createDomainConfig=DB;exports.createDomainUserAccounts=WB;exports.createGlobalCounter=wB;exports.createMessageChallenge=pL;exports.createPopUp=ki;exports.createTransactionBuffer=Ld;exports.createTransactionChallenge=mL;exports.createTransactionManagerSigner=pC;exports.createUserAccounts=zB;exports.createWallet=Qw;exports.decodeDomainConfig=Gn;exports.decodeGlobalCounter=qn;exports.decodeSettings=_s;exports.decodeTransactionBuffer=ks;exports.decodeWhitelistedAddressTree=zs;exports.decompressSettingsAccount=dk;exports.disableDomainConfig=qB;exports.editDomainConfig=tw;exports.editTransactionManagerUrl=aw;exports.editUserDelegate=lw;exports.executeTransaction=vd;exports.executeTransactionBuffer=Od;exports.executeTransactionSync=bd;exports.extendTransactionBuffer=Bd;exports.fetchAllDomainConfig=jC;exports.fetchAllGlobalCounter=eD;exports.fetchAllMaybeDomainConfig=eu;exports.fetchAllMaybeGlobalCounter=Tu;exports.fetchAllMaybeSettings=Ey;exports.fetchAllMaybeTransactionBuffer=jy;exports.fetchAllMaybeWhitelistedAddressTree=yp;exports.fetchAllSettings=xh;exports.fetchAllTransactionBuffer=Ph;exports.fetchAllWhitelistedAddressTree=Uh;exports.fetchCompressedAccount=rd;exports.fetchDomainConfig=Fn;exports.fetchGlobalCounter=QC;exports.fetchMaybeDomainConfig=Qd;exports.fetchMaybeGlobalCounter=mu;exports.fetchMaybeSettings=qr;exports.fetchMaybeSettingsAccountData=ZI;exports.fetchMaybeTransactionBuffer=Jy;exports.fetchMaybeUserAccountData=YI;exports.fetchMaybeWhitelistedAddressTree=gp;exports.fetchSettings=Sh;exports.fetchSettingsAccountData=Ot;exports.fetchTransactionBuffer=Ns;exports.fetchUserAccountData=dr;exports.fetchWhitelistedAddressTree=Ks;exports.getAddMemberArgsCodec=oD;exports.getAddMemberArgsDecoder=Tr;exports.getAddMemberArgsEncoder=mr;exports.getAddWhitelistedAddressTreesDiscriminatorBytes=Yh;exports.getAddWhitelistedAddressTreesInstruction=Xh;exports.getAddWhitelistedAddressTreesInstructionAsync=Xs;exports.getAddWhitelistedAddressTreesInstructionDataCodec=Zh;exports.getAddWhitelistedAddressTreesInstructionDataDecoder=Zs;exports.getAddWhitelistedAddressTreesInstructionDataEncoder=rn;exports.getAuthEndpoint=Ke;exports.getChangeConfigCompressedDiscriminatorBytes=mP;exports.getChangeConfigCompressedInstruction=uo;exports.getChangeConfigCompressedInstructionDataCodec=TP;exports.getChangeConfigCompressedInstructionDataDecoder=io;exports.getChangeConfigCompressedInstructionDataEncoder=ao;exports.getChangeConfigDiscriminatorBytes=oP;exports.getChangeConfigInstruction=aP;exports.getChangeConfigInstructionAsync=no;exports.getChangeConfigInstructionDataCodec=cP;exports.getChangeConfigInstructionDataDecoder=ro;exports.getChangeConfigInstructionDataEncoder=nn;exports.getClientAndDeviceHash=Mn;exports.getCompiledInstructionCodec=iD;exports.getCompiledInstructionDecoder=fr;exports.getCompiledInstructionEncoder=lr;exports.getCompressSettingsAccountDiscriminatorBytes=MP;exports.getCompressSettingsAccountInstruction=To;exports.getCompressSettingsAccountInstructionDataCodec=EP;exports.getCompressSettingsAccountInstructionDataDecoder=mo;exports.getCompressSettingsAccountInstructionDataEncoder=po;exports.getCompressedAccountMetaCodec=gD;exports.getCompressedAccountMetaDecoder=st;exports.getCompressedAccountMetaEncoder=nt;exports.getCompressedAccountMetaReadOnlyCodec=TD;exports.getCompressedAccountMetaReadOnlyDecoder=it;exports.getCompressedAccountMetaReadOnlyEncoder=at;exports.getCompressedProofCodec=SD;exports.getCompressedProofDecoder=Mr;exports.getCompressedProofEncoder=Dr;exports.getCompressedSettingsAddressFromIndex=j;exports.getCompressedSettingsCodec=DD;exports.getCompressedSettingsDataCodec=PD;exports.getCompressedSettingsDataDecoder=At;exports.getCompressedSettingsDataEncoder=ut;exports.getCompressedSettingsDecoder=z;exports.getCompressedSettingsEncoder=dt;exports.getComputeBudgetEstimate=Qi;exports.getConfigActionCodec=_D;exports.getConfigActionDecoder=mt;exports.getConfigActionEncoder=pt;exports.getCreateDomainConfigDiscriminatorBytes=WP;exports.getCreateDomainConfigInstruction=OP;exports.getCreateDomainConfigInstructionAsync=ho;exports.getCreateDomainConfigInstructionDataCodec=LP;exports.getCreateDomainConfigInstructionDataDecoder=Eo;exports.getCreateDomainConfigInstructionDataEncoder=on;exports.getCreateDomainUserAccountDiscriminatorBytes=FP;exports.getCreateDomainUserAccountInstruction=KP;exports.getCreateDomainUserAccountInstructionAsync=bo;exports.getCreateDomainUserAccountInstructionDataCodec=zP;exports.getCreateDomainUserAccountInstructionDataDecoder=vo;exports.getCreateDomainUserAccountInstructionDataEncoder=an;exports.getCreateGlobalCounterDiscriminatorBytes=$P;exports.getCreateGlobalCounterInstruction=eR;exports.getCreateGlobalCounterInstructionAsync=Lo;exports.getCreateGlobalCounterInstructionDataCodec=QP;exports.getCreateGlobalCounterInstructionDataDecoder=Wo;exports.getCreateGlobalCounterInstructionDataEncoder=un;exports.getCreateMultiWalletCompressedDiscriminatorBytes=iR;exports.getCreateMultiWalletCompressedInstruction=uR;exports.getCreateMultiWalletCompressedInstructionAsync=No;exports.getCreateMultiWalletCompressedInstructionDataCodec=dR;exports.getCreateMultiWalletCompressedInstructionDataDecoder=ko;exports.getCreateMultiWalletCompressedInstructionDataEncoder=An;exports.getCreateUserAccountArgsCodec=wD;exports.getCreateUserAccountArgsDecoder=Ur;exports.getCreateUserAccountArgsEncoder=_r;exports.getCreateUserAccountsDiscriminatorBytes=fR;exports.getCreateUserAccountsInstruction=xR;exports.getCreateUserAccountsInstructionAsync=Fo;exports.getCreateUserAccountsInstructionDataCodec=SR;exports.getCreateUserAccountsInstructionDataDecoder=Go;exports.getCreateUserAccountsInstructionDataEncoder=yn;exports.getDecompressSettingsAccountDiscriminatorBytes=RR;exports.getDecompressSettingsAccountInstruction=Yo;exports.getDecompressSettingsAccountInstructionDataCodec=vR;exports.getDecompressSettingsAccountInstructionDataDecoder=qo;exports.getDecompressSettingsAccountInstructionDataEncoder=jo;exports.getDisableDomainConfigDiscriminatorBytes=BR;exports.getDisableDomainConfigInstruction=tc;exports.getDisableDomainConfigInstructionDataCodec=wR;exports.getDisableDomainConfigInstructionDataDecoder=ec;exports.getDisableDomainConfigInstructionDataEncoder=Qo;exports.getDomainConfigAddress=Je;exports.getDomainConfigCodec=JC;exports.getDomainConfigDecoder=Vn;exports.getDomainConfigDiscriminatorBytes=KC;exports.getDomainConfigEncoder=$d;exports.getDomainConfigSize=qC;exports.getEditDomainConfigDiscriminatorBytes=KR;exports.getEditDomainConfigInstruction=ac;exports.getEditDomainConfigInstructionAsync=jR;exports.getEditDomainConfigInstructionDataCodec=JR;exports.getEditDomainConfigInstructionDataDecoder=cc;exports.getEditDomainConfigInstructionDataEncoder=mn;exports.getEditMemberArgsCodec=VD;exports.getEditMemberArgsDecoder=Rr;exports.getEditMemberArgsEncoder=Pr;exports.getEditTransactionManagerUrlDiscriminatorBytes=tv;exports.getEditTransactionManagerUrlInstruction=yc;exports.getEditTransactionManagerUrlInstructionDataCodec=rv;exports.getEditTransactionManagerUrlInstructionDataDecoder=gc;exports.getEditTransactionManagerUrlInstructionDataEncoder=Ac;exports.getEditUserDelegateDiscriminatorBytes=uv;exports.getEditUserDelegateInstruction=Sc;exports.getEditUserDelegateInstructionDataCodec=Av;exports.getEditUserDelegateInstructionDataDecoder=fc;exports.getEditUserDelegateInstructionDataEncoder=lc;exports.getExpectedSecp256r1SignersCodec=KD;exports.getExpectedSecp256r1SignersDecoder=lt;exports.getExpectedSecp256r1SignersEncoder=Tt;exports.getFeePayer=WL;exports.getGlobalCounterAddress=gd;exports.getGlobalCounterCodec=$C;exports.getGlobalCounterDecoder=jn;exports.getGlobalCounterDiscriminatorBytes=XC;exports.getGlobalCounterEncoder=pu;exports.getGlobalCounterSize=tD;exports.getJitoTipsConfig=Rn;exports.getLightCpiSigner=lO;exports.getLightProtocolRpc=Ne;exports.getLinkWalletArgsCodec=YD;exports.getLinkWalletArgsDecoder=Lr;exports.getLinkWalletArgsEncoder=Wr;exports.getMemberCodec=QD;exports.getMemberDecoder=yt;exports.getMemberEncoder=gt;exports.getMemberKeyCodec=rM;exports.getMemberKeyDecoder=Q;exports.getMemberKeyEncoder=$;exports.getMigrateCompressedSettingsDiscriminatorBytes=Sv;exports.getMigrateCompressedSettingsInstruction=Ec;exports.getMigrateCompressedSettingsInstructionDataCodec=xv;exports.getMigrateCompressedSettingsInstructionDataDecoder=Mc;exports.getMigrateCompressedSettingsInstructionDataEncoder=Dc;exports.getMigrateCompressedUsersDiscriminatorBytes=Rv;exports.getMigrateCompressedUsersInstruction=_c;exports.getMigrateCompressedUsersInstructionDataCodec=vv;exports.getMigrateCompressedUsersInstructionDataDecoder=bc;exports.getMigrateCompressedUsersInstructionDataEncoder=vc;exports.getMultiWalletErrorMessage=IW;exports.getNativeTransferIntentCompressedDiscriminatorBytes=jv;exports.getNativeTransferIntentCompressedInstruction=Vc;exports.getNativeTransferIntentCompressedInstructionDataCodec=qv;exports.getNativeTransferIntentCompressedInstructionDataDecoder=Hc;exports.getNativeTransferIntentCompressedInstructionDataEncoder=Nc;exports.getNativeTransferIntentDiscriminatorBytes=wv;exports.getNativeTransferIntentInstruction=Oc;exports.getNativeTransferIntentInstructionAsync=Nv;exports.getNativeTransferIntentInstructionDataCodec=kv;exports.getNativeTransferIntentInstructionDataDecoder=Lc;exports.getNativeTransferIntentInstructionDataEncoder=Tn;exports.getNewAuthorityArgsCodec=cM;exports.getNewAuthorityArgsDecoder=kr;exports.getNewAuthorityArgsEncoder=wr;exports.getOnClientAuthorizationCallback=Ze;exports.getOriginIndex=AL;exports.getPackedAddressTreeInfoCodec=dM;exports.getPackedAddressTreeInfoDecoder=St;exports.getPackedAddressTreeInfoEncoder=ft;exports.getPackedStateTreeInfoCodec=gM;exports.getPackedStateTreeInfoDecoder=ct;exports.getPackedStateTreeInfoEncoder=ot;exports.getPermissionsCodec=mM;exports.getPermissionsDecoder=be;exports.getPermissionsEncoder=ve;exports.getProofArgsCodec=SM;exports.getProofArgsDecoder=E;exports.getProofArgsEncoder=M;exports.getRemoveMemberArgsCodec=DM;exports.getRemoveMemberArgsDecoder=br;exports.getRemoveMemberArgsEncoder=vr;exports.getRpId=LL;exports.getSecp256r1MessageHash=En;exports.getSecp256r1PubkeyCodec=hM;exports.getSecp256r1PubkeyDecoder=xt;exports.getSecp256r1PubkeyEncoder=Nr;exports.getSecp256r1SignatureOffsetsDataDecoder=WC;exports.getSecp256r1SignatureOffsetsDataEncoder=UC;exports.getSecp256r1VerifyArgsCodec=vM;exports.getSecp256r1VerifyArgsDecoder=w;exports.getSecp256r1VerifyArgsEncoder=B;exports.getSecp256r1VerifyArgsWithDomainAddressCodec=WM;exports.getSecp256r1VerifyArgsWithDomainAddressDecoder=te;exports.getSecp256r1VerifyArgsWithDomainAddressEncoder=ee;exports.getSecp256r1VerifyInstruction=F;exports.getSecp256r1VerifyInstructionDataCodec=rB;exports.getSecp256r1VerifyInstructionDataDecoder=Cd;exports.getSecp256r1VerifyInstructionDataEncoder=Dd;exports.getSendAndConfirmTransaction=$i;exports.getSettingsCodec=fh;exports.getSettingsCreationArgsCodec=wM;exports.getSettingsCreationArgsDecoder=Ct;exports.getSettingsCreationArgsEncoder=It;exports.getSettingsDecoder=bs;exports.getSettingsDiscriminatorBytes=lh;exports.getSettingsEncoder=My;exports.getSettingsFromIndex=Z;exports.getSettingsIndexWithAddressCodec=HM;exports.getSettingsIndexWithAddressDecoder=Mt;exports.getSettingsIndexWithAddressEncoder=Dt;exports.getSettingsMutArgsCodec=zM;exports.getSettingsMutArgsDecoder=ue;exports.getSettingsMutArgsEncoder=de;exports.getSettingsReadonlyArgsCodec=qM;exports.getSettingsReadonlyArgsDecoder=oe;exports.getSettingsReadonlyArgsEncoder=se;exports.getSettingsSize=Ih;exports.getSignedSecp256r1Key=uL;exports.getSignedTransactionManager=LO;exports.getSolanaRpc=re;exports.getSolanaRpcEndpoint=Ye;exports.getTokenTransferIntentCompressedDiscriminatorBytes=gb;exports.getTokenTransferIntentCompressedInstruction=Xc;exports.getTokenTransferIntentCompressedInstructionAsync=pb;exports.getTokenTransferIntentCompressedInstructionDataCodec=yb;exports.getTokenTransferIntentCompressedInstructionDataDecoder=Zc;exports.getTokenTransferIntentCompressedInstructionDataEncoder=Sn;exports.getTokenTransferIntentDiscriminatorBytes=rb;exports.getTokenTransferIntentInstruction=Kc;exports.getTokenTransferIntentInstructionAsync=sb;exports.getTokenTransferIntentInstructionDataCodec=nb;exports.getTokenTransferIntentInstructionDataDecoder=zc;exports.getTokenTransferIntentInstructionDataEncoder=fn;exports.getTransactionBufferAddress=yd;exports.getTransactionBufferCloseCompressedDiscriminatorBytes=_b;exports.getTransactionBufferCloseCompressedInstruction=da;exports.getTransactionBufferCloseCompressedInstructionDataCodec=Ub;exports.getTransactionBufferCloseCompressedInstructionDataDecoder=ia;exports.getTransactionBufferCloseCompressedInstructionDataEncoder=aa;exports.getTransactionBufferCloseDiscriminatorBytes=Cb;exports.getTransactionBufferCloseInstruction=na;exports.getTransactionBufferCloseInstructionDataCodec=Db;exports.getTransactionBufferCloseInstructionDataDecoder=ra;exports.getTransactionBufferCloseInstructionDataEncoder=ta;exports.getTransactionBufferCodec=hh;exports.getTransactionBufferCreateArgsCodec=$M;exports.getTransactionBufferCreateArgsDecoder=ht;exports.getTransactionBufferCreateArgsEncoder=Et;exports.getTransactionBufferCreateCompressedDiscriminatorBytes=Yb;exports.getTransactionBufferCreateCompressedInstruction=Ia;exports.getTransactionBufferCreateCompressedInstructionDataCodec=Zb;exports.getTransactionBufferCreateCompressedInstructionDataDecoder=xa;exports.getTransactionBufferCreateCompressedInstructionDataEncoder=Sa;exports.getTransactionBufferCreateDiscriminatorBytes=Hb;exports.getTransactionBufferCreateInstruction=ma;exports.getTransactionBufferCreateInstructionDataCodec=Vb;exports.getTransactionBufferCreateInstructionDataDecoder=pa;exports.getTransactionBufferCreateInstructionDataEncoder=ya;exports.getTransactionBufferDecoder=ws;exports.getTransactionBufferDiscriminatorBytes=Eh;exports.getTransactionBufferEncoder=Ky;exports.getTransactionBufferExecuteCompressedDiscriminatorBytes=y_;exports.getTransactionBufferExecuteCompressedInstruction=Wa;exports.getTransactionBufferExecuteCompressedInstructionDataCodec=p_;exports.getTransactionBufferExecuteCompressedInstructionDataDecoder=Ua;exports.getTransactionBufferExecuteCompressedInstructionDataEncoder=_a;exports.getTransactionBufferExecuteDiscriminatorBytes=s_;exports.getTransactionBufferExecuteInstruction=Pa;exports.getTransactionBufferExecuteInstructionDataCodec=o_;exports.getTransactionBufferExecuteInstructionDataDecoder=ha;exports.getTransactionBufferExecuteInstructionDataEncoder=Ea;exports.getTransactionBufferExtendCompressedDiscriminatorBytes=v_;exports.getTransactionBufferExtendCompressedInstruction=Ka;exports.getTransactionBufferExtendCompressedInstructionDataCodec=b_;exports.getTransactionBufferExtendCompressedInstructionDataDecoder=za;exports.getTransactionBufferExtendCompressedInstructionDataEncoder=Fa;exports.getTransactionBufferExtendDiscriminatorBytes=I_;exports.getTransactionBufferExtendInstruction=Na;exports.getTransactionBufferExtendInstructionDataCodec=C_;exports.getTransactionBufferExtendInstructionDataDecoder=ka;exports.getTransactionBufferExtendInstructionDataEncoder=wa;exports.getTransactionBufferVoteCompressedDiscriminatorBytes=j_;exports.getTransactionBufferVoteCompressedInstruction=ni;exports.getTransactionBufferVoteCompressedInstructionDataCodec=q_;exports.getTransactionBufferVoteCompressedInstructionDataDecoder=ri;exports.getTransactionBufferVoteCompressedInstructionDataEncoder=ti;exports.getTransactionBufferVoteDiscriminatorBytes=k_;exports.getTransactionBufferVoteInstruction=Xa;exports.getTransactionBufferVoteInstructionDataCodec=N_;exports.getTransactionBufferVoteInstructionDataDecoder=Za;exports.getTransactionBufferVoteInstructionDataEncoder=Ya;exports.getTransactionExecuteCompressedDiscriminatorBytes=dU;exports.getTransactionExecuteCompressedInstruction=mi;exports.getTransactionExecuteCompressedInstructionDataCodec=uU;exports.getTransactionExecuteCompressedInstructionDataDecoder=pi;exports.getTransactionExecuteCompressedInstructionDataEncoder=yi;exports.getTransactionExecuteDiscriminatorBytes=tU;exports.getTransactionExecuteInstruction=di;exports.getTransactionExecuteInstructionDataCodec=rU;exports.getTransactionExecuteInstructionDataDecoder=ii;exports.getTransactionExecuteInstructionDataEncoder=ai;exports.getTransactionExecuteSyncCompressedDiscriminatorBytes=PU;exports.getTransactionExecuteSyncCompressedInstruction=Pi;exports.getTransactionExecuteSyncCompressedInstructionDataCodec=RU;exports.getTransactionExecuteSyncCompressedInstructionDataDecoder=hi;exports.getTransactionExecuteSyncCompressedInstructionDataEncoder=Ei;exports.getTransactionExecuteSyncDiscriminatorBytes=fU;exports.getTransactionExecuteSyncInstruction=Ii;exports.getTransactionExecuteSyncInstructionDataCodec=SU;exports.getTransactionExecuteSyncInstructionDataDecoder=xi;exports.getTransactionExecuteSyncInstructionDataEncoder=Si;exports.getTransactionMessageAddressTableLookupCodec=oE;exports.getTransactionMessageAddressTableLookupDecoder=Vr;exports.getTransactionMessageAddressTableLookupEncoder=Hr;exports.getTransactionMessageCodec=rE;exports.getTransactionMessageDecoder=Rt;exports.getTransactionMessageEncoder=Pt;exports.getUserAccountAddress=N;exports.getUserCodec=dE;exports.getUserCreationArgsCodec=yE;exports.getUserCreationArgsDecoder=pe;exports.getUserCreationArgsEncoder=ye;exports.getUserDecoder=J;exports.getUserEncoder=Oe;exports.getUserMutArgsCodec=lE;exports.getUserMutArgsDecoder=Se;exports.getUserMutArgsEncoder=fe;exports.getUserReadOnlyArgsCodec=IE;exports.getUserReadOnlyArgsDecoder=Kr;exports.getUserReadOnlyArgsEncoder=zr;exports.getUserReadOnlyOrMutateArgsCodec=EE;exports.getUserReadOnlyOrMutateArgsDecoder=Ue;exports.getUserReadOnlyOrMutateArgsEncoder=_e;exports.getUserRoleCodec=bE;exports.getUserRoleDecoder=Le;exports.getUserRoleEncoder=We;exports.getWalletAddressFromIndex=pd;exports.getWalletAddressFromSettings=Ie;exports.getWhitelistedAddressTreeCodec=_h;exports.getWhitelistedAddressTreeDecoder=Fs;exports.getWhitelistedAddressTreeDiscriminatorBytes=bh;exports.getWhitelistedAddressTreeEncoder=Ap;exports.getWhitelistedAddressTreeFromIndex=bn;exports.getWhitelistedAddressTreeIndexFromAddress=iO;exports.getWhitelistedAddressTreesAddress=nd;exports.identifyMultiWalletAccount=pW;exports.identifyMultiWalletInstruction=mW;exports.initialize=BL;exports.isConfigAction=WD;exports.isMultiWalletError=CW;exports.isUserReadOnlyOrMutateArgs=PE;exports.migrateSettings=Mw;exports.migrateUsers=_w;exports.nativeTransferIntent=wk;exports.parseAddWhitelistedAddressTreesInstruction=$h;exports.parseChangeConfigCompressedInstruction=lP;exports.parseChangeConfigInstruction=iP;exports.parseCompressSettingsAccountInstruction=hP;exports.parseCreateDomainConfigInstruction=BP;exports.parseCreateDomainUserAccountInstruction=JP;exports.parseCreateGlobalCounterInstruction=tR;exports.parseCreateMultiWalletCompressedInstruction=AR;exports.parseCreateUserAccountsInstruction=IR;exports.parseDecompressSettingsAccountInstruction=bR;exports.parseDisableDomainConfigInstruction=kR;exports.parseEditDomainConfigInstruction=qR;exports.parseEditTransactionManagerUrlInstruction=nv;exports.parseEditUserDelegateInstruction=gv;exports.parseMigrateCompressedSettingsInstruction=Iv;exports.parseMigrateCompressedUsersInstruction=bv;exports.parseNativeTransferIntentCompressedInstruction=Yv;exports.parseNativeTransferIntentInstruction=Hv;exports.parseSecp256r1VerifyInstruction=nB;exports.parseTokenTransferIntentCompressedInstruction=mb;exports.parseTokenTransferIntentInstruction=ob;exports.parseTransactionBufferCloseCompressedInstruction=Wb;exports.parseTransactionBufferCloseInstruction=Mb;exports.parseTransactionBufferCreateCompressedInstruction=Xb;exports.parseTransactionBufferCreateInstruction=Gb;exports.parseTransactionBufferExecuteCompressedInstruction=m_;exports.parseTransactionBufferExecuteInstruction=c_;exports.parseTransactionBufferExtendCompressedInstruction=__;exports.parseTransactionBufferExtendInstruction=D_;exports.parseTransactionBufferVoteCompressedInstruction=Y_;exports.parseTransactionBufferVoteInstruction=H_;exports.parseTransactionExecuteCompressedInstruction=AU;exports.parseTransactionExecuteInstruction=nU;exports.parseTransactionExecuteSyncCompressedInstruction=vU;exports.parseTransactionExecuteSyncInstruction=xU;exports.pollJitoBundleConfirmation=UO;exports.prepareTransactionBundle=c2;exports.prepareTransactionMessage=S2;exports.prepareTransactionSync=M2;exports.retrieveTransactionManager=WO;exports.sendJitoBundle=yC;exports.signAndSendBundledTransactions=bO;exports.signAndSendTransaction=_O;exports.signMessageWithPasskey=FN;exports.signTransactionWithPasskey=YN;exports.tokenTransferIntent=jk;exports.uninitialize=OL;exports.userReadOnlyOrMutateArgs=hE;exports.vaultTransactionMessageDeserialize=Ui;exports.vaultTransactionMessageSerialize=_i;exports.voteTransactionBuffer=wd;//# sourceMappingURL=index.cjs.map
|
|
1
|
+
'use strict';var gill=require('gill'),Wn=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'),nist_js=require('@noble/curves/nist.js'),tinyCbor=require('@levischuck/tiny-cbor');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Wn__default=/*#__PURE__*/_interopDefault(Wn);var Vn=new Uint8Array([201,232,212,229,59,241,106,197]);function KC(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Vn)}function $d(){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:Vn}))}function Gn(){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 JC(){return gill.combineCodec($d(),Gn())}function Fn(e){return gill.decodeAccount(e,Gn())}async function zn(e,n,r){let s=await Qd(e,n,r);return gill.assertAccountExists(s),s}async function Qd(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Fn(s)}async function jC(e,n,r){let s=await eu(e,n,r);return gill.assertAccountsExist(s),s}async function eu(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Fn(t))}function qC(){return 846}var jn=new Uint8Array([42,206,176,58,175,129,130,233]);function XC(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(jn)}function pu(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()]]),e=>({...e,discriminator:jn}))}function qn(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()]])}function $C(){return gill.combineCodec(pu(),qn())}function Yn(e){return gill.decodeAccount(e,qn())}async function QC(e,n,r){let s=await mu(e,n,r);return gill.assertAccountExists(s),s}async function mu(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Yn(s)}async function eD(e,n,r){let s=await Tu(e,n,r);return gill.assertAccountsExist(s),s}async function Tu(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Yn(t))}function tD(){return 24}function Tr(){return gill.getStructEncoder([["memberKey",$()],["permissions",ve()],["verifyArgs",gill.getOptionEncoder(B())],["userArgs",_e()]])}function lr(){return gill.getStructDecoder([["memberKey",Q()],["permissions",be()],["verifyArgs",gill.getOptionDecoder(w())],["userArgs",Ue()]])}function oD(){return gill.combineCodec(Tr(),lr())}function fr(){return gill.getStructEncoder([["programAddressIndex",gill.getU8Encoder()],["accountIndices",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["data",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function Sr(){return gill.getStructDecoder([["programAddressIndex",gill.getU8Decoder()],["accountIndices",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["data",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function iD(){return gill.combineCodec(fr(),Sr())}function st(){return gill.getStructEncoder([["treeInfo",ct()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["outputStateTreeIndex",gill.getU8Encoder()]])}function ot(){return gill.getStructDecoder([["treeInfo",at()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["outputStateTreeIndex",gill.getU8Decoder()]])}function gD(){return gill.combineCodec(st(),ot())}function it(){return gill.getStructEncoder([["treeInfo",ct()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function dt(){return gill.getStructDecoder([["treeInfo",at()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function TD(){return gill.combineCodec(it(),dt())}function Mr(){return gill.getStructEncoder([["a",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["b",gill.fixEncoderSize(gill.getBytesEncoder(),64)],["c",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function Er(){return gill.getStructDecoder([["a",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["b",gill.fixDecoderSize(gill.getBytesDecoder(),64)],["c",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function SD(){return gill.combineCodec(Mr(),Er())}function ut(){return gill.getStructEncoder([["data",gill.getOptionEncoder(At())]])}function z(){return gill.getStructDecoder([["data",gill.getOptionDecoder(gt())]])}function DD(){return gill.combineCodec(ut(),z())}function At(){return gill.getStructEncoder([["threshold",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["index",gill.getU128Encoder()],["multiWalletBump",gill.getU8Encoder()],["members",gill.getArrayEncoder(yt())],["settingsAddressTreeIndex",gill.getU8Encoder()]])}function gt(){return gill.getStructDecoder([["threshold",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["index",gill.getU128Decoder()],["multiWalletBump",gill.getU8Decoder()],["members",gill.getArrayDecoder(pt())],["settingsAddressTreeIndex",gill.getU8Decoder()]])}function PD(){return gill.combineCodec(At(),gt())}function mt(){return gill.getDiscriminatedUnionEncoder([["EditPermissions",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Rr())])]])],["AddMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Tr())])]])],["RemoveMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(br())])]])],["SetThreshold",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getU8Encoder()])]])]])}function Tt(){return gill.getDiscriminatedUnionDecoder([["EditPermissions",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(vr())])]])],["AddMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(lr())])]])],["RemoveMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(_r())])]])],["SetThreshold",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getU8Decoder()])]])]])}function _D(){return gill.combineCodec(mt(),Tt())}function UD(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function WD(e,n){return n.__kind===e}function Ur(){return gill.getStructEncoder([["member",gill.getAddressEncoder()],["role",We()],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userCreationArgs",ye()]])}function Wr(){return gill.getStructDecoder([["member",gill.getAddressDecoder()],["role",Le()],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userCreationArgs",pe()]])}function wD(){return gill.combineCodec(Ur(),Wr())}function Rr(){return gill.getStructEncoder([["memberKey",$()],["permissions",ve()]])}function vr(){return gill.getStructDecoder([["memberKey",Q()],["permissions",be()]])}function VD(){return gill.combineCodec(Rr(),vr())}function lt(){return gill.getStructEncoder([["memberKey",$()],["messageHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function ft(){return gill.getStructDecoder([["memberKey",Q()],["messageHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function KD(){return gill.combineCodec(lt(),ft())}function Lr(){return gill.getStructEncoder([["settingsMutArgs",de()],["transactionManager",gill.getOptionEncoder(fe())]])}function Or(){return gill.getStructDecoder([["settingsMutArgs",ue()],["transactionManager",gill.getOptionDecoder(Se())]])}function YD(){return gill.combineCodec(Lr(),Or())}function yt(){return gill.getStructEncoder([["pubkey",$()],["permissions",ve()],["role",gill.getU8Encoder()],["userAddressTreeIndex",gill.getU8Encoder()],["isDelegate",gill.getU8Encoder()]])}function pt(){return gill.getStructDecoder([["pubkey",Q()],["permissions",be()],["role",gill.getU8Decoder()],["userAddressTreeIndex",gill.getU8Decoder()],["isDelegate",gill.getU8Decoder()]])}function QD(){return gill.combineCodec(yt(),pt())}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 rM(){return gill.combineCodec($(),Q())}function kr(){return gill.getStructEncoder([["authorityCreationArgs",ye()],["compressedProofArgs",M()]])}function Nr(){return gill.getStructDecoder([["authorityCreationArgs",pe()],["compressedProofArgs",E()]])}function cM(){return gill.combineCodec(kr(),Nr())}function St(){return gill.getStructEncoder([["addressMerkleTreePubkeyIndex",gill.getU8Encoder()],["addressQueuePubkeyIndex",gill.getU8Encoder()],["rootIndex",gill.getU16Encoder()]])}function xt(){return gill.getStructDecoder([["addressMerkleTreePubkeyIndex",gill.getU8Decoder()],["addressQueuePubkeyIndex",gill.getU8Decoder()],["rootIndex",gill.getU16Decoder()]])}function dM(){return gill.combineCodec(St(),xt())}function ct(){return gill.getStructEncoder([["rootIndex",gill.getU16Encoder()],["proveByIndex",gill.getBooleanEncoder()],["merkleTreePubkeyIndex",gill.getU8Encoder()],["queuePubkeyIndex",gill.getU8Encoder()],["leafIndex",gill.getU32Encoder()]])}function at(){return gill.getStructDecoder([["rootIndex",gill.getU16Decoder()],["proveByIndex",gill.getBooleanDecoder()],["merkleTreePubkeyIndex",gill.getU8Decoder()],["queuePubkeyIndex",gill.getU8Decoder()],["leafIndex",gill.getU32Decoder()]])}function gM(){return gill.combineCodec(ct(),at())}function ve(){return gill.getStructEncoder([["mask",gill.getU8Encoder()]])}function be(){return gill.getStructDecoder([["mask",gill.getU8Decoder()]])}function mM(){return gill.combineCodec(ve(),be())}function M(){return gill.getStructEncoder([["proof",gill.getOptionEncoder(Mr())],["lightCpiAccountsStartIndex",gill.getU8Encoder()]])}function E(){return gill.getStructDecoder([["proof",gill.getOptionDecoder(Er())],["lightCpiAccountsStartIndex",gill.getU8Decoder()]])}function SM(){return gill.combineCodec(M(),E())}function br(){return gill.getStructEncoder([["memberKey",$()],["userArgs",_e()]])}function _r(){return gill.getStructDecoder([["memberKey",Q()],["userArgs",Ue()]])}function DM(){return gill.combineCodec(br(),_r())}function Hr(){return gill.getTupleEncoder([gill.fixEncoderSize(gill.getBytesEncoder(),33)])}function It(){return gill.getTupleDecoder([gill.fixDecoderSize(gill.getBytesDecoder(),33)])}function hM(){return gill.combineCodec(Hr(),It())}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 vM(){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 WM(){return gill.combineCodec(ee(),te())}function Ct(){return gill.getStructEncoder([["addressTreeInfo",St()],["outputStateTreeIndex",gill.getU8Encoder()]])}function Dt(){return gill.getStructDecoder([["addressTreeInfo",xt()],["outputStateTreeIndex",gill.getU8Decoder()]])}function wM(){return gill.combineCodec(Ct(),Dt())}function Mt(){return gill.getStructEncoder([["index",gill.getU128Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()]])}function Et(){return gill.getStructDecoder([["index",gill.getU128Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()]])}function HM(){return gill.combineCodec(Mt(),Et())}function de(){return gill.getStructEncoder([["accountMeta",st()],["data",ut()]])}function ue(){return gill.getStructDecoder([["accountMeta",ot()],["data",z()]])}function zM(){return gill.combineCodec(de(),ue())}function se(){return gill.getStructEncoder([["accountMeta",it()],["data",ut()]])}function oe(){return gill.getStructDecoder([["accountMeta",dt()],["data",z()]])}function qM(){return gill.combineCodec(se(),oe())}function ht(){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(lt()))]])}function Pt(){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 $M(){return gill.combineCodec(ht(),Pt())}function Rt(){return gill.getStructEncoder([["numSigners",gill.getU8Encoder()],["numWritableSigners",gill.getU8Encoder()],["numWritableNonSigners",gill.getU8Encoder()],["numAccountKeys",gill.getU8Encoder()],["instructions",gill.getArrayEncoder(fr())],["addressTableLookups",gill.getArrayEncoder(Vr())]])}function vt(){return gill.getStructDecoder([["numSigners",gill.getU8Decoder()],["numWritableSigners",gill.getU8Decoder()],["numWritableNonSigners",gill.getU8Decoder()],["numAccountKeys",gill.getU8Decoder()],["instructions",gill.getArrayDecoder(Sr())],["addressTableLookups",gill.getArrayDecoder(Gr())]])}function rE(){return gill.combineCodec(Rt(),vt())}function Vr(){return gill.getStructEncoder([["lookupTableAddressIndex",gill.getU8Encoder()],["writableIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["readonlyIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function Gr(){return gill.getStructDecoder([["lookupTableAddressIndex",gill.getU8Decoder()],["writableIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["readonlyIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function oE(){return gill.combineCodec(Vr(),Gr())}function Oe(){return gill.getStructEncoder([["member",$()],["domainConfig",gill.getOptionEncoder(gill.getAddressEncoder())],["role",We()],["delegatedTo",gill.getOptionEncoder(Mt())],["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(Et())],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userAddressTreeIndex",gill.getU8Decoder()]])}function dE(){return gill.combineCodec(Oe(),J())}function ye(){return gill.getStructEncoder([["addressTreeInfo",St()],["outputStateTreeIndex",gill.getU8Encoder()]])}function pe(){return gill.getStructDecoder([["addressTreeInfo",xt()],["outputStateTreeIndex",gill.getU8Decoder()]])}function yE(){return gill.combineCodec(ye(),pe())}function fe(){return gill.getStructEncoder([["accountMeta",st()],["data",Oe()]])}function Se(){return gill.getStructDecoder([["accountMeta",ot()],["data",J()]])}function lE(){return gill.combineCodec(fe(),Se())}function Kr(){return gill.getStructEncoder([["accountMeta",it()],["data",Oe()]])}function Jr(){return gill.getStructDecoder([["accountMeta",dt()],["data",J()]])}function IE(){return gill.combineCodec(Kr(),Jr())}function _e(){return gill.getDiscriminatedUnionEncoder([["Read",gill.getStructEncoder([["fields",gill.getTupleEncoder([Kr()])]])],["Mutate",gill.getStructEncoder([["fields",gill.getTupleEncoder([fe()])]])]])}function Ue(){return gill.getDiscriminatedUnionDecoder([["Read",gill.getStructDecoder([["fields",gill.getTupleDecoder([Jr()])]])],["Mutate",gill.getStructDecoder([["fields",gill.getTupleDecoder([Se()])]])]])}function EE(){return gill.combineCodec(_e(),Ue())}function hE(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function PE(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 bE(){return gill.combineCodec(We(),Le())}var bs=new Uint8Array([223,179,163,190,177,224,67,173]);function lh(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(bs)}function My(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()],["members",gill.getArrayEncoder(yt(),{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:bs}))}function _s(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()],["members",gill.getArrayDecoder(pt(),{size:4})],["membersLen",gill.getU8Decoder()],["threshold",gill.getU8Decoder()],["multiWalletBump",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()],["padding",gill.fixDecoderSize(gill.getBytesDecoder(),3)]])}function fh(){return gill.combineCodec(My(),_s())}function Us(e){return gill.decodeAccount(e,_s())}async function Sh(e,n,r){let s=await Yr(e,n,r);return gill.assertAccountExists(s),s}async function Yr(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Us(s)}async function xh(e,n,r){let s=await Ey(e,n,r);return gill.assertAccountsExist(s),s}async function Ey(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Us(t))}function Ih(){return 184}var ws=new Uint8Array([90,36,35,219,93,225,110,96]);function Eh(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(ws)}function Ky(){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(lt()))],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:ws}))}function ks(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["multiWalletSettings",gill.getAddressDecoder()],["multiWalletBump",gill.getU8Decoder()],["canExecute",gill.getBooleanDecoder()],["preauthorizeExecution",gill.getBooleanDecoder()],["validTill",gill.getU64Decoder()],["payer",gill.getAddressDecoder()],["bump",gill.getU8Decoder()],["bufferIndex",gill.getU8Decoder()],["finalBufferHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["finalBufferSize",gill.getU16Decoder()],["creator",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 hh(){return gill.combineCodec(Ky(),ks())}function Ns(e){return gill.decodeAccount(e,ks())}async function Hs(e,n,r){let s=await Jy(e,n,r);return gill.assertAccountExists(s),s}async function Jy(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Ns(s)}async function Ph(e,n,r){let s=await jy(e,n,r);return gill.assertAccountsExist(s),s}async function jy(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Ns(t))}var Fs=new Uint8Array([105,23,173,2,197,255,80,87]);function bh(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Fs)}function Ap(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["whitelistedAddressTrees",gill.getArrayEncoder(gill.getAddressEncoder())],["bump",gill.getU8Encoder()]]),e=>({...e,discriminator:Fs}))}function zs(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["whitelistedAddressTrees",gill.getArrayDecoder(gill.getAddressDecoder())],["bump",gill.getU8Decoder()]])}function _h(){return gill.combineCodec(Ap(),zs())}function Ks(e){return gill.decodeAccount(e,zs())}async function Js(e,n,r){let s=await gp(e,n,r);return gill.assertAccountExists(s),s}async function gp(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Ks(s)}async function Uh(e,n,r){let s=await yp(e,n,r);return gill.assertAccountsExist(s),s}async function yp(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Ks(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 qs(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 Zs=new Uint8Array([8]);function Yh(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Zs)}function nn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["addressTree",gill.getAddressEncoder()]]),e=>({...e,discriminator:Zs}))}function Xs(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["addressTree",gill.getAddressDecoder()]])}function Zh(){return gill.combineCodec(nn(),Xs())}async function $s(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:nn().encode(c),programAddress:r})}function Xh(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:nn().encode(c),programAddress:r})}function $h(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:Xs().decode(e.data)}}var ro=new Uint8Array([9]);function oP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ro)}function sn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsIndex",gill.getU128Encoder()],["configActions",gill.getArrayEncoder(mt())],["compressedProofArgs",gill.getOptionEncoder(M())]]),e=>({...e,discriminator:ro}))}function no(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsIndex",gill.getU128Decoder()],["configActions",gill.getArrayDecoder(Tt())],["compressedProofArgs",gill.getOptionDecoder(E())]])}function cP(){return gill.combineCodec(sn(),no())}async function so(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(qs(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:sn().encode(c),programAddress:r})}function aP(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:sn().encode(c),programAddress:r})}function iP(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:no().decode(e.data)}}var ao=new Uint8Array([20]);function mP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ao)}function io(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["configActions",gill.getArrayEncoder(mt())],["settingsMut",de()],["compressedProofArgs",M()]]),e=>({...e,discriminator:ao}))}function uo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["configActions",gill.getArrayDecoder(Tt())],["settingsMut",ue()],["compressedProofArgs",E()]])}function TP(){return gill.combineCodec(io(),uo())}function Ao(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:io().encode(c),programAddress:r})}function lP(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:uo().decode(e.data)}}var po=new Uint8Array([17]);function MP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(po)}function mo(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",M()],["settingsMutArgs",de()],["secp256r1VerifyArgs",gill.getArrayEncoder(ee())]]),e=>({...e,discriminator:po}))}function To(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",E()],["settingsMutArgs",ue()],["secp256r1VerifyArgs",gill.getArrayDecoder(te())]])}function EP(){return gill.combineCodec(mo(),To())}function lo(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:mo().encode(c),programAddress:r})}function hP(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:To().decode(e.data)}}var Eo=new Uint8Array([0]);function WP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Eo)}function cn(){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",M()]]),e=>({...e,discriminator:Eo}))}function ho(){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",pe()],["compressedProofArgs",E()]])}function LP(){return gill.combineCodec(cn(),ho())}async function Po(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:cn().encode(c),programAddress:r})}function OP(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:cn().encode(c),programAddress:r})}function BP(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:ho().decode(e.data)}}var vo=new Uint8Array([4]);function FP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(vo)}function dn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",M()],["member",Hr()],["role",We()],["userAccountCreationArgs",ye()],["linkWalletArgs",gill.getOptionEncoder(Lr())]]),e=>({...e,discriminator:vo}))}function bo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",E()],["member",It()],["role",Le()],["userAccountCreationArgs",pe()],["linkWalletArgs",gill.getOptionDecoder(Or())]])}function zP(){return gill.combineCodec(dn(),bo())}async function _o(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:dn().encode(c),programAddress:r})}function KP(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:dn().encode(c),programAddress:r})}function JP(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:bo().decode(e.data)}}var Wo=new Uint8Array([3]);function $P(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Wo)}function An(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:Wo}))}function Lo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function QP(){return gill.combineCodec(An(),Lo())}async function Oo(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:An().encode({}),programAddress:r})}function eR(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:An().encode({}),programAddress:r})}function tR(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{globalCounter:r(),payer:r(),systemProgram:r()},data:Lo().decode(e.data)}}var ko=new Uint8Array([19]);function iR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ko)}function gn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["compressedProofArgs",M()],["settingsCreation",Ct()],["userArgs",_e()],["settingsIndex",gill.getU128Encoder()]]),e=>({...e,discriminator:ko}))}function No(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["compressedProofArgs",E()],["settingsCreation",Dt()],["userArgs",Ue()],["settingsIndex",gill.getU128Decoder()]])}function dR(){return gill.combineCodec(gn(),No())}async function Ho(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:gn().encode(c),programAddress:r})}function uR(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:gn().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:No().decode(e.data)}}var Go=new Uint8Array([5]);function fR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Go)}function pn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",M()],["createUserArgs",gill.getArrayEncoder(Ur())]]),e=>({...e,discriminator:Go}))}function Fo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",E()],["createUserArgs",gill.getArrayDecoder(Wr())]])}function SR(){return gill.combineCodec(pn(),Fo())}async function zo(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:pn().encode(c),programAddress:r})}function xR(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:pn().encode(c),programAddress:r})}function IR(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:Fo().decode(e.data)}}var jo=new Uint8Array([18]);function RR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(jo)}function qo(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsMut",de()],["compressedProofArgs",M()],["secp256r1VerifyArgs",gill.getArrayEncoder(ee())]]),e=>({...e,discriminator:jo}))}function Yo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsMut",ue()],["compressedProofArgs",E()],["secp256r1VerifyArgs",gill.getArrayDecoder(te())]])}function vR(){return gill.combineCodec(qo(),Yo())}function Zo(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:qo().encode(c),programAddress:r})}function bR(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:Yo().decode(e.data)}}var Qo=new Uint8Array([2]);function BR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Qo)}function ec(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["disable",gill.getBooleanEncoder()]]),e=>({...e,discriminator:Qo}))}function tc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["disable",gill.getBooleanDecoder()]])}function wR(){return gill.combineCodec(ec(),tc())}function rc(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:ec().encode(c),programAddress:r})}function kR(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:tc().decode(e.data)}}var cc=new Uint8Array([1]);function KR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(cc)}function Tn(){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(kr())]]),e=>({...e,discriminator:cc}))}function ac(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["newOrigins",gill.getOptionDecoder(gill.getArrayDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())))],["newAuthorityArgs",gill.getOptionDecoder(Nr())]])}function JR(){return gill.combineCodec(Tn(),ac())}async function jR(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:Tn().encode(c),programAddress:r})}function ic(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:Tn().encode(c),programAddress:r})}function qR(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:ac().decode(e.data)}}var Ac=new Uint8Array([6]);function tv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ac)}function gc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",fe()],["transactionManagerUrl",gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())],["compressedProofArgs",M()]]),e=>({...e,discriminator:Ac}))}function yc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",Se()],["transactionManagerUrl",gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())],["compressedProofArgs",E()]])}function rv(){return gill.combineCodec(gc(),yc())}function pc(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:gc().encode(c),programAddress:r})}function nv(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:yc().decode(e.data)}}var lc=new Uint8Array([7]);function uv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(lc)}function fc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",fe()],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["delegateTo",gill.getOptionEncoder(Mt())],["oldSettingsMutArgs",gill.getOptionEncoder(de())],["newSettingsMutArgs",gill.getOptionEncoder(de())],["compressedProofArgs",M()]]),e=>({...e,discriminator:lc}))}function Sc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",Se()],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["delegateTo",gill.getOptionDecoder(Et())],["oldSettingsMutArgs",gill.getOptionDecoder(ue())],["newSettingsMutArgs",gill.getOptionDecoder(ue())],["compressedProofArgs",E()]])}function Av(){return gill.combineCodec(fc(),Sc())}function xc(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 gv(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:Sc().decode(e.data)}}var Dc=new Uint8Array([33]);function Sv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Dc)}function Mc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",At()],["compressedProofArgs",M()],["settingsCreationArgs",Ct()]]),e=>({...e,discriminator:Dc}))}function Ec(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",gt()],["compressedProofArgs",E()],["settingsCreationArgs",Dt()]])}function xv(){return gill.combineCodec(Mc(),Ec())}function hc(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:Mc().encode(c),programAddress:r})}function Iv(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:Ec().decode(e.data)}}var vc=new Uint8Array([32]);function Rv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(vc)}function bc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Oe()],["compressedProofArgs",M()],["userCreationArgs",ye()]]),e=>({...e,discriminator:vc}))}function _c(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",J()],["compressedProofArgs",E()],["userCreationArgs",pe()]])}function vv(){return gill.combineCodec(bc(),_c())}function Uc(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:bc().encode(c),programAddress:r})}function bv(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:_c().decode(e.data)}}var Lc=new Uint8Array([30]);function wv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Lc)}function ln(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(ee())]]),e=>({...e,discriminator:Lc}))}function Oc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(te())]])}function kv(){return gill.combineCodec(ln(),Oc())}async function Nv(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},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:ln().encode(c),programAddress:r})}function Bc(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:ln().encode(c),programAddress:r})}function Hv(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Oc().decode(e.data)}}var Nc=new Uint8Array([28]);function jv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Nc)}function Hc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(ee())],["settingsReadonlyArgs",se()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Nc}))}function Vc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(te())],["settingsReadonlyArgs",oe()],["compressedProofArgs",E()]])}function qv(){return gill.combineCodec(Hc(),Vc())}function Gc(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:Hc().encode(c),programAddress:r})}function Yv(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:Vc().decode(e.data)}}var zc=new Uint8Array([31]);function rb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(zc)}function Sn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["createAtaIfNeeded",gill.getBooleanEncoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(ee())]]),e=>({...e,discriminator:zc}))}function Kc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["createAtaIfNeeded",gill.getBooleanDecoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(te())]])}function nb(){return gill.combineCodec(Sn(),Kc())}async function sb(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:Sn().encode(c),programAddress:r})}function Jc(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:Sn().encode(c),programAddress:r})}function ob(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:Kc().decode(e.data)}}var Zc=new Uint8Array([29]);function gb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Zc)}function xn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["createAtaIfNeeded",gill.getBooleanEncoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(ee())],["settingsReadonlyArgs",se()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Zc}))}function Xc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["createAtaIfNeeded",gill.getBooleanDecoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(te())],["settingsReadonlyArgs",oe()],["compressedProofArgs",E()]])}function yb(){return gill.combineCodec(xn(),Xc())}async function pb(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:xn().encode(c),programAddress:r})}function $c(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:xn().encode(c),programAddress:r})}function mb(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:Xc().decode(e.data)}}var ta=new Uint8Array([13]);function Cb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ta)}function ra(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())]]),e=>({...e,discriminator:ta}))}function na(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function Db(){return gill.combineCodec(ra(),na())}function sa(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:ra().encode(c),programAddress:r})}function Mb(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:na().decode(e.data)}}var aa=new Uint8Array([24]);function _b(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(aa)}function ia(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["settingsReadonlyArgs",se()],["compressedProofArgs",M()]]),e=>({...e,discriminator:aa}))}function da(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["settingsReadonlyArgs",oe()],["compressedProofArgs",E()]])}function Ub(){return gill.combineCodec(ia(),da())}function ua(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:ia().encode(c),programAddress:r})}function Wb(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:da().decode(e.data)}}var ya=new Uint8Array([10]);function Hb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ya)}function pa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",ht()],["secp256r1VerifyArgs",gill.getOptionEncoder(B())]]),e=>({...e,discriminator:ya}))}function ma(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",Pt()],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function Vb(){return gill.combineCodec(pa(),ma())}function Ta(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},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:pa().encode(c),programAddress:r})}function Gb(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:ma().decode(e.data)}}var Sa=new Uint8Array([21]);function Yb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Sa)}function xa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",ht()],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["settingsReadonlyArgs",se()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Sa}))}function Ia(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",Pt()],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["settingsReadonlyArgs",oe()],["compressedProofArgs",E()]])}function Zb(){return gill.combineCodec(xa(),Ia())}function Ca(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:xa().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:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:Ia().decode(e.data)}}var Ea=new Uint8Array([14]);function s_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ea)}function ha(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())]]),e=>({...e,discriminator:Ea}))}function Pa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function o_(){return gill.combineCodec(ha(),Pa())}function Ra(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:ha().encode(c),programAddress:r})}function c_(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:Pa().decode(e.data)}}var _a=new Uint8Array([25]);function y_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(_a)}function Ua(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["settingsReadonlyArgs",se()],["compressedProofArgs",M()]]),e=>({...e,discriminator:_a}))}function Wa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["settingsReadonlyArgs",oe()],["compressedProofArgs",E()]])}function p_(){return gill.combineCodec(Ua(),Wa())}function La(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:Ua().encode(c),programAddress:r})}function m_(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Wa().decode(e.data)}}var wa=new Uint8Array([12]);function I_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(wa)}function ka(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:wa}))}function Na(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function C_(){return gill.combineCodec(ka(),Na())}function Ha(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:ka().encode(c),programAddress:r})}function D_(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:Na().decode(e.data)}}var Fa=new Uint8Array([23]);function v_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Fa)}function za(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:Fa}))}function Ka(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["settingsKey",gill.getAddressDecoder()]])}function b_(){return gill.combineCodec(za(),Ka())}function Ja(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:za().encode(c),programAddress:r})}function __(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:Ka().decode(e.data)}}var Ya=new Uint8Array([11]);function k_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ya)}function Za(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())]]),e=>({...e,discriminator:Ya}))}function Xa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function N_(){return gill.combineCodec(Za(),Xa())}function $a(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:Za().encode(c),programAddress:r})}function H_(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:Xa().decode(e.data)}}var ti=new Uint8Array([22]);function j_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ti)}function ri(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["settingsReadonlyArgs",se()],["compressedProofArgs",M()]]),e=>({...e,discriminator:ti}))}function ni(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["settingsReadonlyArgs",oe()],["compressedProofArgs",E()]])}function q_(){return gill.combineCodec(ri(),ni())}function si(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:ri().encode(c),programAddress:r})}function Y_(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:ni().decode(e.data)}}var ai=new Uint8Array([15]);function tU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ai)}function ii(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:ai}))}function di(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function rU(){return gill.combineCodec(ii(),di())}function ui(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:ii().encode({}),programAddress:r})}function nU(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:di().decode(e.data)}}var yi=new Uint8Array([26]);function dU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(yi)}function pi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:yi}))}function mi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsKey",gill.getAddressDecoder()]])}function uU(){return gill.combineCodec(pi(),mi())}function Ti(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:pi().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:mi().decode(e.data)}}var Si=new Uint8Array([16]);function fU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Si)}function xi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",Rt()],["secp256r1VerifyArgs",gill.getArrayEncoder(ee())]]),e=>({...e,discriminator:Si}))}function Ii(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",vt()],["secp256r1VerifyArgs",gill.getArrayDecoder(te())]])}function SU(){return gill.combineCodec(xi(),Ii())}function Ci(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:xi().encode(c),programAddress:r})}function xU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Ii().decode(e.data)}}var Ei=new Uint8Array([27]);function PU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ei)}function hi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",Rt()],["secp256r1VerifyArgs",gill.getArrayEncoder(ee())],["settingsReadonlyArgs",se()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Ei}))}function Pi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",vt()],["secp256r1VerifyArgs",gill.getArrayDecoder(te())],["settingsReadonlyArgs",oe()],["compressedProofArgs",E()]])}function RU(){return gill.combineCodec(hi(),Pi())}function Ri(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:hi().encode(c),programAddress:r})}function vU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Pi().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",YS=(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))(YS||{});function pW(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 ZS=(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))(ZS||{});function mW(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 $S=6e3,QS=6001,ex=6002,tx=6003,rx=6004,nx=6005,sx=6006,ox=6007,cx=6008,ax=6009,ix=6010,dx=6011,ux=6012,Ax=6013,gx=6014,yx=6015,px=6016,mx=6017,Tx=6018,lx=6019,fx=6020,Sx=6021,xx=6022,Ix=6023,Cx=6024,Dx=6025,Mx=6026,Ex=6027,hx=6028,Px=6029,Rx=6030,vx=6031,bx=6032,_x=6033,Ux=6034,Wx=6035,Lx=6036,Ox=6037,Bx=6038,wx=6039,kx=6040,Nx=6041,Hx=6042,Vx=6043,Gx=6044,Fx=6045,zx=6046,Kx=6047,Jx=6048,jx=6049,qx=6050,Yx=6051,Zx=6052,Xx=6053,vi;process.env.NODE_ENV!=="production"&&(vi={[Rx]:"This member is already delegated to another wallet.",[ox]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[jx]:"The domain configuration account is disabled. Please contact support or try again later.",[qx]:"Missing domain configuration account.",[ix]:"Duplicate public keys detected among members. Each member must have a unique key.",[ax]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[fx]:"No members provided. A multisig wallet must contain at least one member.",[Tx]:"Expected a User with Administrator role for this instruction.",[cx]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[px]:"Expected a User with Transaction Manager role for this instruction.",[wx]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[kx]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[Nx]:"Declared buffer size does not match the actual serialized size.",[_x]:"Not enough members with vote permission to meet the approval threshold.",[vx]:"At least one signer with execute permission is required to proceed.",[bx]:"At least one signer with initiate permission is required to perform this action.",[Dx]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[Xx]:"Address Tree supplied is not part of the whitelisted address trees",[lx]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[Ex]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[Bx]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[Ux]:"Only delegated members are allowed for this transaction.",[Cx]:"Unexpected number of accounts provided for this instruction.",[Ax]:"User with Permanent Member role requires a must have a delegated wallet.",[QS]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[rx]:"The extracted public key has an invalid length or encoding.",[$S]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[tx]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[Kx]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[xx]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[mx]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[yx]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[Ix]:"Malformed transaction message: structure or formatting does not match the expected layout.",[Mx]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[nx]:"The extracted WebAuthn signed message payload is malformed.",[Fx]:"An input string exceeds the maximum allowed character length.",[Yx]:"This member is not registered under the provided domain configuration.",[hx]:"A required account is missing from the instruction context.",[zx]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[Px]:"User mutation arguments are required when performing add or remove delegate operations.",[Lx]:"No valid signer found in this transaction.",[ux]:"Only one permanent member is allowed per wallet.",[gx]:"Only one transaction manager is allowed per wallet.",[Zx]:"The given origin index is not in the whitelisted origins.",[dx]:"Permanent members cannot be removed from a wallet.",[Gx]:"Writable CPI calls to protected accounts are not permitted.",[sx]:"The rpIdHash extracted from the signed message does not match the expected value.",[ex]:"The signature index provided is out of bounds for the secp256r1 instruction.",[Jx]:"The specified slot number was not found in the provided slot history.",[Sx]:"Too many members: a maximum of 4 members are supported.",[Hx]:"This transaction has expired. It must be executed within 3 minutes of approval.",[Vx]:"This transaction has not yet reached the required approval threshold.",[Ox]:"Only the transaction creator or rent payer may close this transaction buffer.",[Wx]:"Member is not part of the expected signers for this transaction."});function IW(e){return process.env.NODE_ENV!=="production"?vi[e]:"Error message not available in production bundles."}function CW(e,n,r){return gill.isProgramError(e,n,A,r)}var Lt={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 Dn=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!==Dn)throw new Error(`Invalid public key length, expected ${Dn} 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===Dn)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 eI(){return gill.getStructCodec([["programAddressIndex",gill.getU8Codec()],["accountIndices",gill.getArrayCodec(gill.getU8Codec())],["data",gill.getArrayCodec(gill.getU8Codec())]])}function tI(){return gill.getStructCodec([["lookupTableAddress",gill.getAddressCodec()],["writableIndexes",gill.getArrayCodec(gill.getU8Codec())],["readonlyIndexes",gill.getArrayCodec(gill.getU8Codec())]])}var _i=gill.getStructCodec([["numSigners",gill.getU8Codec()],["numWritableSigners",gill.getU8Codec()],["numWritableNonSigners",gill.getU8Codec()],["accountKeys",gill.getArrayCodec(gill.getAddressCodec())],["instructions",gill.getArrayCodec(eI())],["addressTableLookups",gill.getArrayCodec(tI())]]);function Ui(e){return _i.encode({numSigners:e.header.numSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,accountKeys:e.staticAccounts,instructions:e.instructions.map(r=>({programAddressIndex:r.programAddressIndex,accountIndices:r.accountIndices??[],data:Array.from(r.data??[])})),addressTableLookups:e.version!=="legacy"?e.addressTableLookups?.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes,writableIndexes:r.writableIndexes}))??[]:[]})}function Wi(e){let n=_i.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 Li="revibase.com",Oi="https://auth.revibase.com",Bi="https://api.revibase.com";function Ke(e=`${Je()}/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 iL(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 dL(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 uL(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=new Uint8Array(he(n)),c=JSON.parse(new TextDecoder().decode(he(r))),i=Hi(c),a=Gi(new Uint8Array(he(s))),o=await je({rpIdHash:t.subarray(0,32)});return new C(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(he(r)),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(gill.getBase58Encoder().encode(e.slotHash))},clientAndDeviceHash:En(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 AL(e,n){let{data:r}=await zn(re(),e),t=Vi(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 En(e,n,r){return sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e),...gill.getBase58Encoder().encode(n),...new TextEncoder().encode(r)]))}function gL(e){return sha2_js.sha256(new Uint8Array(gill.getUtf8Encoder().encode(JSON.stringify(e))))}function yL(e){return hn(e.data.payload.authResponse)}function pL(e,n,r,s){return sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e),...En(n,r,s)]))}async function mL(e,n,r,s,t,c){let i;if(!t||!c){let o=(await re().getAccountInfo(gill.address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed"}).send()).value?.data;if(!o)throw new Error("Unable to fetch slot sysvar");let d=gill.getBase64Encoder().encode(o[0]);c=gill.getU64Decoder().decode(d.subarray(8,16)).toString(),i=d.subarray(16,48),t=gill.getBase58Decoder().decode(i);}else i=new Uint8Array(gill.getBase58Encoder().encode(t));let a=sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e.transactionActionType),...gill.getBase58Encoder().encode(e.transactionAddress),...sha2_js.sha256(typeof e.transactionMessageBytes=="string"?new Uint8Array(he(e.transactionMessageBytes)):e.transactionMessageBytes),...i,...En(n,r,s)]));return {slotNumber:c,slotHash:t,challenge:a}}function hn(e){return sha2_js.sha256(cr(e))}function Ni(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function he(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}var qe=null,zi=2e3,Ki=3e3,uI=300*1e3;async function ar({authUrl:e,payload:n,signature:r,popUp:s=null}){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(()=>{s&&s.closed&&(u(),c(new Error("User closed the authentication window")));},500),d=setTimeout(()=>{u(),c(new Error("Authentication timed out"));},uI);function u(){clearInterval(o),clearTimeout(d),a&&clearTimeout(a),qe&&window.removeEventListener("message",qe),s&&s.close();}if(s?s.location.replace(e):s=Ke(e),!s){c(new Error("Disable your popup blocker to continue."));return}let g=y=>{let T=y.origin===i,f=y.source===s;if(!(!T||!f||!y.isTrusted||!s))switch(y.data.type){case "popup-ready":s.postMessage({type:"popup-init",payload:n,signature:r},i),a=setTimeout(()=>{u(),c(new Error("User closed the authentication window"));},zi+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"));},zi+Ki));break;case "popup-closed":u(),c(new Error("User closed the authentication window"));break}};qe&&window.removeEventListener("message",qe),qe=g,window.addEventListener("message",qe);})}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 Hi(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 Vi(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 Gi(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 cr(e){return new Uint8Array([...new Uint8Array(he(e.response.authenticatorData)),...sha2_js.sha256(new Uint8Array(he(e.response.clientDataJSON)))])}async function Rn(e,n=false){let r=n?{blockhash:gill.getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await re().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 qi(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 Yi(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?cr(r.authResponse):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:i,publicKey:a}}function Ye(e){if(e instanceof Me)return {keyType:Lt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:Lt.Ed25519,key:new Uint8Array([0,...gill.getAddressEncoder().encode(n)])}}}function ji(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(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 Zi({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 Xi(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 Ze(){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 re(){if(!_.solanaRpc)throw new Error("Rpc is not initialized yet");return _.solanaRpc}function $i(){if(!_.sendAndConfirm)throw new Error("Rpc is not initialized yet.");return _.sendAndConfirm}function Qi(){if(!_.computeEstimate)throw new Error("Rpc is not initialized yet");return _.computeEstimate}async function WL(){return _.feePayer||(_.feePayer=await Xi(_.apiEndpoint??Bi)),_.feePayer}function vn(){if(!_.jitoTipsConfig)throw new Error("Jito Bundle Config is not set.");return _.jitoTipsConfig}function Je(){return _.authEndpoint??Oi}function LL(){return _.rpId??Li}function Xe(){if(!_.onClientAuthorizationCallback)throw new Error("No client authorization callback found.");return _.onClientAuthorizationCallback}function OL(){Object.keys(_).forEach(e=>{_[e]=void 0;});}function BL({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s,apiEndpoint:t,authEndpoint:c,rpId:i,onClientAuthorizationCallback: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=Ze().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 ir(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=>ir(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 dr()).length-1}var bn;async function dr(){if(!bn){let{data:e}=await Js(re(),await nd());bn=e.whitelistedAddressTrees;}return bn}async function ur(e,n,r){let s=await YI(e,n,r);if(!s)throw new Error("User cannot be found.");return s}async function YI(e,n,r){let{address:s}=await N(e,n),t=await ir(s,r);return t?.data?.data?J().decode(t.data.data):null}async function wt(e,n,r){let s=await ZI(e,n,r);if(!s)throw new Error("Settings cannot be found.");return s}async function ZI(e,n,r){try{let{address:s}=await j(e,n),t=await ir(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 Yr(re(),await Z(e));return s.exists?{...s.data,members:s.data.members.slice(0,s.data.membersLen),isCompressed:false}:null}}async function _n(e){let n=await dr();if(e<0||e>=n.length)throw new Error(`Invalid address tree index: ${e}`);return n[e]}async function iO(e){let r=(await dr()).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(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=Ze().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 _n(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 _n(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 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 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 pd(e){let n=await Z(e);return await Ie(n)}async function lO(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("cpi_authority")]});return e}async function bO(e){let n=await Rn(e,true),r=await Yi(n.map(gill.getBase64EncodedWireTransaction),Ze()),s=await Rn(e.map((c,i)=>({...c,unitsConsumed:r[i]})));return await yC(s.map(gill.getBase64EncodedWireTransaction))}async function _O({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await re().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([Qi()(c),qi(re(),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 $i()(t,{commitment:"confirmed",skipPreflight:true}),gill.getSignatureFromTransaction(t)}async function yC(e,n=10,r=1e3,s=vn()){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 UO(e,n=30,r=3e3,s=vn()){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 WO(e,n,r,s){let t=await wt(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=>Td(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(Td(d.pubkey)),userAddressTreeIndex:d.userAddressTreeIndex}}async function LO({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await ur(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new Error("Transaction manager endpoint is missing for this account.");return pC(n,c.transactionManagerUrl.value,e,s)}function pC(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 Td(e){return e.keyType===Lt.Ed25519?gill.getBase58Decoder().decode(e.key.subarray(1,33)):gill.getBase58Decoder().decode(e.key)}async function QO({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,payer:s,compressed:t=false,cachedAccounts:c}){let i=await SC(r),a=new U,o=null,d=null,u=[];if(i.length||t){let h=await xC({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 IC({configActionsArgs:r,packedAccounts:a,userMutArgs:u,index:e}),{remainingAccounts:T,systemOffset:f}=a.toAccountMetas(),D=b(o,f);return {instructions:t?[Ao({configActions:g,payer:s,authority:gill.createNoopSigner(await pd(e)),compressedProofArgs:D,settingsMut:d,remainingAccounts:T})]:[await so({settingsIndex:e,configActions:g,payer:s,compressedProofArgs:D,remainingAccounts:T})],secp256r1VerifyInput:y}}async function SC(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 xC({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 IC({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(D=>s.find(x=>new Wn__default.default(new Uint8Array(x.accountMeta.address)).eq(D.address)));if(!f)throw new Error("Unable to find user account");a.push(ld({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 Wn__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 Wn__default.default(new Uint8Array(g.accountMeta.address)).eq(d.address));if(!u)throw new Error("Unable to find user account");return DC({pubkey:o.member,userMutArgs:u,index:e})})));c.push({__kind:i.type,fields:[a]});break}case "EditPermissions":{let a=i.members.map(o=>CC({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 CC({pubkey:e,permissionArgs:n}){return {memberKey:Ye(e),permissions:fd(n)}}function DC({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:Ye(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:Ye(e),permissions:fd(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 fd(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 Qe=33,et=64,wn=14,bC=2,_C=gill.address("Secp256r1SigVerify1111111111111111111111111");function UC(){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 WC(){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 Cd(){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=WC();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(),Qe).decode(e,n);n+=Qe;let d=gill.fixDecoderSize(gill.getBytesDecoder(),et).decode(e,n);n+=et;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 Dd(){return gill.createEncoder({getSizeFromValue:e=>{let n=wn*e.offsets.length,r=e.payload.reduce((s,t)=>s+Qe+et+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=UC();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=gill.fixEncoderSize(gill.getBytesEncoder(),Qe).write(t.publicKey,n,r),r=gill.fixEncoderSize(gill.getBytesEncoder(),et).write(t.signature,n,r),r=gill.getBytesEncoder().write(t.message,n,r);return r}})}function rB(){return gill.combineCodec(Dd(),Cd())}function F(e,n){let r=e.length,s=bC+r*wn,t=[];for(let o=0;o<r;o++){let{message:d}=e[o],u=s,g=u+Qe,y=g+et;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:y,messageDataSize:d.length,messageInstructionIndex:65535}),s+=Qe+et+d.length;}let c=n?.programAddress??_C,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:Dd().encode(i)}}function nB(e){return {programAddress:e.programAddress,accounts:{},data:Cd().decode(e.data)}}async function yB({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:D,systemOffset:x}=c.toAccountMetas(),h=b(d,x),I=[];return T.length>0&&I.push(F(T)),I.push(lo({settings:i,settingsMutArgs:u,compressedProofArgs:h,payer:r,secp256r1VerifyArgs:f,remainingAccounts:D})),I}async function TB({admin:e,addressTree:n}){return $s({payer:e,addressTree:n,remainingAccounts:[]})}async function DB({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 Po({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:f,payer:e,domainConfig:t,rpId:n,remainingAccounts:y})}async function WB({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,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&&(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 _o({payer:n,authority:e,compressedProofArgs:L,member:It().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 wB({payer:e}){let n=await gd();return Oo({payer:e,globalCounter:n})}async function zB({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 zo({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 qB({admin:e,rpId:n,disable:r}){let s=await je({rpId:n});return rc({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function tw({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 ic({domainConfig:n,authority:e,newOrigins:s?gill.some(s):gill.none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function aw({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 pc({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function lw({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 ur(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,D,x=null;g.delegatedTo.__option==="Some"&&((await wt(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 wt(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=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),ne=[];return u.length>0&&ne.push(F(u)),ne.push(xc({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})),ne}async function Mw({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 hc({compressedProofArgs:y,args:e,authority:n,settingsCreationArgs:d,remainingAccounts:u})}async function _w({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 Uc({compressedProofArgs:y,args:e,authority:n,userCreationArgs:d,remainingAccounts:u})}async function Qw({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:D,addressTree:x}=await j(e,f);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(ne=>ne.type==="User"),J())[0],W=(await ae(g,I.treeInfos.slice(h),I.roots.slice(h),I.rootIndices.slice(h),y)).find(ne=>ne.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 Ho({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 dk({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(),D=b(a,f),x=[];g.length>0&&x.push(F(g));let h=await Z(e);return x.push(Zo({settings:h,payer:r,settingsMut:o,compressedProofArgs:D,secp256r1VerifyArgs:y,remainingAccounts:T})),x}function kC(e,n,r,s){let t=NC(e,n),c=HC(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 NC(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 HC(e,n){return n<e.header.numSignerAccounts}async function gr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=Wi(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=r??(t.addressTableLookups?await gill.fetchAddressesForLookupTables(t.addressTableLookups.map(a=>a.lookupTableAddress),re()):{}),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:kC(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 vd({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 gr({transactionMessageBytes:r,walletAddress:d,additionalSigners:i,addressesByLookupTableAddress:t}),y=[];return c.length>0&&y.push(F(c)),y.push(o?Ti({transactionBuffer:n,payer:s.address,remainingAccounts:u,settingsKey:e}):ui({transactionBuffer:n,payer:s.address,settings:e})),a&&y.push(Zi({payer:s,tipAmount:a})),{instructions:y,addressLookupTableAccounts:g}}async function bd({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:D},{settingsReadonlyArgs:x,proof:h,packedAccounts:I}]=await Promise.all([gr({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 ne=i.length,{domainConfig:me,verifyArgs:Pe,signature:Ce,publicKey:Re,message:kt}=G(O,ne);kt&&Ce&&Re&&i.push({message:kt,signature:Ce,publicKey:Re}),me&&(I.addPreAccounts([{address:me,role:gill.AccountRole.READONLY}]),Pe?.__option==="Some"&&L.push({domainConfigKey:me,verifyArgs:Pe.value}));}let{remainingAccounts:W,systemOffset:q}=I.toAccountMetas(),H=[];i.length>0&&H.push(F(i));let V=GC(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(Ri({secp256r1VerifyArgs:L,transactionMessage:V,settingsReadonlyArgs:x,compressedProofArgs:O,payer:t,remainingAccounts:W}));}else H.push(Ci({secp256r1VerifyArgs:L,settings:g,transactionMessage:V,remainingAccounts:W}));return {instructions:H,addressLookupTableAccounts:f}}function GC(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 wk({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=[],D=[];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"&&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(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(Gc({amount:c,settingsReadonlyArgs:g,compressedProofArgs:S,payer:i,secp256r1VerifyArgs:D,source:u,destination:r,remainingAccounts:x}));}else I.push(Bc({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=Ae(t),y=await Z(e),T=await Ie(y),[f,D]=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:ne,verifyArgs:me,signature:Pe,publicKey:Ce,message:Re}=G(V,O);Re&&Pe&&Ce&&S.push({message:Re,signature:Pe,publicKey:Ce}),ne&&(I.addPreAccounts([{address:ne,role:gill.AccountRole.READONLY}]),me?.__option==="Some"&&L.push({domainConfigKey:ne,verifyArgs:me.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($c({amount:i,createAtaIfNeeded:d,settingsReadonlyArgs:x,compressedProofArgs:V,payer:a,secp256r1VerifyArgs:L,source:T,sourceTokenAccount:f,destination:r,destinationTokenAccount:D,mint:s,tokenProgram:o,remainingAccounts:W}));}else H.push(Jc({amount:i,createAtaIfNeeded:d,secp256r1VerifyArgs:L,source:T,sourceTokenAccount:f,destination:r,destinationTokenAccount:D,settings:y,mint:s,tokenProgram:o,remainingAccounts:W}));return H}async function sN({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:i}){let a=await Hs(re(),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: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(ua({transactionBuffer:s,domainConfig:f,closer:r instanceof C?void 0:r,rentCollector:a.data.payer,secp256r1VerifyArgs:D,settingsReadonlyArgs:d,payer:t,compressedProofArgs:L,remainingAccounts:y}));}else S.push(sa({transactionBuffer:s,domainConfig:f,closer:r instanceof C?void 0:r,settings:o,payer:a.data.payer,secp256r1VerifyArgs:D,remainingAccounts:[]}));return S}function Ld({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:D}=G(n),x=[];if(T&&f&&D&&x.push(F([{message:T,signature:f,publicKey:D}])),d){let{settingsReadonlyArgs:h,compressedProofArgs:I,remainingAccounts:S}=d;x.push(Ca({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(Ta({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 Od({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(La({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(Ra({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof C?void 0:e,remainingAccounts:[]})),d}function Bd({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?Ja({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Ha({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function wd({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(si({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($a({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof C?void 0:n,remainingAccounts:[]})),d}async function FN({id:e,message:n,signer:r,popUp:s}){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");let t=window.origin,c=`${Je()}?redirectOrigin=${t}`;s=s??Ke(c);let i={phase:"start",data:{id:e,type:"message",payload:n},redirectOrigin:t,signer:r},a=await Xe()(i),o=await ar({authUrl:c,payload:i,signature:a,popUp:s});if(o.data.type!=="message")throw new Error("Expected Message Response");return {...o.data.payload,clientSignature:{...o.data.payload.clientSignature,signature:await Xe()(o)}}}async function YN({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=`${Je()}?redirectOrigin=${c}`;t=t??Ke(i);let a={phase:"start",data:{type:"transaction",payload:{transactionActionType:e,transactionAddress:n,transactionMessageBytes:Ni(r)}},redirectOrigin:c,signer:s},o=await Xe()(a),d=await ar({authUrl:i,payload:a,signature:o,popUp:t});if(d.data.type!=="transaction")throw new Error("Expected Transaction Response");return {...d.data.payload,clientSignature:{...d.data.payload.clientSignature,signature:await Xe()(d)}}}async function c2({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),D=Math.floor(Math.random()*255),x=await yd(f,t instanceof C?t:t.address,D),h=[],I=[];for(let X=0;X<s.length;X+=y){let Hn=s.subarray(X,X+y);h.push(Hn),I.push(sha2_js.sha256(Hn));}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,ne=Ae([t,...c?[c]:[],...u]).filter(X=>X instanceof C).map(X=>({memberKey:Ye(X),messageHash:hn(X.authResponse)})),me=Ld({finalBufferHash:S,finalBufferSize:s.length,bufferIndex:D,payer:e,transactionBufferAddress:x,settings:f,creator:t,preauthorizeExecution:!c,bufferExtendHashes:I,compressedArgs:O,expectedSecp256r1Signers:ne}),Pe=h.map(X=>Bd({transactionMessageBytes:X,transactionBufferAddress:x,settings:f,compressed:d})),Ce=u.map(X=>wd({voter:X,transactionBufferAddress:x,settings:f,compressedArgs:O})),Re=Od({compressedArgs:O,settings:f,executor:c,transactionBufferAddress:x}),{instructions:kt,addressLookupTableAccounts:Hd}=await vd({compressed:d,settings:f,transactionMessageBytes:s,transactionBufferAddress:x,payer:e,additionalSigners:g,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:o}),tt=X=>({payer:e,instructions:X,addressesByLookupTableAddress:Hd});return [tt(me),...Pe.map(X=>tt([X])),...Ce.length?[tt(Ce.flat())]:[],tt(Re),tt(kt)]}var pr=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 mr=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 Nd({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=pr.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:D}=T;c.push({readonlyIndexes:f.readonlyIndexes,readableIndices:f.readonlyIndexes,writableIndexes:f.writableIndexes,writableIndices:f.writableIndexes,lookupTableAddress:gill.address(f.lookupTableAddress)}),i.writable.push(...D.writable),i.readonly.push(...D.readonly);}}let[o,d]=t.getMessageComponents(),g=new mr(d,i).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function S2({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=Nd({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return Ui(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 bd({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=Zs;exports.CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR=ao;exports.CHANGE_CONFIG_DISCRIMINATOR=ro;exports.COMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR=po;exports.CREATE_DOMAIN_CONFIG_DISCRIMINATOR=Eo;exports.CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR=vo;exports.CREATE_GLOBAL_COUNTER_DISCRIMINATOR=Wo;exports.CREATE_MULTI_WALLET_COMPRESSED_DISCRIMINATOR=ko;exports.CREATE_USER_ACCOUNTS_DISCRIMINATOR=Go;exports.DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR=jo;exports.DISABLE_DOMAIN_CONFIG_DISCRIMINATOR=Qo;exports.DOMAIN_CONFIG_DISCRIMINATOR=Vn;exports.EDIT_DOMAIN_CONFIG_DISCRIMINATOR=cc;exports.EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR=Ac;exports.EDIT_USER_DELEGATE_DISCRIMINATOR=lc;exports.GLOBAL_COUNTER_DISCRIMINATOR=jn;exports.KeyType=Lt;exports.MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR=Dc;exports.MIGRATE_COMPRESSED_USERS_DISCRIMINATOR=vc;exports.MULTI_WALLET_ERROR__ALREADY_DELEGATED=Rx;exports.MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH=ox;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED=jx;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING=qx;exports.MULTI_WALLET_ERROR__DUPLICATE_MEMBER=ix;exports.MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED=ax;exports.MULTI_WALLET_ERROR__EMPTY_MEMBERS=fx;exports.MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH=Tx;exports.MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH=cx;exports.MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH=px;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH=wx;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED=kx;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH=Nx;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION=_x;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION=vx;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION=bx;exports.MULTI_WALLET_ERROR__INVALID_ACCOUNT=Dx;exports.MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE=Xx;exports.MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG=lx;exports.MULTI_WALLET_ERROR__INVALID_ARGUMENTS=Ex;exports.MULTI_WALLET_ERROR__INVALID_BUFFER=Bx;exports.MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS=Ux;exports.MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS=Cx;exports.MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG=Ax;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION=QS;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY=rx;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG=$S;exports.MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS=tx;exports.MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT=Kx;exports.MULTI_WALLET_ERROR__INVALID_THRESHOLD=xx;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG=mx;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION=yx;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE=Ix;exports.MULTI_WALLET_ERROR__INVALID_USER_ROLE=Mx;exports.MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE=nx;exports.MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED=Fx;exports.MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG=Yx;exports.MULTI_WALLET_ERROR__MISSING_ACCOUNT=hx;exports.MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY=zx;exports.MULTI_WALLET_ERROR__MISSING_USER_ARGS=Px;exports.MULTI_WALLET_ERROR__NO_SIGNER_FOUND=Lx;exports.MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED=ux;exports.MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED=gx;exports.MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS=Zx;exports.MULTI_WALLET_ERROR__PERMANENT_MEMBER=dx;exports.MULTI_WALLET_ERROR__PROTECTED_ACCOUNT=Gx;exports.MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH=sx;exports.MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS=ex;exports.MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND=Jx;exports.MULTI_WALLET_ERROR__TOO_MANY_MEMBERS=Sx;exports.MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED=Hx;exports.MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED=Vx;exports.MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER=Ox;exports.MULTI_WALLET_ERROR__UNEXPECTED_SIGNER=Wx;exports.MULTI_WALLET_PROGRAM_ADDRESS=A;exports.MultiWalletAccount=YS;exports.MultiWalletInstruction=ZS;exports.NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=Nc;exports.NATIVE_TRANSFER_INTENT_DISCRIMINATOR=Lc;exports.Permission=xe;exports.Permissions=De;exports.SETTINGS_DISCRIMINATOR=bs;exports.Secp256r1Key=Me;exports.SignedSecp256r1Key=C;exports.TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=Zc;exports.TOKEN_TRANSFER_INTENT_DISCRIMINATOR=zc;exports.TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR=aa;exports.TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR=ta;exports.TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR=Sa;exports.TRANSACTION_BUFFER_CREATE_DISCRIMINATOR=ya;exports.TRANSACTION_BUFFER_DISCRIMINATOR=ws;exports.TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR=_a;exports.TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR=Ea;exports.TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR=Fa;exports.TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR=wa;exports.TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR=ti;exports.TRANSACTION_BUFFER_VOTE_DISCRIMINATOR=Ya;exports.TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR=yi;exports.TRANSACTION_EXECUTE_DISCRIMINATOR=ai;exports.TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR=Ei;exports.TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR=Si;exports.UserRole=Be;exports.WHITELISTED_ADDRESS_TREE_DISCRIMINATOR=Fs;exports.addWhitelistedAddressTrees=TB;exports.base64URLStringToBuffer=he;exports.bufferToBase64URLString=Ni;exports.changeConfig=QO;exports.closeTransactionBuffer=sN;exports.compressSettingsAccount=yB;exports.configAction=UD;exports.convertMemberKeyToString=Td;exports.convertPubkeyCompressedToCose=dL;exports.convertPubkeyCoseToCompressed=iL;exports.createClientAuthorizationCompleteRequestChallenge=yL;exports.createClientAuthorizationStartRequestChallenge=gL;exports.createDomainConfig=DB;exports.createDomainUserAccounts=WB;exports.createGlobalCounter=wB;exports.createMessageChallenge=pL;exports.createPopUp=Ke;exports.createTransactionBuffer=Ld;exports.createTransactionChallenge=mL;exports.createTransactionManagerSigner=pC;exports.createUserAccounts=zB;exports.createWallet=Qw;exports.decodeDomainConfig=Fn;exports.decodeGlobalCounter=Yn;exports.decodeSettings=Us;exports.decodeTransactionBuffer=Ns;exports.decodeWhitelistedAddressTree=Ks;exports.decompressSettingsAccount=dk;exports.disableDomainConfig=qB;exports.editDomainConfig=tw;exports.editTransactionManagerUrl=aw;exports.editUserDelegate=lw;exports.executeTransaction=vd;exports.executeTransactionBuffer=Od;exports.executeTransactionSync=bd;exports.extendTransactionBuffer=Bd;exports.fetchAllDomainConfig=jC;exports.fetchAllGlobalCounter=eD;exports.fetchAllMaybeDomainConfig=eu;exports.fetchAllMaybeGlobalCounter=Tu;exports.fetchAllMaybeSettings=Ey;exports.fetchAllMaybeTransactionBuffer=jy;exports.fetchAllMaybeWhitelistedAddressTree=yp;exports.fetchAllSettings=xh;exports.fetchAllTransactionBuffer=Ph;exports.fetchAllWhitelistedAddressTree=Uh;exports.fetchCompressedAccount=rd;exports.fetchDomainConfig=zn;exports.fetchGlobalCounter=QC;exports.fetchMaybeDomainConfig=Qd;exports.fetchMaybeGlobalCounter=mu;exports.fetchMaybeSettings=Yr;exports.fetchMaybeSettingsAccountData=ZI;exports.fetchMaybeTransactionBuffer=Jy;exports.fetchMaybeUserAccountData=YI;exports.fetchMaybeWhitelistedAddressTree=gp;exports.fetchSettings=Sh;exports.fetchSettingsAccountData=wt;exports.fetchTransactionBuffer=Hs;exports.fetchUserAccountData=ur;exports.fetchWhitelistedAddressTree=Js;exports.getAddMemberArgsCodec=oD;exports.getAddMemberArgsDecoder=lr;exports.getAddMemberArgsEncoder=Tr;exports.getAddWhitelistedAddressTreesDiscriminatorBytes=Yh;exports.getAddWhitelistedAddressTreesInstruction=Xh;exports.getAddWhitelistedAddressTreesInstructionAsync=$s;exports.getAddWhitelistedAddressTreesInstructionDataCodec=Zh;exports.getAddWhitelistedAddressTreesInstructionDataDecoder=Xs;exports.getAddWhitelistedAddressTreesInstructionDataEncoder=nn;exports.getAuthEndpoint=Je;exports.getChangeConfigCompressedDiscriminatorBytes=mP;exports.getChangeConfigCompressedInstruction=Ao;exports.getChangeConfigCompressedInstructionDataCodec=TP;exports.getChangeConfigCompressedInstructionDataDecoder=uo;exports.getChangeConfigCompressedInstructionDataEncoder=io;exports.getChangeConfigDiscriminatorBytes=oP;exports.getChangeConfigInstruction=aP;exports.getChangeConfigInstructionAsync=so;exports.getChangeConfigInstructionDataCodec=cP;exports.getChangeConfigInstructionDataDecoder=no;exports.getChangeConfigInstructionDataEncoder=sn;exports.getClientAndDeviceHash=En;exports.getCompiledInstructionCodec=iD;exports.getCompiledInstructionDecoder=Sr;exports.getCompiledInstructionEncoder=fr;exports.getCompressSettingsAccountDiscriminatorBytes=MP;exports.getCompressSettingsAccountInstruction=lo;exports.getCompressSettingsAccountInstructionDataCodec=EP;exports.getCompressSettingsAccountInstructionDataDecoder=To;exports.getCompressSettingsAccountInstructionDataEncoder=mo;exports.getCompressedAccountMetaCodec=gD;exports.getCompressedAccountMetaDecoder=ot;exports.getCompressedAccountMetaEncoder=st;exports.getCompressedAccountMetaReadOnlyCodec=TD;exports.getCompressedAccountMetaReadOnlyDecoder=dt;exports.getCompressedAccountMetaReadOnlyEncoder=it;exports.getCompressedProofCodec=SD;exports.getCompressedProofDecoder=Er;exports.getCompressedProofEncoder=Mr;exports.getCompressedSettingsAddressFromIndex=j;exports.getCompressedSettingsCodec=DD;exports.getCompressedSettingsDataCodec=PD;exports.getCompressedSettingsDataDecoder=gt;exports.getCompressedSettingsDataEncoder=At;exports.getCompressedSettingsDecoder=z;exports.getCompressedSettingsEncoder=ut;exports.getComputeBudgetEstimate=Qi;exports.getConfigActionCodec=_D;exports.getConfigActionDecoder=Tt;exports.getConfigActionEncoder=mt;exports.getCreateDomainConfigDiscriminatorBytes=WP;exports.getCreateDomainConfigInstruction=OP;exports.getCreateDomainConfigInstructionAsync=Po;exports.getCreateDomainConfigInstructionDataCodec=LP;exports.getCreateDomainConfigInstructionDataDecoder=ho;exports.getCreateDomainConfigInstructionDataEncoder=cn;exports.getCreateDomainUserAccountDiscriminatorBytes=FP;exports.getCreateDomainUserAccountInstruction=KP;exports.getCreateDomainUserAccountInstructionAsync=_o;exports.getCreateDomainUserAccountInstructionDataCodec=zP;exports.getCreateDomainUserAccountInstructionDataDecoder=bo;exports.getCreateDomainUserAccountInstructionDataEncoder=dn;exports.getCreateGlobalCounterDiscriminatorBytes=$P;exports.getCreateGlobalCounterInstruction=eR;exports.getCreateGlobalCounterInstructionAsync=Oo;exports.getCreateGlobalCounterInstructionDataCodec=QP;exports.getCreateGlobalCounterInstructionDataDecoder=Lo;exports.getCreateGlobalCounterInstructionDataEncoder=An;exports.getCreateMultiWalletCompressedDiscriminatorBytes=iR;exports.getCreateMultiWalletCompressedInstruction=uR;exports.getCreateMultiWalletCompressedInstructionAsync=Ho;exports.getCreateMultiWalletCompressedInstructionDataCodec=dR;exports.getCreateMultiWalletCompressedInstructionDataDecoder=No;exports.getCreateMultiWalletCompressedInstructionDataEncoder=gn;exports.getCreateUserAccountArgsCodec=wD;exports.getCreateUserAccountArgsDecoder=Wr;exports.getCreateUserAccountArgsEncoder=Ur;exports.getCreateUserAccountsDiscriminatorBytes=fR;exports.getCreateUserAccountsInstruction=xR;exports.getCreateUserAccountsInstructionAsync=zo;exports.getCreateUserAccountsInstructionDataCodec=SR;exports.getCreateUserAccountsInstructionDataDecoder=Fo;exports.getCreateUserAccountsInstructionDataEncoder=pn;exports.getDecompressSettingsAccountDiscriminatorBytes=RR;exports.getDecompressSettingsAccountInstruction=Zo;exports.getDecompressSettingsAccountInstructionDataCodec=vR;exports.getDecompressSettingsAccountInstructionDataDecoder=Yo;exports.getDecompressSettingsAccountInstructionDataEncoder=qo;exports.getDisableDomainConfigDiscriminatorBytes=BR;exports.getDisableDomainConfigInstruction=rc;exports.getDisableDomainConfigInstructionDataCodec=wR;exports.getDisableDomainConfigInstructionDataDecoder=tc;exports.getDisableDomainConfigInstructionDataEncoder=ec;exports.getDomainConfigAddress=je;exports.getDomainConfigCodec=JC;exports.getDomainConfigDecoder=Gn;exports.getDomainConfigDiscriminatorBytes=KC;exports.getDomainConfigEncoder=$d;exports.getDomainConfigSize=qC;exports.getEditDomainConfigDiscriminatorBytes=KR;exports.getEditDomainConfigInstruction=ic;exports.getEditDomainConfigInstructionAsync=jR;exports.getEditDomainConfigInstructionDataCodec=JR;exports.getEditDomainConfigInstructionDataDecoder=ac;exports.getEditDomainConfigInstructionDataEncoder=Tn;exports.getEditMemberArgsCodec=VD;exports.getEditMemberArgsDecoder=vr;exports.getEditMemberArgsEncoder=Rr;exports.getEditTransactionManagerUrlDiscriminatorBytes=tv;exports.getEditTransactionManagerUrlInstruction=pc;exports.getEditTransactionManagerUrlInstructionDataCodec=rv;exports.getEditTransactionManagerUrlInstructionDataDecoder=yc;exports.getEditTransactionManagerUrlInstructionDataEncoder=gc;exports.getEditUserDelegateDiscriminatorBytes=uv;exports.getEditUserDelegateInstruction=xc;exports.getEditUserDelegateInstructionDataCodec=Av;exports.getEditUserDelegateInstructionDataDecoder=Sc;exports.getEditUserDelegateInstructionDataEncoder=fc;exports.getExpectedSecp256r1SignersCodec=KD;exports.getExpectedSecp256r1SignersDecoder=ft;exports.getExpectedSecp256r1SignersEncoder=lt;exports.getFeePayer=WL;exports.getGlobalCounterAddress=gd;exports.getGlobalCounterCodec=$C;exports.getGlobalCounterDecoder=qn;exports.getGlobalCounterDiscriminatorBytes=XC;exports.getGlobalCounterEncoder=pu;exports.getGlobalCounterSize=tD;exports.getJitoTipsConfig=vn;exports.getLightCpiSigner=lO;exports.getLightProtocolRpc=Ne;exports.getLinkWalletArgsCodec=YD;exports.getLinkWalletArgsDecoder=Or;exports.getLinkWalletArgsEncoder=Lr;exports.getMemberCodec=QD;exports.getMemberDecoder=pt;exports.getMemberEncoder=yt;exports.getMemberKeyCodec=rM;exports.getMemberKeyDecoder=Q;exports.getMemberKeyEncoder=$;exports.getMigrateCompressedSettingsDiscriminatorBytes=Sv;exports.getMigrateCompressedSettingsInstruction=hc;exports.getMigrateCompressedSettingsInstructionDataCodec=xv;exports.getMigrateCompressedSettingsInstructionDataDecoder=Ec;exports.getMigrateCompressedSettingsInstructionDataEncoder=Mc;exports.getMigrateCompressedUsersDiscriminatorBytes=Rv;exports.getMigrateCompressedUsersInstruction=Uc;exports.getMigrateCompressedUsersInstructionDataCodec=vv;exports.getMigrateCompressedUsersInstructionDataDecoder=_c;exports.getMigrateCompressedUsersInstructionDataEncoder=bc;exports.getMultiWalletErrorMessage=IW;exports.getNativeTransferIntentCompressedDiscriminatorBytes=jv;exports.getNativeTransferIntentCompressedInstruction=Gc;exports.getNativeTransferIntentCompressedInstructionDataCodec=qv;exports.getNativeTransferIntentCompressedInstructionDataDecoder=Vc;exports.getNativeTransferIntentCompressedInstructionDataEncoder=Hc;exports.getNativeTransferIntentDiscriminatorBytes=wv;exports.getNativeTransferIntentInstruction=Bc;exports.getNativeTransferIntentInstructionAsync=Nv;exports.getNativeTransferIntentInstructionDataCodec=kv;exports.getNativeTransferIntentInstructionDataDecoder=Oc;exports.getNativeTransferIntentInstructionDataEncoder=ln;exports.getNewAuthorityArgsCodec=cM;exports.getNewAuthorityArgsDecoder=Nr;exports.getNewAuthorityArgsEncoder=kr;exports.getOnClientAuthorizationCallback=Xe;exports.getOriginIndex=AL;exports.getPackedAddressTreeInfoCodec=dM;exports.getPackedAddressTreeInfoDecoder=xt;exports.getPackedAddressTreeInfoEncoder=St;exports.getPackedStateTreeInfoCodec=gM;exports.getPackedStateTreeInfoDecoder=at;exports.getPackedStateTreeInfoEncoder=ct;exports.getPermissionsCodec=mM;exports.getPermissionsDecoder=be;exports.getPermissionsEncoder=ve;exports.getProofArgsCodec=SM;exports.getProofArgsDecoder=E;exports.getProofArgsEncoder=M;exports.getRemoveMemberArgsCodec=DM;exports.getRemoveMemberArgsDecoder=_r;exports.getRemoveMemberArgsEncoder=br;exports.getRpId=LL;exports.getSecp256r1MessageHash=hn;exports.getSecp256r1PubkeyCodec=hM;exports.getSecp256r1PubkeyDecoder=It;exports.getSecp256r1PubkeyEncoder=Hr;exports.getSecp256r1SignatureOffsetsDataDecoder=WC;exports.getSecp256r1SignatureOffsetsDataEncoder=UC;exports.getSecp256r1VerifyArgsCodec=vM;exports.getSecp256r1VerifyArgsDecoder=w;exports.getSecp256r1VerifyArgsEncoder=B;exports.getSecp256r1VerifyArgsWithDomainAddressCodec=WM;exports.getSecp256r1VerifyArgsWithDomainAddressDecoder=te;exports.getSecp256r1VerifyArgsWithDomainAddressEncoder=ee;exports.getSecp256r1VerifyInstruction=F;exports.getSecp256r1VerifyInstructionDataCodec=rB;exports.getSecp256r1VerifyInstructionDataDecoder=Cd;exports.getSecp256r1VerifyInstructionDataEncoder=Dd;exports.getSendAndConfirmTransaction=$i;exports.getSettingsCodec=fh;exports.getSettingsCreationArgsCodec=wM;exports.getSettingsCreationArgsDecoder=Dt;exports.getSettingsCreationArgsEncoder=Ct;exports.getSettingsDecoder=_s;exports.getSettingsDiscriminatorBytes=lh;exports.getSettingsEncoder=My;exports.getSettingsFromIndex=Z;exports.getSettingsIndexWithAddressCodec=HM;exports.getSettingsIndexWithAddressDecoder=Et;exports.getSettingsIndexWithAddressEncoder=Mt;exports.getSettingsMutArgsCodec=zM;exports.getSettingsMutArgsDecoder=ue;exports.getSettingsMutArgsEncoder=de;exports.getSettingsReadonlyArgsCodec=qM;exports.getSettingsReadonlyArgsDecoder=oe;exports.getSettingsReadonlyArgsEncoder=se;exports.getSettingsSize=Ih;exports.getSignedSecp256r1Key=uL;exports.getSignedTransactionManager=LO;exports.getSolanaRpc=re;exports.getSolanaRpcEndpoint=Ze;exports.getTokenTransferIntentCompressedDiscriminatorBytes=gb;exports.getTokenTransferIntentCompressedInstruction=$c;exports.getTokenTransferIntentCompressedInstructionAsync=pb;exports.getTokenTransferIntentCompressedInstructionDataCodec=yb;exports.getTokenTransferIntentCompressedInstructionDataDecoder=Xc;exports.getTokenTransferIntentCompressedInstructionDataEncoder=xn;exports.getTokenTransferIntentDiscriminatorBytes=rb;exports.getTokenTransferIntentInstruction=Jc;exports.getTokenTransferIntentInstructionAsync=sb;exports.getTokenTransferIntentInstructionDataCodec=nb;exports.getTokenTransferIntentInstructionDataDecoder=Kc;exports.getTokenTransferIntentInstructionDataEncoder=Sn;exports.getTransactionBufferAddress=yd;exports.getTransactionBufferCloseCompressedDiscriminatorBytes=_b;exports.getTransactionBufferCloseCompressedInstruction=ua;exports.getTransactionBufferCloseCompressedInstructionDataCodec=Ub;exports.getTransactionBufferCloseCompressedInstructionDataDecoder=da;exports.getTransactionBufferCloseCompressedInstructionDataEncoder=ia;exports.getTransactionBufferCloseDiscriminatorBytes=Cb;exports.getTransactionBufferCloseInstruction=sa;exports.getTransactionBufferCloseInstructionDataCodec=Db;exports.getTransactionBufferCloseInstructionDataDecoder=na;exports.getTransactionBufferCloseInstructionDataEncoder=ra;exports.getTransactionBufferCodec=hh;exports.getTransactionBufferCreateArgsCodec=$M;exports.getTransactionBufferCreateArgsDecoder=Pt;exports.getTransactionBufferCreateArgsEncoder=ht;exports.getTransactionBufferCreateCompressedDiscriminatorBytes=Yb;exports.getTransactionBufferCreateCompressedInstruction=Ca;exports.getTransactionBufferCreateCompressedInstructionDataCodec=Zb;exports.getTransactionBufferCreateCompressedInstructionDataDecoder=Ia;exports.getTransactionBufferCreateCompressedInstructionDataEncoder=xa;exports.getTransactionBufferCreateDiscriminatorBytes=Hb;exports.getTransactionBufferCreateInstruction=Ta;exports.getTransactionBufferCreateInstructionDataCodec=Vb;exports.getTransactionBufferCreateInstructionDataDecoder=ma;exports.getTransactionBufferCreateInstructionDataEncoder=pa;exports.getTransactionBufferDecoder=ks;exports.getTransactionBufferDiscriminatorBytes=Eh;exports.getTransactionBufferEncoder=Ky;exports.getTransactionBufferExecuteCompressedDiscriminatorBytes=y_;exports.getTransactionBufferExecuteCompressedInstruction=La;exports.getTransactionBufferExecuteCompressedInstructionDataCodec=p_;exports.getTransactionBufferExecuteCompressedInstructionDataDecoder=Wa;exports.getTransactionBufferExecuteCompressedInstructionDataEncoder=Ua;exports.getTransactionBufferExecuteDiscriminatorBytes=s_;exports.getTransactionBufferExecuteInstruction=Ra;exports.getTransactionBufferExecuteInstructionDataCodec=o_;exports.getTransactionBufferExecuteInstructionDataDecoder=Pa;exports.getTransactionBufferExecuteInstructionDataEncoder=ha;exports.getTransactionBufferExtendCompressedDiscriminatorBytes=v_;exports.getTransactionBufferExtendCompressedInstruction=Ja;exports.getTransactionBufferExtendCompressedInstructionDataCodec=b_;exports.getTransactionBufferExtendCompressedInstructionDataDecoder=Ka;exports.getTransactionBufferExtendCompressedInstructionDataEncoder=za;exports.getTransactionBufferExtendDiscriminatorBytes=I_;exports.getTransactionBufferExtendInstruction=Ha;exports.getTransactionBufferExtendInstructionDataCodec=C_;exports.getTransactionBufferExtendInstructionDataDecoder=Na;exports.getTransactionBufferExtendInstructionDataEncoder=ka;exports.getTransactionBufferVoteCompressedDiscriminatorBytes=j_;exports.getTransactionBufferVoteCompressedInstruction=si;exports.getTransactionBufferVoteCompressedInstructionDataCodec=q_;exports.getTransactionBufferVoteCompressedInstructionDataDecoder=ni;exports.getTransactionBufferVoteCompressedInstructionDataEncoder=ri;exports.getTransactionBufferVoteDiscriminatorBytes=k_;exports.getTransactionBufferVoteInstruction=$a;exports.getTransactionBufferVoteInstructionDataCodec=N_;exports.getTransactionBufferVoteInstructionDataDecoder=Xa;exports.getTransactionBufferVoteInstructionDataEncoder=Za;exports.getTransactionExecuteCompressedDiscriminatorBytes=dU;exports.getTransactionExecuteCompressedInstruction=Ti;exports.getTransactionExecuteCompressedInstructionDataCodec=uU;exports.getTransactionExecuteCompressedInstructionDataDecoder=mi;exports.getTransactionExecuteCompressedInstructionDataEncoder=pi;exports.getTransactionExecuteDiscriminatorBytes=tU;exports.getTransactionExecuteInstruction=ui;exports.getTransactionExecuteInstructionDataCodec=rU;exports.getTransactionExecuteInstructionDataDecoder=di;exports.getTransactionExecuteInstructionDataEncoder=ii;exports.getTransactionExecuteSyncCompressedDiscriminatorBytes=PU;exports.getTransactionExecuteSyncCompressedInstruction=Ri;exports.getTransactionExecuteSyncCompressedInstructionDataCodec=RU;exports.getTransactionExecuteSyncCompressedInstructionDataDecoder=Pi;exports.getTransactionExecuteSyncCompressedInstructionDataEncoder=hi;exports.getTransactionExecuteSyncDiscriminatorBytes=fU;exports.getTransactionExecuteSyncInstruction=Ci;exports.getTransactionExecuteSyncInstructionDataCodec=SU;exports.getTransactionExecuteSyncInstructionDataDecoder=Ii;exports.getTransactionExecuteSyncInstructionDataEncoder=xi;exports.getTransactionMessageAddressTableLookupCodec=oE;exports.getTransactionMessageAddressTableLookupDecoder=Gr;exports.getTransactionMessageAddressTableLookupEncoder=Vr;exports.getTransactionMessageCodec=rE;exports.getTransactionMessageDecoder=vt;exports.getTransactionMessageEncoder=Rt;exports.getUserAccountAddress=N;exports.getUserCodec=dE;exports.getUserCreationArgsCodec=yE;exports.getUserCreationArgsDecoder=pe;exports.getUserCreationArgsEncoder=ye;exports.getUserDecoder=J;exports.getUserEncoder=Oe;exports.getUserMutArgsCodec=lE;exports.getUserMutArgsDecoder=Se;exports.getUserMutArgsEncoder=fe;exports.getUserReadOnlyArgsCodec=IE;exports.getUserReadOnlyArgsDecoder=Jr;exports.getUserReadOnlyArgsEncoder=Kr;exports.getUserReadOnlyOrMutateArgsCodec=EE;exports.getUserReadOnlyOrMutateArgsDecoder=Ue;exports.getUserReadOnlyOrMutateArgsEncoder=_e;exports.getUserRoleCodec=bE;exports.getUserRoleDecoder=Le;exports.getUserRoleEncoder=We;exports.getWalletAddressFromIndex=pd;exports.getWalletAddressFromSettings=Ie;exports.getWhitelistedAddressTreeCodec=_h;exports.getWhitelistedAddressTreeDecoder=zs;exports.getWhitelistedAddressTreeDiscriminatorBytes=bh;exports.getWhitelistedAddressTreeEncoder=Ap;exports.getWhitelistedAddressTreeFromIndex=_n;exports.getWhitelistedAddressTreeIndexFromAddress=iO;exports.getWhitelistedAddressTreesAddress=nd;exports.identifyMultiWalletAccount=pW;exports.identifyMultiWalletInstruction=mW;exports.initialize=BL;exports.isConfigAction=WD;exports.isMultiWalletError=CW;exports.isUserReadOnlyOrMutateArgs=PE;exports.migrateSettings=Mw;exports.migrateUsers=_w;exports.nativeTransferIntent=wk;exports.parseAddWhitelistedAddressTreesInstruction=$h;exports.parseChangeConfigCompressedInstruction=lP;exports.parseChangeConfigInstruction=iP;exports.parseCompressSettingsAccountInstruction=hP;exports.parseCreateDomainConfigInstruction=BP;exports.parseCreateDomainUserAccountInstruction=JP;exports.parseCreateGlobalCounterInstruction=tR;exports.parseCreateMultiWalletCompressedInstruction=AR;exports.parseCreateUserAccountsInstruction=IR;exports.parseDecompressSettingsAccountInstruction=bR;exports.parseDisableDomainConfigInstruction=kR;exports.parseEditDomainConfigInstruction=qR;exports.parseEditTransactionManagerUrlInstruction=nv;exports.parseEditUserDelegateInstruction=gv;exports.parseMigrateCompressedSettingsInstruction=Iv;exports.parseMigrateCompressedUsersInstruction=bv;exports.parseNativeTransferIntentCompressedInstruction=Yv;exports.parseNativeTransferIntentInstruction=Hv;exports.parseSecp256r1VerifyInstruction=nB;exports.parseTokenTransferIntentCompressedInstruction=mb;exports.parseTokenTransferIntentInstruction=ob;exports.parseTransactionBufferCloseCompressedInstruction=Wb;exports.parseTransactionBufferCloseInstruction=Mb;exports.parseTransactionBufferCreateCompressedInstruction=Xb;exports.parseTransactionBufferCreateInstruction=Gb;exports.parseTransactionBufferExecuteCompressedInstruction=m_;exports.parseTransactionBufferExecuteInstruction=c_;exports.parseTransactionBufferExtendCompressedInstruction=__;exports.parseTransactionBufferExtendInstruction=D_;exports.parseTransactionBufferVoteCompressedInstruction=Y_;exports.parseTransactionBufferVoteInstruction=H_;exports.parseTransactionExecuteCompressedInstruction=AU;exports.parseTransactionExecuteInstruction=nU;exports.parseTransactionExecuteSyncCompressedInstruction=vU;exports.parseTransactionExecuteSyncInstruction=xU;exports.pollJitoBundleConfirmation=UO;exports.prepareTransactionBundle=c2;exports.prepareTransactionMessage=S2;exports.prepareTransactionSync=M2;exports.retrieveTransactionManager=WO;exports.sendJitoBundle=yC;exports.signAndSendBundledTransactions=bO;exports.signAndSendTransaction=_O;exports.signMessageWithPasskey=FN;exports.signTransactionWithPasskey=YN;exports.tokenTransferIntent=jk;exports.uninitialize=OL;exports.userReadOnlyOrMutateArgs=hE;exports.vaultTransactionMessageDeserialize=Wi;exports.vaultTransactionMessageSerialize=Ui;exports.voteTransactionBuffer=wd;//# sourceMappingURL=index.cjs.map
|
|
3
3
|
//# sourceMappingURL=index.cjs.map
|