/**
 * 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 WithdrawFundsEvent = { amount: bigint; destination: Address };

export type WithdrawFundsEventArgs = {
  amount: number | bigint;
  destination: Address;
};

export function getWithdrawFundsEventEncoder(): FixedSizeEncoder<WithdrawFundsEventArgs> {
  return getStructEncoder([
    ["amount", getU64Encoder()],
    ["destination", getAddressEncoder()],
  ]);
}

export function getWithdrawFundsEventDecoder(): FixedSizeDecoder<WithdrawFundsEvent> {
  return getStructDecoder([
    ["amount", getU64Decoder()],
    ["destination", getAddressDecoder()],
  ]);
}

export function getWithdrawFundsEventCodec(): FixedSizeCodec<
  WithdrawFundsEventArgs,
  WithdrawFundsEvent
> {
  return combineCodec(
    getWithdrawFundsEventEncoder(),
    getWithdrawFundsEventDecoder(),
  );
}
