/** * 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, getAddressDecoder, getAddressEncoder, getI64Decoder, getI64Encoder, getMapDecoder, getMapEncoder, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, type Address, type Codec, type Decoder, type Encoder, } from '@solana/kit'; import { getCargoIdDecoder, getCargoIdEncoder, type CargoId, type CargoIdArgs, } from '.'; export type ClaimStakeTransfer = { /** The `Planet` the `Fleet` on which the claim stake is located */ planet: Address; /** The claim stake that the fleet is loading and/or unloading */ claimStake: Address; /** The time at which the transfer ends */ end: bigint; /** Cargo moving from claim_stake to fleet */ load: Map; /** Cargo moving from fleet to claim_stake */ unload: Map; }; export type ClaimStakeTransferArgs = { /** The `Planet` the `Fleet` on which the claim stake is located */ planet: Address; /** The claim stake that the fleet is loading and/or unloading */ claimStake: Address; /** The time at which the transfer ends */ end: number | bigint; /** Cargo moving from claim_stake to fleet */ load: Map; /** Cargo moving from fleet to claim_stake */ unload: Map; }; export function getClaimStakeTransferEncoder(): Encoder { return getStructEncoder([ ['planet', getAddressEncoder()], ['claimStake', getAddressEncoder()], ['end', getI64Encoder()], ['load', getMapEncoder(getCargoIdEncoder(), getU64Encoder())], ['unload', getMapEncoder(getCargoIdEncoder(), getU64Encoder())], ]); } export function getClaimStakeTransferDecoder(): Decoder { return getStructDecoder([ ['planet', getAddressDecoder()], ['claimStake', getAddressDecoder()], ['end', getI64Decoder()], ['load', getMapDecoder(getCargoIdDecoder(), getU64Decoder())], ['unload', getMapDecoder(getCargoIdDecoder(), getU64Decoder())], ]); } export function getClaimStakeTransferCodec(): Codec< ClaimStakeTransferArgs, ClaimStakeTransfer > { return combineCodec( getClaimStakeTransferEncoder(), getClaimStakeTransferDecoder(), ); }