Skip to content

Commit

Permalink
feat(Token): refactor token type (#8)
Browse files Browse the repository at this point in the history
* feat(Token): refactor token type

* refactor(Coin): use ChainId to identify chains and use generator function for defaultCoins

* refactor(coins)!: rename findDefaultCoinOnChain to findDefaultToken
  • Loading branch information
mathiasmoeller committed Dec 9, 2021
1 parent e2c8006 commit ce444ce
Show file tree
Hide file tree
Showing 3 changed files with 686 additions and 1,607 deletions.
9 changes: 4 additions & 5 deletions src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,14 @@ export enum ChainId {
}

export interface Token {
id: string
address: string
symbol: string
decimals: number
chainId: number
name: string
chainKey: ChainKey
key: CoinKey
coinKey?: CoinKey
priceUSD?: string
logoURI: string
logoURI?: string
}

export interface TokenAmount extends Token {
Expand All @@ -146,7 +145,7 @@ export interface Coin {
logoURI: string
verified: boolean
chains: {
[ChainKey: string]: Token
[ChainId: string]: Token
}
}

Expand Down

0 comments on commit ce444ce

Please sign in to comment.