Skip to main content

Chain and Token Types

Types for representing blockchain networks and token metadata.

Chain

Metadata for a supported blockchain network.
interface Chain {
  /** Chain ID (e.g., 1 for Ethereum mainnet) */
  id: number;
  /** Chain key/slug (e.g., "eth", "arb") */
  key: string;
  /** Human-readable chain name */
  name: string;
  /** URL to chain logo image */
  logoUrl: string;
  /** Native gas token for the chain */
  nativeToken: Token;
  /** Whether this is an EVM-compatible chain */
  isEvm: boolean;
}

Properties

PropertyTypeDescription
idnumberUnique chain identifier (e.g., 1 for Ethereum, 42161 for Arbitrum, 999 for HyperEVM)
keystringShort identifier/slug for the chain (e.g., “eth”, “arb”, “hyperevm”)
namestringHuman-readable chain name (e.g., “Ethereum”, “Arbitrum One”, “HyperEVM”)
logoUrlstringURL to the chain’s logo image for UI display
nativeTokenTokenThe native gas token used on this chain (e.g., ETH, HYPE)
isEvmbooleanWhether the chain is EVM-compatible

Example

const chains = await mina.getChains();

chains.forEach(chain => {
  console.log(`${chain.name} (${chain.id})`);
  console.log(`  Native token: ${chain.nativeToken.symbol}`);
  console.log(`  EVM: ${chain.isEvm}`);
});

Token

Metadata for a token on a specific chain.
interface Token {
  /** Token contract address (or native token address) */
  address: string;
  /** Token symbol (e.g., "USDC") */
  symbol: string;
  /** Token name (e.g., "USD Coin") */
  name: string;
  /** Token decimals (e.g., 6 for USDC) */
  decimals: number;
  /** URL to token logo image */
  logoUrl: string;
  /** Current USD price (optional) */
  priceUsd?: number;
  /** Chain ID this token is on */
  chainId: number;
}

Properties

PropertyTypeRequiredDescription
addressstringYesToken contract address. Use 0x0000000000000000000000000000000000000000 for native tokens.
symbolstringYesToken ticker symbol (e.g., “USDC”, “ETH”, “HYPE”)
namestringYesFull token name (e.g., “USD Coin”, “Ether”)
decimalsnumberYesNumber of decimal places (e.g., 6 for USDC, 18 for ETH)
logoUrlstringYesURL to token logo image for UI display
priceUsdnumberNoCurrent USD price per token (may not always be available)
chainIdnumberYesChain ID where this token exists

Example

const tokens = await mina.getBridgeableTokens(1); // Ethereum

const usdc = tokens.find(t => t.symbol === 'USDC');
if (usdc) {
  console.log(`USDC on chain ${usdc.chainId}`);
  console.log(`Address: ${usdc.address}`);
  console.log(`Decimals: ${usdc.decimals}`);
  console.log(`Price: $${usdc.priceUsd?.toFixed(2)}`);
}

ChainsResponse

Response wrapper for chain queries with cache metadata.
interface ChainsResponse {
  /** Array of chain data */
  chains: Chain[];
  /** Whether the data is from stale cache */
  isStale: boolean;
  /** Timestamp when data was cached (null if fresh from API) */
  cachedAt: number | null;
}

Properties

PropertyTypeDescription
chainsChain[]Array of supported chains
isStalebooleantrue if data is from an expired cache (used as fallback due to API error)
cachedAtnumber | nullUnix timestamp when data was cached, or null if freshly fetched

Example

const response = await mina.getChains();

if (response.isStale) {
  console.warn('Using cached chain data from:', new Date(response.cachedAt!));
}

response.chains.forEach(chain => {
  console.log(chain.name);
});

TokensResponse

Response wrapper for token queries with cache metadata.
interface TokensResponse {
  /** Array of token data */
  tokens: Token[];
  /** Whether the data is from stale cache */
  isStale: boolean;
  /** Timestamp when data was cached (null if fresh from API) */
  cachedAt: number | null;
}

Properties

PropertyTypeDescription
tokensToken[]Array of tokens for the requested chain
isStalebooleantrue if data is from an expired cache
cachedAtnumber | nullUnix timestamp when data was cached, or null if fresh

Example

const response = await mina.getBridgeableTokens(1);

console.log(`Found ${response.tokens.length} bridgeable tokens`);

if (response.isStale) {
  console.warn('Token data may be outdated');
}

Common Token Addresses

The SDK exports commonly used token addresses as constants:
import {
  NATIVE_TOKEN_ADDRESS,
  HYPEREVM_USDC_ADDRESS
} from '@mina-bridge/sdk';

// Native token placeholder (zero address)
const nativeToken = NATIVE_TOKEN_ADDRESS;
// '0x0000000000000000000000000000000000000000'

// USDC on HyperEVM
const hyperevmUsdc = HYPEREVM_USDC_ADDRESS;
// '0xb88339cb7199b77e23db6e890353e22632ba630f'