import { BigNumber } from "ethers";
import { Web3Environment } from "./Web3Environment";

export type Chain = {
  ecosystem: string;
  chainId: string;
  name: string;
  displayName: string;
  image: string;
  web3Environment: Web3Environment;
  tokenSymbol: string;
  ccipChainId: string;
  transactionExplorer: string;
  bridgeSupported: boolean;
  swapSupported: boolean;
  tokens: Token[];
  publicRpcUrls: string[];
  privateRpcUrls?: string[];
  scanApiURL?: string;
  defaultDstChain?: string;
  disabledForDestination?: string[];
  supportedDstForBridge?: string[];
  supportedDstForSwap?: string[];
};

export type Token = {
  address: string;
  name: string;
  symbol: string;
  tokenId: string;
  decimals: number;
  image?: string;
  priority: number;
  quickPick?: boolean;
  supported?: boolean;
};

export type Prices = {
  blockchainId: string;
  updatedAt: Date;
  prices: TokenPrices;
};

export type TokenPrices = {
  [chainId: string]: {
    [tokenAddress: string]: string;
  };
};

export type TokenBalances = {
  [tokenAddress: string]: BigNumber | undefined;
};

export type TokenOption = Token & {
  chainId: string;
  disabled?: boolean;
  balance?: BigNumber;
};

export type ImportedTokenData = {
  address: string;
  symbol: string;
  name: string;
  decimals: number;
};
