import { getAddressEncoder, getProgramDerivedAddress, getU32Encoder, getUtf8Encoder, } from '@solana/kit';
const utf8 = getUtf8Encoder();
const u32 = getU32Encoder();
const addressEncoder = getAddressEncoder();
// Intentionally using @solana/kit re-exports for consistency with package-wide imports.
async function derive(programAddress, seeds) {
    const pda = await getProgramDerivedAddress({ programAddress, seeds });
    return { pda, address: pda[0], bump: pda[1] };
}
export async function deriveMultisigIsmAccessControlPda(programAddress) {
    return derive(programAddress, [
        utf8.encode('multisig_ism_message_id'),
        utf8.encode('-'),
        utf8.encode('access_control'),
    ]);
}
export async function deriveMultisigIsmDomainDataPda(programAddress, domain) {
    return derive(programAddress, [
        utf8.encode('multisig_ism_message_id'),
        utf8.encode('-'),
        u32.encode(domain),
        utf8.encode('-'),
        utf8.encode('domain_data'),
    ]);
}
export async function deriveTestIsmStoragePda(programAddress) {
    return derive(programAddress, [
        utf8.encode('test_ism'),
        utf8.encode('-'),
        utf8.encode('storage'),
    ]);
}
export async function deriveHyperlaneTokenPda(programAddress) {
    return derive(programAddress, [
        utf8.encode('hyperlane_message_recipient'),
        utf8.encode('-'),
        utf8.encode('handle'),
        utf8.encode('-'),
        utf8.encode('account_metas'),
    ]);
}
export async function deriveMailboxDispatchAuthorityPda(programAddress) {
    return derive(programAddress, [
        utf8.encode('hyperlane_dispatcher'),
        utf8.encode('-'),
        utf8.encode('dispatch_authority'),
    ]);
}
export async function deriveMailboxInboxPda(programAddress) {
    return derive(programAddress, [
        utf8.encode('hyperlane'),
        utf8.encode('-'),
        utf8.encode('inbox'),
    ]);
}
export async function deriveMailboxOutboxPda(programAddress) {
    return derive(programAddress, [
        utf8.encode('hyperlane'),
        utf8.encode('-'),
        utf8.encode('outbox'),
    ]);
}
export async function deriveMailboxProcessAuthorityPda(mailboxProgramAddress, recipientProgramAddress) {
    return derive(mailboxProgramAddress, [
        utf8.encode('hyperlane'),
        utf8.encode('-'),
        utf8.encode('process_authority'),
        utf8.encode('-'),
        addressEncoder.encode(recipientProgramAddress),
    ]);
}
export async function deriveIgpProgramDataPda(programAddress) {
    return derive(programAddress, [
        utf8.encode('hyperlane_igp'),
        utf8.encode('-'),
        utf8.encode('program_data'),
    ]);
}
export async function deriveIgpAccountPda(programAddress, salt) {
    return derive(programAddress, [
        utf8.encode('hyperlane_igp'),
        utf8.encode('-'),
        utf8.encode('igp'),
        utf8.encode('-'),
        salt,
    ]);
}
export async function deriveOverheadIgpAccountPda(programAddress, salt) {
    return derive(programAddress, [
        utf8.encode('hyperlane_igp'),
        utf8.encode('-'),
        utf8.encode('overhead_igp'),
        utf8.encode('-'),
        salt,
    ]);
}
export async function deriveValidatorAnnouncePda(programAddress) {
    return derive(programAddress, [
        utf8.encode('hyperlane_validator_announce'),
        utf8.encode('-'),
        utf8.encode('validator_announce'),
    ]);
}
export async function deriveValidatorStorageLocationsPda(programAddress, validatorH160) {
    return derive(programAddress, [
        utf8.encode('hyperlane_validator_announce'),
        utf8.encode('-'),
        utf8.encode('storage_locations'),
        utf8.encode('-'),
        validatorH160,
    ]);
}
export async function deriveReplayProtectionPda(programAddress, replayIdBytes) {
    return derive(programAddress, [
        utf8.encode('hyperlane_validator_announce'),
        utf8.encode('-'),
        utf8.encode('replay_protection'),
        utf8.encode('-'),
        replayIdBytes,
    ]);
}
export async function deriveNativeCollateralPda(programAddress) {
    return derive(programAddress, [
        utf8.encode('hyperlane_token'),
        utf8.encode('-'),
        utf8.encode('native_collateral'),
    ]);
}
export async function deriveSyntheticMintPda(programAddress) {
    return derive(programAddress, [
        utf8.encode('hyperlane_token'),
        utf8.encode('-'),
        utf8.encode('mint'),
    ]);
}
export async function deriveAtaPayerPda(programAddress) {
    return derive(programAddress, [
        utf8.encode('hyperlane_token'),
        utf8.encode('-'),
        utf8.encode('ata_payer'),
    ]);
}
export async function deriveEscrowPda(programAddress) {
    return derive(programAddress, [
        utf8.encode('hyperlane_token'),
        utf8.encode('-'),
        utf8.encode('escrow'),
    ]);
}
export async function deriveCrossCollateralStatePda(programAddress) {
    return derive(programAddress, [
        utf8.encode('hyperlane_token'),
        utf8.encode('-'),
        utf8.encode('cross_collateral'),
    ]);
}
export async function deriveCrossCollateralDispatchAuthorityPda(programAddress) {
    return derive(programAddress, [
        utf8.encode('hyperlane_cc'),
        utf8.encode('-'),
        utf8.encode('dispatch_authority'),
    ]);
}
//# sourceMappingURL=pda.js.map