-
Notifications
You must be signed in to change notification settings - Fork 74
/
index.tsx
39 lines (36 loc) · 918 Bytes
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import React from "react";
import { MetaMask, WagmiWeb3ConfigProvider} from "@ant-design/web3-wagmi";
import { createConfig, http } from "wagmi";
import { injected } from "wagmi/connectors";
import { mainnet, sepolia } from "wagmi/chains";
import { ConnectButton, Connector } from '@ant-design/web3';
import { SendEth } from "../../components/SendEth";
const config = createConfig({
chains: [mainnet, sepolia],
transports: {
[mainnet.id]: http(),
[sepolia.id]: http(),
},
connectors: [
injected({
target: "metaMask",
}),
],
});
const TransactionDemo: React.FC = () => {
return (
<WagmiWeb3ConfigProvider
config={config}
eip6963={{
autoAddInjectedWallets: true,
}}
wallets={[MetaMask()]}
>
<Connector>
<ConnectButton />
</Connector>
<SendEth />
</WagmiWeb3ConfigProvider>
);
};
export default TransactionDemo;