"""SVM mechanism for x402 payment protocol."""

# Constants
from .constants import (
    COMPUTE_BUDGET_PROGRAM_ADDRESS,
    DEFAULT_COMPUTE_UNIT_LIMIT,
    DEFAULT_COMPUTE_UNIT_PRICE_MICROLAMPORTS,
    DEFAULT_DECIMALS,
    DEVNET_RPC_URL,
    DEVNET_WS_URL,
    ERR_AMOUNT_INSUFFICIENT,
    ERR_COMPUTE_PRICE_TOO_HIGH,
    ERR_FEE_PAYER_MISSING,
    ERR_FEE_PAYER_NOT_MANAGED,
    ERR_FEE_PAYER_TRANSFERRING,
    ERR_INVALID_COMPUTE_LIMIT,
    ERR_INVALID_COMPUTE_PRICE,
    ERR_INVALID_INSTRUCTION_COUNT,
    ERR_INVALID_PAYLOAD,
    ERR_MINT_MISMATCH,
    ERR_NETWORK_MISMATCH,
    ERR_NO_TRANSFER_INSTRUCTION,
    ERR_RECIPIENT_MISMATCH,
    ERR_SIMULATION_FAILED,
    ERR_TRANSACTION_DECODE_FAILED,
    ERR_TRANSACTION_FAILED,
    ERR_UNSUPPORTED_SCHEME,
    MAINNET_RPC_URL,
    MAINNET_WS_URL,
    MAX_COMPUTE_UNIT_PRICE_MICROLAMPORTS,
    NETWORK_CONFIGS,
    SCHEME_EXACT,
    SOLANA_DEVNET_CAIP2,
    SOLANA_MAINNET_CAIP2,
    SOLANA_TESTNET_CAIP2,
    SVM_ADDRESS_REGEX,
    TESTNET_RPC_URL,
    TESTNET_WS_URL,
    TOKEN_2022_PROGRAM_ADDRESS,
    TOKEN_PROGRAM_ADDRESS,
    USDC_DEVNET_ADDRESS,
    USDC_MAINNET_ADDRESS,
    USDC_TESTNET_ADDRESS,
    V1_NETWORKS,
    V1_TO_V2_NETWORK_MAP,
    AssetInfo,
    NetworkConfig,
)

# Signer protocols
from .signer import ClientSvmSigner, FacilitatorSvmSigner

# Signer implementations
from .signers import FacilitatorKeypairSigner, KeypairSigner

# Types
from .types import (
    ExactSvmPayload,
    ExactSvmPayloadV1,
    ExactSvmPayloadV2,
    TransactionInfo,
)

# Utilities
from .utils import (
    convert_to_token_amount,
    decode_transaction_from_payload,
    derive_ata,
    extract_transaction_info,
    format_amount,
    get_asset_info,
    get_network_config,
    get_token_payer_from_transaction,
    get_usdc_address,
    normalize_network,
    parse_amount,
    parse_money_to_decimal,
    validate_svm_address,
)

__all__ = [
    # Constants
    "SCHEME_EXACT",
    "DEFAULT_DECIMALS",
    "TOKEN_PROGRAM_ADDRESS",
    "TOKEN_2022_PROGRAM_ADDRESS",
    "COMPUTE_BUDGET_PROGRAM_ADDRESS",
    "DEFAULT_COMPUTE_UNIT_LIMIT",
    "DEFAULT_COMPUTE_UNIT_PRICE_MICROLAMPORTS",
    "MAX_COMPUTE_UNIT_PRICE_MICROLAMPORTS",
    "DEVNET_RPC_URL",
    "TESTNET_RPC_URL",
    "MAINNET_RPC_URL",
    "DEVNET_WS_URL",
    "TESTNET_WS_URL",
    "MAINNET_WS_URL",
    "USDC_MAINNET_ADDRESS",
    "USDC_DEVNET_ADDRESS",
    "USDC_TESTNET_ADDRESS",
    "SOLANA_MAINNET_CAIP2",
    "SOLANA_DEVNET_CAIP2",
    "SOLANA_TESTNET_CAIP2",
    "V1_TO_V2_NETWORK_MAP",
    "V1_NETWORKS",
    "SVM_ADDRESS_REGEX",
    "NETWORK_CONFIGS",
    "AssetInfo",
    "NetworkConfig",
    # Error codes
    "ERR_UNSUPPORTED_SCHEME",
    "ERR_NETWORK_MISMATCH",
    "ERR_INVALID_PAYLOAD",
    "ERR_TRANSACTION_DECODE_FAILED",
    "ERR_INVALID_INSTRUCTION_COUNT",
    "ERR_INVALID_COMPUTE_LIMIT",
    "ERR_INVALID_COMPUTE_PRICE",
    "ERR_COMPUTE_PRICE_TOO_HIGH",
    "ERR_NO_TRANSFER_INSTRUCTION",
    "ERR_MINT_MISMATCH",
    "ERR_RECIPIENT_MISMATCH",
    "ERR_AMOUNT_INSUFFICIENT",
    "ERR_FEE_PAYER_MISSING",
    "ERR_FEE_PAYER_NOT_MANAGED",
    "ERR_FEE_PAYER_TRANSFERRING",
    "ERR_SIMULATION_FAILED",
    "ERR_TRANSACTION_FAILED",
    # Types
    "ExactSvmPayload",
    "ExactSvmPayloadV1",
    "ExactSvmPayloadV2",
    "TransactionInfo",
    # Signer protocols
    "ClientSvmSigner",
    "FacilitatorSvmSigner",
    # Signer implementations
    "KeypairSigner",
    "FacilitatorKeypairSigner",
    # Utilities
    "normalize_network",
    "get_network_config",
    "validate_svm_address",
    "get_usdc_address",
    "get_asset_info",
    "convert_to_token_amount",
    "parse_amount",
    "format_amount",
    "parse_money_to_decimal",
    "decode_transaction_from_payload",
    "get_token_payer_from_transaction",
    "extract_transaction_info",
    "derive_ata",
]
