Skip to content
SwapKit is a powerful suite of tools for building blockchain applications.

wrapWithThrow

wrapWithThrow<T>(fn, errorKey?): undefined | T

Defined in: packages/helpers/src/utils/others.ts:29

T

() => T

"core_estimated_max_spendable_chain_not_supported" | "core_extend_error" | "core_inbound_data_not_found" | "core_approve_asset_address_or_from_not_found" | "core_plugin_not_found" | "core_plugin_swap_not_found" | "core_approve_asset_target_invalid" | "core_explorer_unsupported_chain" | "core_verify_message_not_supported" | "core_chain_halted" | "core_wallet_connection_not_found" | "core_wallet_ctrl_not_installed" | "core_wallet_evmwallet_not_installed" | "core_wallet_walletconnect_not_installed" | "core_wallet_keystore_not_installed" | "core_wallet_ledger_not_installed" | "core_wallet_trezor_not_installed" | "core_wallet_keplr_not_installed" | "core_wallet_okx_not_installed" | "core_wallet_keepkey_not_installed" | "core_wallet_talisman_not_installed" | "core_wallet_not_keypair_wallet" | "core_wallet_sign_message_not_supported" | "core_wallet_connection_failed" | "core_swap_invalid_params" | "core_swap_route_not_complete" | "core_swap_asset_not_recognized" | "core_swap_contract_not_found" | "core_swap_route_transaction_not_found" | "core_swap_contract_not_supported" | "core_swap_transaction_error" | "core_swap_quote_mode_not_supported" | "core_transaction_deposit_error" | "core_transaction_create_liquidity_base_error" | "core_transaction_create_liquidity_asset_error" | "core_transaction_create_liquidity_invalid_params" | "core_transaction_add_liquidity_invalid_params" | "core_transaction_add_liquidity_base_address" | "core_transaction_add_liquidity_base_error" | "core_transaction_add_liquidity_asset_error" | "core_transaction_withdraw_error" | "core_transaction_deposit_to_pool_error" | "core_transaction_deposit_insufficient_funds_error" | "core_transaction_deposit_gas_error" | "core_transaction_invalid_sender_address" | "core_transaction_deposit_server_error" | "core_transaction_user_rejected" | "core_transaction_failed" | "core_transaction_invalid_recipient_address" | "wallet_connection_rejected_by_user" | "wallet_missing_api_key" | "wallet_chain_not_supported" | "wallet_missing_params" | "wallet_provider_not_found" | "wallet_failed_to_add_or_switch_network" | "wallet_ledger_connection_error" | "wallet_ledger_connection_claimed" | "wallet_ledger_get_address_error" | "wallet_ledger_device_not_found" | "wallet_ledger_device_locked" | "wallet_ledger_transport_error" | "wallet_ledger_public_key_error" | "wallet_ledger_derivation_path_error" | "wallet_ledger_signing_error" | "wallet_ledger_app_not_open" | "wallet_ledger_invalid_response" | "wallet_ledger_method_not_supported" | "wallet_ledger_invalid_params" | "wallet_ledger_invalid_signature" | "wallet_ledger_no_provider" | "wallet_ledger_pubkey_not_found" | "wallet_ledger_transport_not_defined" | "wallet_ledger_webusb_not_supported" | "wallet_ledger_chain_not_supported" | "wallet_ledger_invalid_asset" | "wallet_ledger_invalid_account" | "wallet_ledger_address_not_found" | "wallet_ledger_failed_to_get_address" | "wallet_phantom_not_found" | "wallet_ctrl_not_found" | "wallet_ctrl_send_transaction_no_address" | "wallet_ctrl_contract_address_not_provided" | "wallet_ctrl_asset_not_defined" | "wallet_walletconnect_project_id_not_specified" | "wallet_walletconnect_connection_not_established" | "wallet_walletconnect_namespace_not_supported" | "wallet_walletconnect_chain_not_supported" | "wallet_walletconnect_invalid_method" | "wallet_walletconnect_method_not_supported" | "wallet_trezor_failed_to_sign_transaction" | "wallet_trezor_derivation_path_not_supported" | "wallet_trezor_failed_to_get_address" | "wallet_trezor_transport_error" | "wallet_trezor_method_not_supported" | "wallet_talisman_not_enabled" | "wallet_talisman_not_found" | "wallet_polkadot_not_found" | "wallet_radix_not_found" | "wallet_radix_transaction_failed" | "wallet_radix_invalid_manifest" | "wallet_radix_method_not_supported" | "wallet_radix_no_account" | "wallet_keepkey_not_found" | "wallet_keepkey_asset_not_defined" | "wallet_keepkey_contract_address_not_provided" | "wallet_keepkey_send_transaction_no_address" | "wallet_keepkey_derivation_path_error" | "wallet_keepkey_signing_error" | "wallet_keepkey_transport_error" | "wallet_keepkey_unsupported_chain" | "wallet_keepkey_invalid_response" | "wallet_keepkey_chain_not_supported" | "wallet_keepkey_signer_not_found" | "wallet_keepkey_no_accounts" | "wallet_keepkey_method_not_supported" | "wallet_keepkey_invalid_params" | "wallet_keepkey_config_not_found" | "wallet_keepkey_no_provider" | "wallet_keepkey_account_not_found" | "wallet_bitkeep_not_found" | "wallet_bitkeep_failed_to_switch_network" | "wallet_bitkeep_no_accounts" | "wallet_exodus_sign_transaction_error" | "wallet_exodus_not_found" | "wallet_exodus_no_address" | "wallet_exodus_request_canceled" | "wallet_exodus_signature_canceled" | "wallet_exodus_failed_to_switch_network" | "wallet_exodus_chain_not_supported" | "wallet_exodus_instance_missing" | "wallet_onekey_not_found" | "wallet_onekey_sign_transaction_error" | "wallet_okx_not_found" | "wallet_okx_chain_not_supported" | "wallet_okx_failed_to_switch_network" | "wallet_okx_no_accounts" | "wallet_keplr_not_found" | "wallet_keplr_chain_not_supported" | "wallet_keplr_signer_not_found" | "wallet_keplr_no_accounts" | "wallet_cosmostation_not_found" | "wallet_cosmostation_chain_not_supported" | "wallet_cosmostation_evm_provider_not_found" | "wallet_cosmostation_keplr_provider_not_found" | "wallet_cosmostation_no_accounts" | "wallet_cosmostation_no_evm_accounts" | "wallet_cosmostation_no_evm_address" | "wallet_cosmostation_signer_not_found" | "wallet_xdefi_not_found" | "wallet_xdefi_chain_not_supported" | "wallet_coinbase_not_found" | "wallet_coinbase_chain_not_supported" | "wallet_coinbase_method_not_supported" | "wallet_coinbase_no_accounts" | "wallet_evm_extensions_failed_to_switch_network" | "wallet_evm_extensions_no_provider" | "wallet_evm_extensions_not_found" | "wallet_keystore_invalid_password" | "wallet_keystore_unsupported_version" | "chainflip_channel_error" | "chainflip_unknown_asset" | "chainflip_broker_invalid_params" | "chainflip_broker_recipient_error" | "chainflip_broker_register" | "chainflip_broker_tx_error" | "chainflip_broker_withdraw" | "chainflip_broker_fund_only_flip_supported" | "chainflip_broker_fund_invalid_address" | "thorchain_chain_halted" | "thorchain_trading_halted" | "thorchain_swapin_router_required" | "thorchain_swapin_vault_required" | "thorchain_swapin_memo_required" | "thorchain_swapin_token_required" | "thorchain_preferred_asset_payout_required" | "toolbox_cosmos_account_not_found" | "toolbox_cosmos_invalid_fee" | "toolbox_cosmos_invalid_params" | "toolbox_cosmos_no_signer" | "toolbox_cosmos_not_supported" | "toolbox_cosmos_signer_not_defined" | "toolbox_cosmos_validate_address_prefix_not_found" | "toolbox_cosmos_verify_signature_no_pubkey" | "toolbox_evm_error_estimating_gas_limit" | "toolbox_evm_error_sending_transaction" | "toolbox_evm_gas_estimation_error" | "toolbox_evm_invalid_gas_asset_address" | "toolbox_evm_invalid_params" | "toolbox_evm_invalid_transaction" | "toolbox_evm_no_abi_fragment" | "toolbox_evm_no_contract_address" | "toolbox_evm_no_fee_data" | "toolbox_evm_no_from_address" | "toolbox_evm_no_gas_price" | "toolbox_evm_no_signer_address" | "toolbox_evm_no_signer" | "toolbox_evm_no_to_address" | "toolbox_evm_not_supported" | "toolbox_evm_provider_not_eip1193_compatible" | "toolbox_utxo_api_error" | "toolbox_utxo_broadcast_failed" | "toolbox_utxo_insufficient_balance" | "toolbox_utxo_invalid_address" | "toolbox_utxo_invalid_params" | "toolbox_utxo_invalid_transaction" | "toolbox_utxo_no_signer" | "toolbox_utxo_not_supported" | "toolbox_solana_no_signer" | "toolbox_solana_fee_estimation_failed" | "toolbox_substrate_not_supported" | "toolbox_radix_method_not_supported" | "toolbox_ripple_get_balance_error" | "toolbox_ripple_rpc_not_configured" | "toolbox_ripple_signer_not_found" | "toolbox_ripple_asset_not_supported" | "toolbox_ripple_broadcast_error" | "toolbox_tron_no_signer" | "toolbox_tron_invalid_token_identifier" | "toolbox_tron_token_transfer_failed" | "toolbox_not_supported" | "api_v2_invalid_response" | "api_v2_server_error" | "api_v2_invalid_method_key_hash" | "helpers_invalid_number_different_decimals" | "helpers_invalid_number_of_years" | "helpers_invalid_identifier" | "helpers_invalid_asset_url" | "helpers_invalid_asset_identifier" | "helpers_invalid_memo_type" | "helpers_failed_to_switch_network" | "helpers_not_found_provider" | "helpers_chain_not_supported" | "helpers_invalid_params" | "helpers_invalid_response" | "not_implemented"

undefined | T