/** * 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, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, getU8Decoder, getU8Encoder, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, } from '@solana/kit'; import { getCargoIdDecoder, getCargoIdEncoder, type CargoId, type CargoIdArgs, } from '.'; export type LiveOffer = { cargoId: CargoId; /** Same bitmask as `PoolOfferEntry::side_flags` (`SIDE_SELL` / `SIDE_BUY`). */ sideFlags: number; /** Concrete price drawn within the envelope band at reveal (Atlas/Floyds per unit). */ price: bigint; /** Remaining quantity; decremented per fill, capped by treasury stock + player cargo at trade time. */ remainingQty: bigint; }; export type LiveOfferArgs = { cargoId: CargoIdArgs; /** Same bitmask as `PoolOfferEntry::side_flags` (`SIDE_SELL` / `SIDE_BUY`). */ sideFlags: number; /** Concrete price drawn within the envelope band at reveal (Atlas/Floyds per unit). */ price: number | bigint; /** Remaining quantity; decremented per fill, capped by treasury stock + player cargo at trade time. */ remainingQty: number | bigint; }; export function getLiveOfferEncoder(): FixedSizeEncoder { return getStructEncoder([ ['cargoId', getCargoIdEncoder()], ['sideFlags', getU8Encoder()], ['price', getU64Encoder()], ['remainingQty', getU64Encoder()], ]); } export function getLiveOfferDecoder(): FixedSizeDecoder { return getStructDecoder([ ['cargoId', getCargoIdDecoder()], ['sideFlags', getU8Decoder()], ['price', getU64Decoder()], ['remainingQty', getU64Decoder()], ]); } export function getLiveOfferCodec(): FixedSizeCodec { return combineCodec(getLiveOfferEncoder(), getLiveOfferDecoder()); }