/**
 * 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
 */
var _a;
import { isProgramError, } from "@solana/kit";
import { SVM_SPOKE_PROGRAM_ADDRESS } from "../programs";
/** NotOwner: Only the owner can call this function! */
export var SVM_SPOKE_ERROR__NOT_OWNER = 0x1770; // 6000
/** InvalidRelayHash: Invalid relay hash! */
export var SVM_SPOKE_ERROR__INVALID_RELAY_HASH = 0x1771; // 6001
/** CanOnlyCloseFillStatusPdaIfFillDeadlinePassed: The fill deadline has not passed! */
export var SVM_SPOKE_ERROR__CAN_ONLY_CLOSE_FILL_STATUS_PDA_IF_FILL_DEADLINE_PASSED = 0x1772; // 6002
/** NotRelayer: The caller is not the relayer! */
export var SVM_SPOKE_ERROR__NOT_RELAYER = 0x1773; // 6003
/** CannotSetCurrentTime: Cannot set time if not in test mode! */
export var SVM_SPOKE_ERROR__CANNOT_SET_CURRENT_TIME = 0x1774; // 6004
/** InvalidRemoteDomain: Invalid remote domain! */
export var SVM_SPOKE_ERROR__INVALID_REMOTE_DOMAIN = 0x1775; // 6005
/** InvalidRemoteSender: Invalid remote sender! */
export var SVM_SPOKE_ERROR__INVALID_REMOTE_SENDER = 0x1776; // 6006
/** InvalidMint: Invalid mint! */
export var SVM_SPOKE_ERROR__INVALID_MINT = 0x1777; // 6007
/** ExceededPendingBridgeAmount: Exceeded pending bridge amount to HubPool! */
export var SVM_SPOKE_ERROR__EXCEEDED_PENDING_BRIDGE_AMOUNT = 0x1778; // 6008
/** ParamsWriteOverflow: Overflow writing to parameters account! */
export var SVM_SPOKE_ERROR__PARAMS_WRITE_OVERFLOW = 0x1779; // 6009
/** InvalidRefund: Invalid refund address! */
export var SVM_SPOKE_ERROR__INVALID_REFUND = 0x177a; // 6010
/** ZeroRefundClaim: Zero relayer refund claim! */
export var SVM_SPOKE_ERROR__ZERO_REFUND_CLAIM = 0x177b; // 6011
/** NonZeroRefundClaim: Cannot close non-zero relayer refund claim! */
export var SVM_SPOKE_ERROR__NON_ZERO_REFUND_CLAIM = 0x177c; // 6012
/** InvalidClaimInitializer: Invalid claim initializer! */
export var SVM_SPOKE_ERROR__INVALID_CLAIM_INITIALIZER = 0x177d; // 6013
/** InvalidRefundTokenAccount: Invalid refund token account! */
export var SVM_SPOKE_ERROR__INVALID_REFUND_TOKEN_ACCOUNT = 0x177e; // 6014
/** InvalidProductionSeed: Seed must be 0 in production! */
export var SVM_SPOKE_ERROR__INVALID_PRODUCTION_SEED = 0x177f; // 6015
/** InvalidATACreationAccounts: Invalid remaining accounts for ATA creation! */
export var SVM_SPOKE_ERROR__INVALID_A_T_A_CREATION_ACCOUNTS = 0x1780; // 6016
/** InvalidDelegatePda: Invalid delegate PDA! */
export var SVM_SPOKE_ERROR__INVALID_DELEGATE_PDA = 0x1781; // 6017
var svmSpokeErrorMessages;
if (process.env.NODE_ENV !== "production") {
    svmSpokeErrorMessages = (_a = {},
        _a[SVM_SPOKE_ERROR__CANNOT_SET_CURRENT_TIME] = "Cannot set time if not in test mode!",
        _a[SVM_SPOKE_ERROR__CAN_ONLY_CLOSE_FILL_STATUS_PDA_IF_FILL_DEADLINE_PASSED] = "The fill deadline has not passed!",
        _a[SVM_SPOKE_ERROR__EXCEEDED_PENDING_BRIDGE_AMOUNT] = "Exceeded pending bridge amount to HubPool!",
        _a[SVM_SPOKE_ERROR__INVALID_A_T_A_CREATION_ACCOUNTS] = "Invalid remaining accounts for ATA creation!",
        _a[SVM_SPOKE_ERROR__INVALID_CLAIM_INITIALIZER] = "Invalid claim initializer!",
        _a[SVM_SPOKE_ERROR__INVALID_DELEGATE_PDA] = "Invalid delegate PDA!",
        _a[SVM_SPOKE_ERROR__INVALID_MINT] = "Invalid mint!",
        _a[SVM_SPOKE_ERROR__INVALID_PRODUCTION_SEED] = "Seed must be 0 in production!",
        _a[SVM_SPOKE_ERROR__INVALID_REFUND] = "Invalid refund address!",
        _a[SVM_SPOKE_ERROR__INVALID_REFUND_TOKEN_ACCOUNT] = "Invalid refund token account!",
        _a[SVM_SPOKE_ERROR__INVALID_RELAY_HASH] = "Invalid relay hash!",
        _a[SVM_SPOKE_ERROR__INVALID_REMOTE_DOMAIN] = "Invalid remote domain!",
        _a[SVM_SPOKE_ERROR__INVALID_REMOTE_SENDER] = "Invalid remote sender!",
        _a[SVM_SPOKE_ERROR__NON_ZERO_REFUND_CLAIM] = "Cannot close non-zero relayer refund claim!",
        _a[SVM_SPOKE_ERROR__NOT_OWNER] = "Only the owner can call this function!",
        _a[SVM_SPOKE_ERROR__NOT_RELAYER] = "The caller is not the relayer!",
        _a[SVM_SPOKE_ERROR__PARAMS_WRITE_OVERFLOW] = "Overflow writing to parameters account!",
        _a[SVM_SPOKE_ERROR__ZERO_REFUND_CLAIM] = "Zero relayer refund claim!",
        _a);
}
export function getSvmSpokeErrorMessage(code) {
    if (process.env.NODE_ENV !== "production") {
        return svmSpokeErrorMessages[code];
    }
    return "Error message not available in production bundles.";
}
export function isSvmSpokeError(error, transactionMessage, code) {
    return isProgramError(error, transactionMessage, SVM_SPOKE_PROGRAM_ADDRESS, code);
}
//# sourceMappingURL=svmSpoke.js.map