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.ChainFetchError if API fails and no cache available.
Example:
getDestinationChains()
Get destination chains (HyperEVM).getChainsByRoutes(toChainId?)
Get chains with valid bridge routes to a specific destination.
Example:
getChainById(chainId)
Get a specific chain by its ID.Token Methods
getTokens(chainId)
Get all available tokens for a specific chain.TokenFetchError if API fails and no cache available.
Example:
getBridgeableTokens(chainId)
Get tokens that can be bridged from a specific chain to HyperEVM.getDestinationTokens()
Get tokens available on HyperEVM destination.getTokenByAddress(chainId, tokenAddress)
Get a specific token by its address on a chain.Balance Methods
getBalance(chainId, tokenAddress, walletAddress)
Get token balance for a wallet address.BalanceFetchError if API fails and no cache available.
Example:
getBalances(walletAddress, chainIds, tokenAddresses?)
Get token balances across multiple chains in parallel.getChainBalances(walletAddress, chainId)
Get all supported token balances for a specific chain.Quote Methods
getQuote(params, timeoutMs?)
Get a single optimal bridge quote.
Throws:
InvalidQuoteParamsErrorif parameters are invalidNoRouteFoundErrorif no route is availableNetworkErrorif API request fails
getQuotes(params, timeoutMs?)
Get multiple bridge quotes for comparison.{ quotes: Quote[], recommendedIndex: number }
Example:
Execution Methods
execute(options)
Execute a bridge transaction.
Throws:
QuoteExpiredErrorif the quote has expiredInvalidQuoteErrorif the quote is malformedTransactionFailedErrorif the transaction failsUserRejectedErrorif the user rejects the transaction
getExecutionStatus(executionId)
Get the status of an execution by ID.getStatus(txHash)
Get the status of a bridge transaction by transaction hash.Deposit Detection Methods
detectUsdcArrival(walletAddress, options?)
Detect USDC arrival on HyperEVM after a bridge transaction.
Example:
snapshotUsdcBalance(walletAddress)
Take a snapshot of USDC balance on HyperEVM before bridging.detectUsdcArrivalFromSnapshot(walletAddress, previousBalance, options?)
Detect USDC arrival starting from a known balance snapshot.Event System
on(event, callback)
Subscribe to an SDK event.
Example:
off(event, callback)
Unsubscribe from an SDK event.once(event, callback)
Subscribe to an SDK event once (auto-unsubscribes after first call).getEmitter()
Get the internal event emitter (for advanced use).Cache Management
invalidateChainCache()
Force a fresh fetch on nextgetChains() call.
invalidateTokenCache(chainId?)
Force a fresh fetch on nextgetTokens() call.
invalidateBalanceCache(walletAddress?)
Force a fresh fetch on nextgetBalance() call.
invalidateQuoteCache()
Force fresh quotes on nextgetQuote() 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.QuoteExpiredErrorif the quote has expiredInvalidQuoteErrorif the quote is malformed
