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

wrapWithThrow

wrapWithThrow<T>(fn, errorKey?): void | 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_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_trezor_failed_to_sign_transaction" | "wallet_trezor_derivation_path_not_supported" | "wallet_trezor_failed_to_get_address" | "wallet_talisman_not_enabled" | "wallet_talisman_not_found" | "wallet_polkadot_not_found" | "wallet_radix_not_found" | "wallet_radix_transaction_failed" | "wallet_keepkey_not_found" | "wallet_keepkey_asset_not_defined" | "wallet_keepkey_contract_address_not_provided" | "wallet_keepkey_send_transaction_no_address" | "wallet_bitkeep_not_found" | "wallet_exodus_sign_transaction_error" | "wallet_keystore_invalid_password" | "wallet_keystore_unsupported_version" | "wallet_onekey_not_found" | "wallet_onekey_sign_transaction_error" | "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" | "api_v2_invalid_response" | "api_v2_server_error" | "api_v2_invalid_method_key_hash" | "toolbox_cosmos_signer_not_defined" | "toolbox_cosmos_no_accounts_found" | "toolbox_cosmos_verify_signature_no_pubkey" | "toolbox_cosmos_validate_address_prefix_not_found" | "toolbox_evm_no_abi_fragment" | "toolbox_evm_no_signer" | "toolbox_evm_no_signer_address" | "toolbox_evm_no_from_address" | "toolbox_evm_no_contract_address" | "toolbox_evm_no_fee_data" | "toolbox_evm_no_gas_price" | "toolbox_evm_no_to_address" | "toolbox_evm_invalid_gas_asset_address" | "toolbox_evm_provider_not_eip1193_compatible" | "toolbox_evm_error_estimating_gas_limit" | "toolbox_evm_error_sending_transaction" | "toolbox_radix_signer_not_defined" | "toolbox_solana_no_signer" | "toolbox_solana_fee_estimation_failed" | "toolbox_ripple_rpc_not_configured" | "toolbox_ripple_signer_not_found" | "toolbox_ripple_asset_not_supported" | "toolbox_ripple_broadcast_error" | "toolbox_ripple_get_balance_error" | "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" | "not_implemented"

void | T