/**
 * 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 RepaidRentFundDebt = {
  user: Address;
  amount: bigint;
  remainingUserClaim: bigint;
};

export type RepaidRentFundDebtArgs = {
  user: Address;
  amount: number | bigint;
  remainingUserClaim: number | bigint;
};

export function getRepaidRentFundDebtEncoder(): FixedSizeEncoder<RepaidRentFundDebtArgs> {
  return getStructEncoder([
    ["user", getAddressEncoder()],
    ["amount", getU64Encoder()],
    ["remainingUserClaim", getU64Encoder()],
  ]);
}

export function getRepaidRentFundDebtDecoder(): FixedSizeDecoder<RepaidRentFundDebt> {
  return getStructDecoder([
    ["user", getAddressDecoder()],
    ["amount", getU64Decoder()],
    ["remainingUserClaim", getU64Decoder()],
  ]);
}

export function getRepaidRentFundDebtCodec(): FixedSizeCodec<
  RepaidRentFundDebtArgs,
  RepaidRentFundDebt
> {
  return combineCodec(
    getRepaidRentFundDebtEncoder(),
    getRepaidRentFundDebtDecoder(),
  );
}
