/**
 * 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,
  getU64Decoder,
  getU64Encoder,
  type Address,
  type FixedSizeCodec,
  type FixedSizeDecoder,
  type FixedSizeEncoder,
} from "@solana/kit";

export type TokenCustodyBurned = {
  custodyTokenAccount: Address;
  amount: bigint;
};

export type TokenCustodyBurnedArgs = {
  custodyTokenAccount: Address;
  amount: number | bigint;
};

export function getTokenCustodyBurnedEncoder(): FixedSizeEncoder<TokenCustodyBurnedArgs> {
  return getStructEncoder([
    ["custodyTokenAccount", getAddressEncoder()],
    ["amount", getU64Encoder()],
  ]);
}

export function getTokenCustodyBurnedDecoder(): FixedSizeDecoder<TokenCustodyBurned> {
  return getStructDecoder([
    ["custodyTokenAccount", getAddressDecoder()],
    ["amount", getU64Decoder()],
  ]);
}

export function getTokenCustodyBurnedCodec(): FixedSizeCodec<
  TokenCustodyBurnedArgs,
  TokenCustodyBurned
> {
  return combineCodec(
    getTokenCustodyBurnedEncoder(),
    getTokenCustodyBurnedDecoder(),
  );
}
