/** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ import { combineCodec, fixDecoderSize, fixEncoderSize, getAddressEncoder, getBooleanDecoder, getBooleanEncoder, getBytesDecoder, getBytesEncoder, getProgramDerivedAddress, getStructDecoder, getStructEncoder, getU16Decoder, getU16Encoder, getU64Decoder, getU64Encoder, SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, SolanaError, transformEncoder, type AccountMeta, type AccountSignerMeta, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyAccount, type ReadonlySignerAccount, type ReadonlyUint8Array, type TransactionSigner, type WritableAccount, } from '@solana/kit'; import { getAccountMetaFactory, getAddressFromResolvedInstructionAccount, type ResolvedInstructionAccount, } from '@solana/program-client-core'; import { SAGE_PROGRAM_ADDRESS } from '../programs'; export const TRADE_FACTION_MARKET_DISCRIMINATOR = new Uint8Array([ 8, 232, 172, 52, 120, 54, 150, 30, ]); export function getTradeFactionMarketDiscriminatorBytes() { return fixEncoderSize(getBytesEncoder(), 8).encode( TRADE_FACTION_MARKET_DISCRIMINATOR, ); } export type TradeFactionMarketInstruction< TProgram extends string = typeof SAGE_PROGRAM_ADDRESS, TAccountProfileSigner extends string | AccountMeta = string, TAccountProfileProfile extends string | AccountMeta = string, TAccountProfileCertificate extends string | AccountMeta = string, TAccountProfileProgram extends string | AccountMeta = 'C4PRoFNroxxzdgeCoM31LJjYRg7kT6ymogSTAT99iD1u', TAccountCharacter extends string | AccountMeta = string, TAccountGame extends string | AccountMeta = string, TAccountSystem extends string | AccountMeta = string, TAccountStarbasePlayer extends string | AccountMeta = string, TAccountFleet extends string | AccountMeta = string, TAccountFactionMarket extends string | AccountMeta = string, TAccountTreasury extends string | AccountMeta = string, TAccountSystemProgram extends string | AccountMeta = '11111111111111111111111111111111', TAccountFactionStanding extends string | AccountMeta = string, TAccountFactionConfig extends string | AccountMeta = string, TAccountFactionEpochMeter extends string | AccountMeta = string, TRemainingAccounts extends readonly AccountMeta[] = [], > = Instruction & InstructionWithData & InstructionWithAccounts< [ TAccountProfileSigner extends string ? ReadonlySignerAccount & AccountSignerMeta : TAccountProfileSigner, TAccountProfileProfile extends string ? WritableAccount : TAccountProfileProfile, TAccountProfileCertificate extends string ? ReadonlyAccount : TAccountProfileCertificate, TAccountProfileProgram extends string ? ReadonlyAccount : TAccountProfileProgram, TAccountCharacter extends string ? WritableAccount : TAccountCharacter, TAccountGame extends string ? ReadonlyAccount : TAccountGame, TAccountSystem extends string ? ReadonlyAccount : TAccountSystem, TAccountStarbasePlayer extends string ? WritableAccount : TAccountStarbasePlayer, TAccountFleet extends string ? WritableAccount : TAccountFleet, TAccountFactionMarket extends string ? WritableAccount : TAccountFactionMarket, TAccountTreasury extends string ? WritableAccount : TAccountTreasury, TAccountSystemProgram extends string ? ReadonlyAccount : TAccountSystemProgram, TAccountFactionStanding extends string ? WritableAccount : TAccountFactionStanding, TAccountFactionConfig extends string ? ReadonlyAccount : TAccountFactionConfig, TAccountFactionEpochMeter extends string ? WritableAccount : TAccountFactionEpochMeter, ...TRemainingAccounts, ] >; export type TradeFactionMarketInstructionData = { discriminator: ReadonlyUint8Array; /** Index into the signer profile's key set (proves `MANAGE_LOCAL_MARKET_ORDERS` over the character/fleet). */ keyIndex: number; /** Which `LiveOffer` of the market to fill. */ offerIndex: number; /** * Requested units. Bounded by the offer's remaining qty, then capped by sellable stock (buy) or * holdings (sell). */ quantity: bigint; /** `true` = player buys from the faction (Ask leg); `false` = player sells to the faction (Bid/faucet). */ playerBuys: boolean; }; export type TradeFactionMarketInstructionDataArgs = { /** Index into the signer profile's key set (proves `MANAGE_LOCAL_MARKET_ORDERS` over the character/fleet). */ keyIndex: number; /** Which `LiveOffer` of the market to fill. */ offerIndex: number; /** * Requested units. Bounded by the offer's remaining qty, then capped by sellable stock (buy) or * holdings (sell). */ quantity: number | bigint; /** `true` = player buys from the faction (Ask leg); `false` = player sells to the faction (Bid/faucet). */ playerBuys: boolean; }; export function getTradeFactionMarketInstructionDataEncoder(): FixedSizeEncoder { return transformEncoder( getStructEncoder([ ['discriminator', fixEncoderSize(getBytesEncoder(), 8)], ['keyIndex', getU16Encoder()], ['offerIndex', getU16Encoder()], ['quantity', getU64Encoder()], ['playerBuys', getBooleanEncoder()], ]), (value) => ({ ...value, discriminator: TRADE_FACTION_MARKET_DISCRIMINATOR, }), ); } export function getTradeFactionMarketInstructionDataDecoder(): FixedSizeDecoder { return getStructDecoder([ ['discriminator', fixDecoderSize(getBytesDecoder(), 8)], ['keyIndex', getU16Decoder()], ['offerIndex', getU16Decoder()], ['quantity', getU64Decoder()], ['playerBuys', getBooleanDecoder()], ]); } export function getTradeFactionMarketInstructionDataCodec(): FixedSizeCodec< TradeFactionMarketInstructionDataArgs, TradeFactionMarketInstructionData > { return combineCodec( getTradeFactionMarketInstructionDataEncoder(), getTradeFactionMarketInstructionDataDecoder(), ); } export type TradeFactionMarketAsyncInput< TAccountProfileSigner extends string = string, TAccountProfileProfile extends string = string, TAccountProfileCertificate extends string = string, TAccountProfileProgram extends string = string, TAccountCharacter extends string = string, TAccountGame extends string = string, TAccountSystem extends string = string, TAccountStarbasePlayer extends string = string, TAccountFleet extends string = string, TAccountFactionMarket extends string = string, TAccountTreasury extends string = string, TAccountSystemProgram extends string = string, TAccountFactionStanding extends string = string, TAccountFactionConfig extends string = string, TAccountFactionEpochMeter extends string = string, > = { profileSigner: TransactionSigner; profileProfile: Address; profileCertificate?: Address; profileProgram?: Address; character?: Address; game: Address; /** The anchoring star system; must contain a starbase (supplies the dock `seq_id` + the market's 3rd seed). */ system: Address; /** * The DOCK gate — the player must have an undestroyed docked presence at this starbase (matches * `ManageLocalMarketOrder`, NOT the encounter's fleet-idle-at-sector check). */ starbasePlayer?: Address; /** The trading fleet — crew normalized at validation; cargo is delivered to / taken from its hold. */ fleet: Address; /** * The faction market (game-scoped; PDA + starbase binding re-checked in the handler). Offer qtys * decrement here; the in-trade restock rewrites the list in place (same count, no realloc). */ factionMarket: Address; /** * The faction's one treasury (PDA re-derived from the market's `faction_id`). All value moves here; a * Bid that supplies a not-yet-stocked cargo reallocs its `reserves` map (hence `NormalizeRent`, as in * `FundFactionTreasuryCargo`). */ treasury: Address; systemProgram?: Address; /** * The signer's `(game, profile, faction)` standing PDA (created via `InitFactionStanding`); read for the * access band, credited on the SELL leg. */ factionStanding?: Address; /** Per-game reputation dials (`[FactionConfig, game]`): the decay/DR/aggregate-cap bundle. */ factionConfig?: Address; /** Per-faction aggregate emission meter (`[FactionEpochMeter, game, faction]`): the anti-sybil cap. */ factionEpochMeter?: Address; keyIndex: TradeFactionMarketInstructionDataArgs['keyIndex']; offerIndex: TradeFactionMarketInstructionDataArgs['offerIndex']; quantity: TradeFactionMarketInstructionDataArgs['quantity']; playerBuys: TradeFactionMarketInstructionDataArgs['playerBuys']; }; export async function getTradeFactionMarketInstructionAsync< TAccountProfileSigner extends string, TAccountProfileProfile extends string, TAccountProfileCertificate extends string, TAccountProfileProgram extends string, TAccountCharacter extends string, TAccountGame extends string, TAccountSystem extends string, TAccountStarbasePlayer extends string, TAccountFleet extends string, TAccountFactionMarket extends string, TAccountTreasury extends string, TAccountSystemProgram extends string, TAccountFactionStanding extends string, TAccountFactionConfig extends string, TAccountFactionEpochMeter extends string, TProgramAddress extends Address = typeof SAGE_PROGRAM_ADDRESS, >( input: TradeFactionMarketAsyncInput< TAccountProfileSigner, TAccountProfileProfile, TAccountProfileCertificate, TAccountProfileProgram, TAccountCharacter, TAccountGame, TAccountSystem, TAccountStarbasePlayer, TAccountFleet, TAccountFactionMarket, TAccountTreasury, TAccountSystemProgram, TAccountFactionStanding, TAccountFactionConfig, TAccountFactionEpochMeter >, config?: { programAddress?: TProgramAddress }, ): Promise< TradeFactionMarketInstruction< TProgramAddress, TAccountProfileSigner, TAccountProfileProfile, TAccountProfileCertificate, TAccountProfileProgram, TAccountCharacter, TAccountGame, TAccountSystem, TAccountStarbasePlayer, TAccountFleet, TAccountFactionMarket, TAccountTreasury, TAccountSystemProgram, TAccountFactionStanding, TAccountFactionConfig, TAccountFactionEpochMeter > > { // Program address. const programAddress = config?.programAddress ?? SAGE_PROGRAM_ADDRESS; // Original accounts. const originalAccounts = { profileSigner: { value: input.profileSigner ?? null, isWritable: false }, profileProfile: { value: input.profileProfile ?? null, isWritable: true }, profileCertificate: { value: input.profileCertificate ?? null, isWritable: false, }, profileProgram: { value: input.profileProgram ?? null, isWritable: false }, character: { value: input.character ?? null, isWritable: true }, game: { value: input.game ?? null, isWritable: false }, system: { value: input.system ?? null, isWritable: false }, starbasePlayer: { value: input.starbasePlayer ?? null, isWritable: true }, fleet: { value: input.fleet ?? null, isWritable: true }, factionMarket: { value: input.factionMarket ?? null, isWritable: true }, treasury: { value: input.treasury ?? null, isWritable: true }, systemProgram: { value: input.systemProgram ?? null, isWritable: false }, factionStanding: { value: input.factionStanding ?? null, isWritable: true }, factionConfig: { value: input.factionConfig ?? null, isWritable: false }, factionEpochMeter: { value: input.factionEpochMeter ?? null, isWritable: true, }, }; const accounts = originalAccounts as Record< keyof typeof originalAccounts, ResolvedInstructionAccount >; // Original args. const args = { ...input }; // Resolve default values. if (!accounts.profileProgram.value) { accounts.profileProgram.value = 'C4PRoFNroxxzdgeCoM31LJjYRg7kT6ymogSTAT99iD1u' as Address<'C4PRoFNroxxzdgeCoM31LJjYRg7kT6ymogSTAT99iD1u'>; } if (!accounts.character.value) { accounts.character.value = await getProgramDerivedAddress({ programAddress, seeds: [ getBytesEncoder().encode( new Uint8Array([67, 104, 97, 114, 97, 99, 116, 101, 114]), ), getAddressEncoder().encode( getAddressFromResolvedInstructionAccount( 'profileProfile', accounts.profileProfile.value, ), ), getAddressEncoder().encode( getAddressFromResolvedInstructionAccount('game', accounts.game.value), ), ], }); } if (!accounts.starbasePlayer.value) { accounts.starbasePlayer.value = await getProgramDerivedAddress({ programAddress, seeds: [ getBytesEncoder().encode( new Uint8Array([ 83, 116, 97, 114, 98, 97, 115, 101, 80, 108, 97, 121, 101, 114, ]), ), getAddressEncoder().encode( getAddressFromResolvedInstructionAccount( 'system', accounts.system.value, ), ), getAddressEncoder().encode( getAddressFromResolvedInstructionAccount( 'character', accounts.character.value, ), ), ], }); } if (!accounts.systemProgram.value) { accounts.systemProgram.value = '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>; } const getAccountMeta = getAccountMetaFactory(programAddress, 'programId'); return Object.freeze({ accounts: [ getAccountMeta('profileSigner', accounts.profileSigner), getAccountMeta('profileProfile', accounts.profileProfile), getAccountMeta('profileCertificate', accounts.profileCertificate), getAccountMeta('profileProgram', accounts.profileProgram), getAccountMeta('character', accounts.character), getAccountMeta('game', accounts.game), getAccountMeta('system', accounts.system), getAccountMeta('starbasePlayer', accounts.starbasePlayer), getAccountMeta('fleet', accounts.fleet), getAccountMeta('factionMarket', accounts.factionMarket), getAccountMeta('treasury', accounts.treasury), getAccountMeta('systemProgram', accounts.systemProgram), getAccountMeta('factionStanding', accounts.factionStanding), getAccountMeta('factionConfig', accounts.factionConfig), getAccountMeta('factionEpochMeter', accounts.factionEpochMeter), ], data: getTradeFactionMarketInstructionDataEncoder().encode( args as TradeFactionMarketInstructionDataArgs, ), programAddress, } as TradeFactionMarketInstruction< TProgramAddress, TAccountProfileSigner, TAccountProfileProfile, TAccountProfileCertificate, TAccountProfileProgram, TAccountCharacter, TAccountGame, TAccountSystem, TAccountStarbasePlayer, TAccountFleet, TAccountFactionMarket, TAccountTreasury, TAccountSystemProgram, TAccountFactionStanding, TAccountFactionConfig, TAccountFactionEpochMeter >); } export type TradeFactionMarketInput< TAccountProfileSigner extends string = string, TAccountProfileProfile extends string = string, TAccountProfileCertificate extends string = string, TAccountProfileProgram extends string = string, TAccountCharacter extends string = string, TAccountGame extends string = string, TAccountSystem extends string = string, TAccountStarbasePlayer extends string = string, TAccountFleet extends string = string, TAccountFactionMarket extends string = string, TAccountTreasury extends string = string, TAccountSystemProgram extends string = string, TAccountFactionStanding extends string = string, TAccountFactionConfig extends string = string, TAccountFactionEpochMeter extends string = string, > = { profileSigner: TransactionSigner; profileProfile: Address; profileCertificate?: Address; profileProgram?: Address; character: Address; game: Address; /** The anchoring star system; must contain a starbase (supplies the dock `seq_id` + the market's 3rd seed). */ system: Address; /** * The DOCK gate — the player must have an undestroyed docked presence at this starbase (matches * `ManageLocalMarketOrder`, NOT the encounter's fleet-idle-at-sector check). */ starbasePlayer: Address; /** The trading fleet — crew normalized at validation; cargo is delivered to / taken from its hold. */ fleet: Address; /** * The faction market (game-scoped; PDA + starbase binding re-checked in the handler). Offer qtys * decrement here; the in-trade restock rewrites the list in place (same count, no realloc). */ factionMarket: Address; /** * The faction's one treasury (PDA re-derived from the market's `faction_id`). All value moves here; a * Bid that supplies a not-yet-stocked cargo reallocs its `reserves` map (hence `NormalizeRent`, as in * `FundFactionTreasuryCargo`). */ treasury: Address; systemProgram?: Address; /** * The signer's `(game, profile, faction)` standing PDA (created via `InitFactionStanding`); read for the * access band, credited on the SELL leg. */ factionStanding?: Address; /** Per-game reputation dials (`[FactionConfig, game]`): the decay/DR/aggregate-cap bundle. */ factionConfig?: Address; /** Per-faction aggregate emission meter (`[FactionEpochMeter, game, faction]`): the anti-sybil cap. */ factionEpochMeter?: Address; keyIndex: TradeFactionMarketInstructionDataArgs['keyIndex']; offerIndex: TradeFactionMarketInstructionDataArgs['offerIndex']; quantity: TradeFactionMarketInstructionDataArgs['quantity']; playerBuys: TradeFactionMarketInstructionDataArgs['playerBuys']; }; export function getTradeFactionMarketInstruction< TAccountProfileSigner extends string, TAccountProfileProfile extends string, TAccountProfileCertificate extends string, TAccountProfileProgram extends string, TAccountCharacter extends string, TAccountGame extends string, TAccountSystem extends string, TAccountStarbasePlayer extends string, TAccountFleet extends string, TAccountFactionMarket extends string, TAccountTreasury extends string, TAccountSystemProgram extends string, TAccountFactionStanding extends string, TAccountFactionConfig extends string, TAccountFactionEpochMeter extends string, TProgramAddress extends Address = typeof SAGE_PROGRAM_ADDRESS, >( input: TradeFactionMarketInput< TAccountProfileSigner, TAccountProfileProfile, TAccountProfileCertificate, TAccountProfileProgram, TAccountCharacter, TAccountGame, TAccountSystem, TAccountStarbasePlayer, TAccountFleet, TAccountFactionMarket, TAccountTreasury, TAccountSystemProgram, TAccountFactionStanding, TAccountFactionConfig, TAccountFactionEpochMeter >, config?: { programAddress?: TProgramAddress }, ): TradeFactionMarketInstruction< TProgramAddress, TAccountProfileSigner, TAccountProfileProfile, TAccountProfileCertificate, TAccountProfileProgram, TAccountCharacter, TAccountGame, TAccountSystem, TAccountStarbasePlayer, TAccountFleet, TAccountFactionMarket, TAccountTreasury, TAccountSystemProgram, TAccountFactionStanding, TAccountFactionConfig, TAccountFactionEpochMeter > { // Program address. const programAddress = config?.programAddress ?? SAGE_PROGRAM_ADDRESS; // Original accounts. const originalAccounts = { profileSigner: { value: input.profileSigner ?? null, isWritable: false }, profileProfile: { value: input.profileProfile ?? null, isWritable: true }, profileCertificate: { value: input.profileCertificate ?? null, isWritable: false, }, profileProgram: { value: input.profileProgram ?? null, isWritable: false }, character: { value: input.character ?? null, isWritable: true }, game: { value: input.game ?? null, isWritable: false }, system: { value: input.system ?? null, isWritable: false }, starbasePlayer: { value: input.starbasePlayer ?? null, isWritable: true }, fleet: { value: input.fleet ?? null, isWritable: true }, factionMarket: { value: input.factionMarket ?? null, isWritable: true }, treasury: { value: input.treasury ?? null, isWritable: true }, systemProgram: { value: input.systemProgram ?? null, isWritable: false }, factionStanding: { value: input.factionStanding ?? null, isWritable: true }, factionConfig: { value: input.factionConfig ?? null, isWritable: false }, factionEpochMeter: { value: input.factionEpochMeter ?? null, isWritable: true, }, }; const accounts = originalAccounts as Record< keyof typeof originalAccounts, ResolvedInstructionAccount >; // Original args. const args = { ...input }; // Resolve default values. if (!accounts.profileProgram.value) { accounts.profileProgram.value = 'C4PRoFNroxxzdgeCoM31LJjYRg7kT6ymogSTAT99iD1u' as Address<'C4PRoFNroxxzdgeCoM31LJjYRg7kT6ymogSTAT99iD1u'>; } if (!accounts.systemProgram.value) { accounts.systemProgram.value = '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>; } const getAccountMeta = getAccountMetaFactory(programAddress, 'programId'); return Object.freeze({ accounts: [ getAccountMeta('profileSigner', accounts.profileSigner), getAccountMeta('profileProfile', accounts.profileProfile), getAccountMeta('profileCertificate', accounts.profileCertificate), getAccountMeta('profileProgram', accounts.profileProgram), getAccountMeta('character', accounts.character), getAccountMeta('game', accounts.game), getAccountMeta('system', accounts.system), getAccountMeta('starbasePlayer', accounts.starbasePlayer), getAccountMeta('fleet', accounts.fleet), getAccountMeta('factionMarket', accounts.factionMarket), getAccountMeta('treasury', accounts.treasury), getAccountMeta('systemProgram', accounts.systemProgram), getAccountMeta('factionStanding', accounts.factionStanding), getAccountMeta('factionConfig', accounts.factionConfig), getAccountMeta('factionEpochMeter', accounts.factionEpochMeter), ], data: getTradeFactionMarketInstructionDataEncoder().encode( args as TradeFactionMarketInstructionDataArgs, ), programAddress, } as TradeFactionMarketInstruction< TProgramAddress, TAccountProfileSigner, TAccountProfileProfile, TAccountProfileCertificate, TAccountProfileProgram, TAccountCharacter, TAccountGame, TAccountSystem, TAccountStarbasePlayer, TAccountFleet, TAccountFactionMarket, TAccountTreasury, TAccountSystemProgram, TAccountFactionStanding, TAccountFactionConfig, TAccountFactionEpochMeter >); } export type ParsedTradeFactionMarketInstruction< TProgram extends string = typeof SAGE_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[], > = { programAddress: Address; accounts: { profileSigner: TAccountMetas[0]; profileProfile: TAccountMetas[1]; profileCertificate?: TAccountMetas[2] | undefined; profileProgram: TAccountMetas[3]; character: TAccountMetas[4]; game: TAccountMetas[5]; /** The anchoring star system; must contain a starbase (supplies the dock `seq_id` + the market's 3rd seed). */ system: TAccountMetas[6]; /** * The DOCK gate — the player must have an undestroyed docked presence at this starbase (matches * `ManageLocalMarketOrder`, NOT the encounter's fleet-idle-at-sector check). */ starbasePlayer: TAccountMetas[7]; /** The trading fleet — crew normalized at validation; cargo is delivered to / taken from its hold. */ fleet: TAccountMetas[8]; /** * The faction market (game-scoped; PDA + starbase binding re-checked in the handler). Offer qtys * decrement here; the in-trade restock rewrites the list in place (same count, no realloc). */ factionMarket: TAccountMetas[9]; /** * The faction's one treasury (PDA re-derived from the market's `faction_id`). All value moves here; a * Bid that supplies a not-yet-stocked cargo reallocs its `reserves` map (hence `NormalizeRent`, as in * `FundFactionTreasuryCargo`). */ treasury: TAccountMetas[10]; systemProgram: TAccountMetas[11]; /** * The signer's `(game, profile, faction)` standing PDA (created via `InitFactionStanding`); read for the * access band, credited on the SELL leg. */ factionStanding?: TAccountMetas[12] | undefined; /** Per-game reputation dials (`[FactionConfig, game]`): the decay/DR/aggregate-cap bundle. */ factionConfig?: TAccountMetas[13] | undefined; /** Per-faction aggregate emission meter (`[FactionEpochMeter, game, faction]`): the anti-sybil cap. */ factionEpochMeter?: TAccountMetas[14] | undefined; }; data: TradeFactionMarketInstructionData; }; export function parseTradeFactionMarketInstruction< TProgram extends string, TAccountMetas extends readonly AccountMeta[], >( instruction: Instruction & InstructionWithAccounts & InstructionWithData, ): ParsedTradeFactionMarketInstruction { if (instruction.accounts.length < 15) { throw new SolanaError( SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, { actualAccountMetas: instruction.accounts.length, expectedAccountMetas: 15, }, ); } let accountIndex = 0; const getNextAccount = () => { const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!; accountIndex += 1; return accountMeta; }; const getNextOptionalAccount = () => { const accountMeta = getNextAccount(); return accountMeta.address === SAGE_PROGRAM_ADDRESS ? undefined : accountMeta; }; return { programAddress: instruction.programAddress, accounts: { profileSigner: getNextAccount(), profileProfile: getNextAccount(), profileCertificate: getNextOptionalAccount(), profileProgram: getNextAccount(), character: getNextAccount(), game: getNextAccount(), system: getNextAccount(), starbasePlayer: getNextAccount(), fleet: getNextAccount(), factionMarket: getNextAccount(), treasury: getNextAccount(), systemProgram: getNextAccount(), factionStanding: getNextOptionalAccount(), factionConfig: getNextOptionalAccount(), factionEpochMeter: getNextOptionalAccount(), }, data: getTradeFactionMarketInstructionDataDecoder().decode( instruction.data, ), }; }