/**
 * 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 {
  getAddressEncoder,
  getBytesEncoder,
  getProgramDerivedAddress,
  type Address,
  type ProgramDerivedAddress,
} from "@solana/kit";

export type AuthorityPdaSeeds = {
  receiver: Address;
};

export async function findAuthorityPdaPda(
  seeds: AuthorityPdaSeeds,
  config: { programAddress?: Address | undefined } = {},
): Promise<ProgramDerivedAddress> {
  const {
    programAddress = "CCTPV2Sm4AdWt5296sk4P66VBZ7bEhcARwFaaS9YPbeC" as Address<"CCTPV2Sm4AdWt5296sk4P66VBZ7bEhcARwFaaS9YPbeC">,
  } = config;
  return await getProgramDerivedAddress({
    programAddress,
    seeds: [
      getBytesEncoder().encode(
        new Uint8Array([
          109, 101, 115, 115, 97, 103, 101, 95, 116, 114, 97, 110, 115, 109,
          105, 116, 116, 101, 114, 95, 97, 117, 116, 104, 111, 114, 105, 116,
          121,
        ]),
      ),
      getAddressEncoder().encode(seeds.receiver),
    ],
  });
}
