/** * 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, getStructDecoder, getStructEncoder, getU32Decoder, getU32Encoder, getU64Decoder, getU64Encoder, getU8Decoder, getU8Encoder, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, } from '@solana/kit'; export type PaymentCreatedEvent = { discriminator: number; buyer: Address; merchant: Address; operator: Address; amount: bigint; orderId: number; }; export type PaymentCreatedEventArgs = { discriminator: number; buyer: Address; merchant: Address; operator: Address; amount: number | bigint; orderId: number; }; export function getPaymentCreatedEventEncoder(): FixedSizeEncoder { return getStructEncoder([ ['discriminator', getU8Encoder()], ['buyer', getAddressEncoder()], ['merchant', getAddressEncoder()], ['operator', getAddressEncoder()], ['amount', getU64Encoder()], ['orderId', getU32Encoder()], ]); } export function getPaymentCreatedEventDecoder(): FixedSizeDecoder { return getStructDecoder([ ['discriminator', getU8Decoder()], ['buyer', getAddressDecoder()], ['merchant', getAddressDecoder()], ['operator', getAddressDecoder()], ['amount', getU64Decoder()], ['orderId', getU32Decoder()], ]); } export function getPaymentCreatedEventCodec(): FixedSizeCodec< PaymentCreatedEventArgs, PaymentCreatedEvent > { return combineCodec( getPaymentCreatedEventEncoder(), getPaymentCreatedEventDecoder() ); }