/** * 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, getI64Decoder, getI64Encoder, getStructDecoder, getStructEncoder, type Codec, type Decoder, type Encoder, } from '@solana/kit'; import { getI72F56Decoder, getI72F56Encoder, getI8F56Decoder, getI8F56Encoder, type I72F56, type I72F56Args, type I8F56, type I8F56Args, } from '../../fixed/codecs'; /** Represents the immutable plan of a journey from a start point to an end point. */ export type Journey = { from: Array; to: Array; departureTime: bigint; duration: I72F56; }; export type JourneyArgs = { from: Array; to: Array; departureTime: number | bigint; duration: I72F56Args; }; export function getJourneyEncoder(): Encoder { return getStructEncoder([ ['from', getArrayEncoder(getI8F56Encoder(), { size: 2 })], ['to', getArrayEncoder(getI8F56Encoder(), { size: 2 })], ['departureTime', getI64Encoder()], ['duration', getI72F56Encoder()], ]); } export function getJourneyDecoder(): Decoder { return getStructDecoder([ ['from', getArrayDecoder(getI8F56Decoder(), { size: 2 })], ['to', getArrayDecoder(getI8F56Decoder(), { size: 2 })], ['departureTime', getI64Decoder()], ['duration', getI72F56Decoder()], ]); } export function getJourneyCodec(): Codec { return combineCodec(getJourneyEncoder(), getJourneyDecoder()); }