Skip to content

Commit

Permalink
Merge pull request #902 from ant-design/type/token
Browse files Browse the repository at this point in the history
feat: add common Token type
  • Loading branch information
MarioJames committed May 23, 2024
2 parents acadab0 + 67febc0 commit ac888ee
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/brown-eyes-deny.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ant-design/web3-common': minor
---

feat: add coomon token type, add chain vm type
29 changes: 29 additions & 0 deletions packages/common/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,27 @@ export type BalanceMetadata = {
symbol?: string;
};

export enum ChainType {
/**
* Ethereum virtual machine and EVM compatible chains
*/
EVM = 'EVM',

/**
* Solana virtual machine
*/
SVM = 'SVM',

/**
* Bitcoin chain
*/
Bitcoin = 'Bitcoin',
}

export interface Chain {
id: ChainIds | number;
name: string;
type?: ChainType;
icon?: React.ReactNode;
browser?: {
icon?: React.ReactNode;
Expand Down Expand Up @@ -258,3 +276,14 @@ export interface Locale {
export interface UniversalEIP6963Config {
autoAddInjectedWallets?: boolean;
}

export type Token = {
name: string;
symbol: string;
icon: React.ReactNode;
decimal: number;
availableChains: {
chain: Chain;
contract: string;
}[];
};

0 comments on commit ac888ee

Please sign in to comment.