Skip to main content
The Mina class is the main entry point for the Mina Bridge SDK. It provides a unified interface for bridging assets to HyperEVM and depositing to Hyperliquid L1.

Constructor

MinaConfig

Example


Chain Methods

getChains()

Get all supported source chains for bridging.
Returns: Array of 40+ supported origin chains with metadata. Throws: ChainFetchError if API fails and no cache available. Example:

getDestinationChains()

Get destination chains (HyperEVM).
Returns: Array containing the HyperEVM chain. Example:

getChainsByRoutes(toChainId?)

Get chains with valid bridge routes to a specific destination.
Example:

getChainById(chainId)

Get a specific chain by its ID.
Example:

Token Methods

getTokens(chainId)

Get all available tokens for a specific chain.
Throws: TokenFetchError if API fails and no cache available. Example:

getBridgeableTokens(chainId)

Get tokens that can be bridged from a specific chain to HyperEVM.
Example:

getDestinationTokens()

Get tokens available on HyperEVM destination.
Returns: Array of tokens receivable on HyperEVM (USDC, HYPE). Example:

getTokenByAddress(chainId, tokenAddress)

Get a specific token by its address on a chain.
Example:

Balance Methods

getBalance(chainId, tokenAddress, walletAddress)

Get token balance for a wallet address.
Throws: BalanceFetchError if API fails and no cache available. Example:

getBalances(walletAddress, chainIds, tokenAddresses?)

Get token balances across multiple chains in parallel.
Example:

getChainBalances(walletAddress, chainId)

Get all supported token balances for a specific chain.
Example:

Quote Methods

getQuote(params, timeoutMs?)

Get a single optimal bridge quote.
QuoteParams: Throws:
  • InvalidQuoteParamsError if parameters are invalid
  • NoRouteFoundError if no route is available
  • NetworkError if API request fails
Example:

getQuotes(params, timeoutMs?)

Get multiple bridge quotes for comparison.
Returns: { quotes: Quote[], recommendedIndex: number } Example:

Execution Methods

execute(options)

Execute a bridge transaction.
ExecuteOptions: Throws:
  • QuoteExpiredError if the quote has expired
  • InvalidQuoteError if the quote is malformed
  • TransactionFailedError if the transaction fails
  • UserRejectedError if the user rejects the transaction
Example:

getExecutionStatus(executionId)

Get the status of an execution by ID.
Example:

getStatus(txHash)

Get the status of a bridge transaction by transaction hash.
Example:

Deposit Detection Methods

detectUsdcArrival(walletAddress, options?)

Detect USDC arrival on HyperEVM after a bridge transaction.
DetectionOptions: Example:

snapshotUsdcBalance(walletAddress)

Take a snapshot of USDC balance on HyperEVM before bridging.
Example:

detectUsdcArrivalFromSnapshot(walletAddress, previousBalance, options?)

Detect USDC arrival starting from a known balance snapshot.
Example:

Event System

on(event, callback)

Subscribe to an SDK event.
Available Events: Example:

off(event, callback)

Unsubscribe from an SDK event.
Example:

once(event, callback)

Subscribe to an SDK event once (auto-unsubscribes after first call).
Example:

getEmitter()

Get the internal event emitter (for advanced use).

Cache Management

invalidateChainCache()

Force a fresh fetch on next getChains() call.

invalidateTokenCache(chainId?)

Force a fresh fetch on next getTokens() call.

invalidateBalanceCache(walletAddress?)

Force a fresh fetch on next getBalance() call.

invalidateQuoteCache()

Force fresh quotes on next getQuote() call.

Utility Methods

getConfig()

Get the current client configuration.

isAutoDepositEnabled()

Check if auto-deposit is enabled.

setAutoDeposit(enabled)

Set auto-deposit preference.

validateQuote(quote)

Validate a quote before execution.
Throws:
  • QuoteExpiredError if the quote has expired
  • InvalidQuoteError if the quote is malformed

validateBalance(quote, walletAddress)

Validate user balance against a quote.
Example:

checkBalance(chainId, tokenAddress, walletAddress, amount)

Lightweight balance check without requiring a full quote.
Example: