/** * 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, getArrayDecoder, getArrayEncoder, getStructDecoder, getStructEncoder, getU16Decoder, getU16Encoder, getU8Decoder, getU8Encoder, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, } from '@solana/kit'; /** * One crew to individuate: its DAS-attested rarity + the rarity-derived base-stat seed. * * `BorshSerialize/Deserialize + TypeToIdl` — the EXACT derive set of the existing * `CrewTransferInput` (crew_transfer_common_rs:129-134), so this rides the same client/IDL * surface. (In the full instruction the migrate item would also carry the Bubblegum * transfer proof fields of `CrewTransferInput`; this slice models the crew-record half — * the rarity attestation that seeds the on-chain `CrewRecord`. The integrator unions this * with `CrewTransferInput`'s proof fields.) */ export type CrewMigrateInput = { /** The crew cNFT asset id (Bubblegum leaf) — the stable per-crew identity (master R-S1). */ crewAssetId: Array; /** DAS-attested rarity discriminant (`0..=5`); decoded via `Rarity::from_u8`. */ rarity: number; /** * Rarity-derived base aptitude magnitude seeding every aptitude (reference-impl * `rarity_base_stat`, record_rs:398-407). Supplied (not recomputed) so the rarity→seed * ladder stays owned by the contract slice (single source of truth). */ baseStat: number; }; export type CrewMigrateInputArgs = CrewMigrateInput; export function getCrewMigrateInputEncoder(): FixedSizeEncoder { return getStructEncoder([ ['crewAssetId', getArrayEncoder(getU8Encoder(), { size: 32 })], ['rarity', getU8Encoder()], ['baseStat', getU16Encoder()], ]); } export function getCrewMigrateInputDecoder(): FixedSizeDecoder { return getStructDecoder([ ['crewAssetId', getArrayDecoder(getU8Decoder(), { size: 32 })], ['rarity', getU8Decoder()], ['baseStat', getU16Decoder()], ]); } export function getCrewMigrateInputCodec(): FixedSizeCodec< CrewMigrateInputArgs, CrewMigrateInput > { return combineCodec( getCrewMigrateInputEncoder(), getCrewMigrateInputDecoder(), ); }