Box Common Types

Import frequently used types.

The Box relies on a number of frequently used types. You can use these types within your application by importing it from the library you've installed.

import {YourType} from "@decent.xyz/the-box" // or box-ui, box-hooks, etc.

Available Types

ChainId

export enum ChainId {
  ETHEREUM = 1,
  GOERLI = 5,
  OPTIMISM = 10,
  OPTIMISM_TESTNET = 420,
  POLYGON = 137,
  POLYGON_TESTNET = 80001,
  ARBITRUM = 42161,
  ARBITRUM_TESTNET = 421613,
  BASE = 8453,
  BASE_TESTNET = 84531,
  MOONBEAM = 1284,
  AVALANCHE = 43114,
  FANTOM = 250,
  SOLANA_DEVNET = 69420,
  SOLANA_MAINNET = 1399811149, // got it from here https://www.alchemy.com/chain-connect/chain/solana
}

TokenInfo

export interface TokenInfo extends TokenId {
  address: string;
  chainId: ChainId;
  decimals: number;
  symbol: string;
  name: string;
  isNative: boolean;
  chainId: ChainId;
  logo?: string;
}

UserTokenInfo

export interface UserTokenInfo  {
  address: string;
  chainId: ChainId;
  decimals: number;
  symbol: string;
  name: string;
  isNative: boolean;
  chainId: ChainId;
  logo?: string;
  balance: bigint;
  balanceFloat: number;
}

BridgeId

enum BridgeId {
  STARGATE,
  AXELAR,
  WORMHOLE,
}

What’s Next