-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support auto generate wagmi config (#1122)
* feat: support auto generate wagmi config * chore: add changelog * fix: tsconfig for @ant-design/web3-assets/wallets * fix: test case * fix: tslint * Update packages/wagmi/src/wallets/coinbase-wallet.tsx Co-authored-by: thinkasany <[email protected]> * test: add test case * fix: wallet name match bug * chore: update demo * test: update test case * chore: update doc * chore: update test config --------- Co-authored-by: tingzhao.ytz <[email protected]> Co-authored-by: thinkasany <[email protected]>
- Loading branch information
1 parent
5fdd4ee
commit c22eb4d
Showing
35 changed files
with
961 additions
and
410 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@ant-design/web3-assets': minor | ||
'@ant-design/web3-wagmi': minor | ||
--- | ||
|
||
feat: @ant-design/web3-wagmi support auto generate config, and add @ant-design/web3-assets/wallets export |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
import { | ||
Arbitrum as ArbitrumAsset, | ||
Avalanche as AvalancheAsset, | ||
BSC as BSCAsset, | ||
Goerli as GoerliAsset, | ||
Hardhat as HardhatAsset, | ||
Holesky as HoleskyAsset, | ||
Localhost as LocalhostAsset, | ||
Mainnet as MainnetAsset, | ||
Optimism as OptimismAsset, | ||
Polygon as PolygonAsset, | ||
Scroll as ScrollAsset, | ||
ScrollSepolia as ScrollSepoliaAsset, | ||
Sepolia as SepoliaAsset, | ||
X1Testnet as X1TestnetAsset, | ||
} from '@ant-design/web3-assets'; | ||
import { | ||
arbitrum, | ||
avalanche, | ||
bsc, | ||
goerli, | ||
hardhat, | ||
holesky, | ||
localhost, | ||
mainnet, | ||
optimism, | ||
polygon, | ||
scroll, | ||
scrollSepolia, | ||
sepolia, | ||
} from 'wagmi/chains'; | ||
|
||
import type { ChainAssetWithWagmiChain } from './interface'; | ||
|
||
export const Mainnet: ChainAssetWithWagmiChain = { | ||
...MainnetAsset, | ||
wagmiChain: mainnet, | ||
}; | ||
|
||
export const Goerli: ChainAssetWithWagmiChain = { | ||
...GoerliAsset, | ||
wagmiChain: goerli, | ||
}; | ||
|
||
export const Sepolia: ChainAssetWithWagmiChain = { | ||
...SepoliaAsset, | ||
wagmiChain: sepolia, | ||
}; | ||
|
||
export const Holesky: ChainAssetWithWagmiChain = { | ||
...HoleskyAsset, | ||
wagmiChain: holesky, | ||
}; | ||
|
||
export const Polygon: ChainAssetWithWagmiChain = { | ||
...PolygonAsset, | ||
wagmiChain: polygon, | ||
}; | ||
|
||
export const BSC: ChainAssetWithWagmiChain = { | ||
...BSCAsset, | ||
wagmiChain: bsc, | ||
}; | ||
|
||
export const Arbitrum: ChainAssetWithWagmiChain = { | ||
...ArbitrumAsset, | ||
wagmiChain: arbitrum, | ||
}; | ||
|
||
export const Optimism: ChainAssetWithWagmiChain = { | ||
...OptimismAsset, | ||
wagmiChain: optimism, | ||
}; | ||
|
||
export const Avalanche: ChainAssetWithWagmiChain = { | ||
...AvalancheAsset, | ||
wagmiChain: avalanche, | ||
}; | ||
|
||
// OKX X1: https://www.okx.com/cn/x1/docs/developer/build-on-x1/quickstart | ||
export const X1Testnet: ChainAssetWithWagmiChain = { | ||
...X1TestnetAsset, | ||
wagmiChain: { | ||
id: X1TestnetAsset.id, | ||
name: X1TestnetAsset.name, | ||
nativeCurrency: { name: 'OKB', symbol: 'OKB', decimals: 18 }, | ||
rpcUrls: { | ||
default: { | ||
http: ['https://testrpc.x1.tech'], | ||
}, | ||
}, | ||
blockExplorers: { | ||
default: { | ||
name: 'X1TestnetScan', | ||
url: 'https://www.okx.com/explorer/x1-test', | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export const Scroll: ChainAssetWithWagmiChain = { | ||
...ScrollAsset, | ||
wagmiChain: scroll, | ||
}; | ||
|
||
export const ScrollSepolia: ChainAssetWithWagmiChain = { | ||
...ScrollSepoliaAsset, | ||
wagmiChain: scrollSepolia, | ||
}; | ||
|
||
export const Hardhat: ChainAssetWithWagmiChain = { | ||
...HardhatAsset, | ||
wagmiChain: hardhat, | ||
}; | ||
|
||
export const Localhost: ChainAssetWithWagmiChain = { | ||
...LocalhostAsset, | ||
wagmiChain: localhost, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
export * from './wagmi-provider'; | ||
export * from './wallets'; | ||
export * from './interface'; | ||
export * from '@ant-design/web3-assets'; | ||
export * from './chains'; | ||
export * from '@ant-design/web3-assets/tokens'; | ||
export * from '@ant-design/web3-assets/wallets'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.