/** * 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, getArrayDecoder, getArrayEncoder, getI64Decoder, getI64Encoder, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, getU8Decoder, getU8Encoder, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, } from '@solana/kit'; export type VoucherArgs = { magic: Array; channelId: Address; cumulativeAmount: bigint; expiresAt: bigint; }; export type VoucherArgsArgs = { magic: Array; channelId: Address; cumulativeAmount: number | bigint; expiresAt: number | bigint; }; export function getVoucherArgsEncoder(): FixedSizeEncoder { return getStructEncoder([ ['magic', getArrayEncoder(getU8Encoder(), { size: 2 })], ['channelId', getAddressEncoder()], ['cumulativeAmount', getU64Encoder()], ['expiresAt', getI64Encoder()], ]); } export function getVoucherArgsDecoder(): FixedSizeDecoder { return getStructDecoder([ ['magic', getArrayDecoder(getU8Decoder(), { size: 2 })], ['channelId', getAddressDecoder()], ['cumulativeAmount', getU64Decoder()], ['expiresAt', getI64Decoder()], ]); } export function getVoucherArgsCodec(): FixedSizeCodec { return combineCodec(getVoucherArgsEncoder(), getVoucherArgsDecoder()); }