diff --git a/.changeset/clean-lemons-sit.md b/.changeset/clean-lemons-sit.md new file mode 100644 index 000000000..b50899976 --- /dev/null +++ b/.changeset/clean-lemons-sit.md @@ -0,0 +1,5 @@ +--- +'@ant-design/web3': patch +--- + +fix: hooks missing return type diff --git a/packages/common/src/enums.ts b/packages/common/src/enums.ts new file mode 100644 index 000000000..fe8442dad --- /dev/null +++ b/packages/common/src/enums.ts @@ -0,0 +1,51 @@ +export enum ChainIds { + Mainnet = 1, + Polygon = 137, + BSC = 56, + Arbitrum = 42_161, + Optimism = 10, + Goerli = 5, + Avalanche = 43_114, + X1Testnet = 195, + Sepolia = 11_155_111, + Holesky = 17_000, + Scroll = 534_352, + ScrollSepolia = 534_351, + Hardhat = 31_337, + Localhost = 1_337, +} + +export enum SolanaChainIds { + MainnetBeta = 2, + Devnet = 3, + Testnet = 4, +} + +export enum SuiChainIds { + Mainnet = 1, + Testnet = 2, + Devnet = 3, + Localnet = 4, +} + +export enum ChainType { + /** + * Ethereum virtual machine and EVM compatible chains + */ + EVM = 'EVM', + + /** + * Solana virtual machine + */ + SVM = 'SVM', + + /** + * Bitcoin chain + */ + Bitcoin = 'Bitcoin', + + /** + * Sui chain + */ + Sui = 'Sui', +} diff --git a/packages/common/src/index.ts b/packages/common/src/index.ts index e5e34ac20..9a1e6bb02 100644 --- a/packages/common/src/index.ts +++ b/packages/common/src/index.ts @@ -1,3 +1,4 @@ +export * from './enums'; export * from './types'; export * from './utils'; export * from './web3-config-provider'; diff --git a/packages/common/src/types.ts b/packages/common/src/types.ts index bfc1a74c4..9d258b5d7 100644 --- a/packages/common/src/types.ts +++ b/packages/common/src/types.ts @@ -1,3 +1,5 @@ +import { ChainIds, ChainType } from './enums'; + export interface Account { address: string; name?: string; @@ -5,36 +7,6 @@ export interface Account { addresses?: readonly [`0x${string}`, ...`0x${string}`[]]; } -export enum ChainIds { - Mainnet = 1, - Polygon = 137, - BSC = 56, - Arbitrum = 42_161, - Optimism = 10, - Goerli = 5, - Avalanche = 43_114, - X1Testnet = 195, - Sepolia = 11_155_111, - Holesky = 17_000, - Scroll = 534_352, - ScrollSepolia = 534_351, - Hardhat = 31_337, - Localhost = 1_337, -} - -export enum SolanaChainIds { - MainnetBeta = 2, - Devnet = 3, - Testnet = 4, -} - -export enum SuiChainIds { - Mainnet = 1, - Testnet = 2, - Devnet = 3, - Localnet = 4, -} - export type BrowserLinkType = 'address' | 'transaction'; export type BalanceMetadata = { @@ -43,28 +15,6 @@ 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', - - /** - * Sui chain - */ - Sui = 'Sui', -} - export interface Chain { id: ChainIds | number; name: string;