-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
84 additions
and
23 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
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,24 @@ | ||
import React from 'react'; | ||
import { ConnectButton, Connector } from '@ant-design/web3'; | ||
import { SuiWeb3ConfigProvider } from '@ant-design/web3-sui'; | ||
import { createNetworkConfig } from '@mysten/dapp-kit'; | ||
import { QueryClient } from '@tanstack/react-query'; | ||
|
||
const queryClient = new QueryClient(); | ||
|
||
const { networkConfig } = createNetworkConfig({ | ||
testnet: { url: `https://api.zan.top/node/v1/sui/testnet/${YOUR_ZAN_API_KEY}` }, | ||
mainnet: { url: `https://api.zan.top/node/v1/sui/mainnet/${YOUR_ZAN_API_KEY}` }, | ||
}); | ||
|
||
const App: React.FC = () => { | ||
return ( | ||
<SuiWeb3ConfigProvider balance networkConfig={networkConfig} queryClient={queryClient}> | ||
<Connector> | ||
<ConnectButton /> | ||
</Connector> | ||
</SuiWeb3ConfigProvider> | ||
); | ||
}; | ||
|
||
export default App; |
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,18 @@ | ||
import React from 'react'; | ||
import { ConnectButton, Connector } from '@ant-design/web3'; | ||
import { SuiWeb3ConfigProvider } from '@ant-design/web3-sui'; | ||
import { QueryClient } from '@tanstack/react-query'; | ||
|
||
const queryClient = new QueryClient(); | ||
|
||
const App: React.FC = () => { | ||
return ( | ||
<SuiWeb3ConfigProvider balance autoConnect queryClient={queryClient}> | ||
<Connector> | ||
<ConnectButton /> | ||
</Connector> | ||
</SuiWeb3ConfigProvider> | ||
); | ||
}; | ||
|
||
export default App; |
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,25 @@ | ||
--- | ||
nav: 组件 | ||
order: 6 | ||
group: | ||
title: 连接链 | ||
order: 2 | ||
--- | ||
|
||
# Sui | ||
|
||
## 推荐配置 | ||
|
||
<code src="./demos/recommend.tsx"></code> | ||
|
||
## 网络 | ||
|
||
<code src="./demos/networks.tsx"></code> | ||
|
||
## 非官方网络 | ||
|
||
<code src="./demos/networks-unofficial.tsx"></code> | ||
|
||
## 更多组件 | ||
|
||
<code src="./demos/more-components.tsx"></code> |