-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
0284dee
commit 44cc79e
Showing
5 changed files
with
86 additions
and
11 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,78 @@ | ||
# WalletKit | ||
|
||
WalletKit is a React component library for easily connecting a wallet to your dApp. | ||
|
||
## Features | ||
|
||
- 💡 Typescript — Get types straight out of the box. | ||
- 🌱 Ecosystem Standards — Built on top of [wagmi](https://wagmi.sh) and [viem](https://viem.sh) | ||
- 🎨 Customization — Easily customizing wallets and themes | ||
|
||
## Documentation | ||
|
||
For full documentation, visit [here](https://node-real.github.io/walletkit/website/dist/#/index). | ||
|
||
## Examples | ||
|
||
The following examples are provided in the [examples](./examples/) folder of this repo. | ||
|
||
- [nextjs](https://github.com/node-real/walletkit/tree/main/examples/nextjs) | ||
- [vite](https://github.com/node-real/walletkit/tree/main/examples/vite) | ||
|
||
## Installation | ||
|
||
```bash | ||
npm i @totejs/walletkit wagmi viem | ||
|
||
``` | ||
|
||
## Usage | ||
|
||
```tsx | ||
import '@totejs/walletkit/styles.css'; | ||
import { WagmiConfig, createConfig } from 'wagmi'; | ||
import { chains } from './chains'; | ||
import { | ||
WalletKitButton, | ||
WalletKitProvider, | ||
getDefaultConfig, | ||
WalletKitOptions, | ||
SwitchNetworkModal, | ||
} from '@totejs/walletkit'; | ||
import { metaMask, trustWallet, walletConnect } from '@totejs/walletkit/wallets'; | ||
|
||
const config = createConfig( | ||
getDefaultConfig({ | ||
autoConnect: true, | ||
appName: 'WalletKit', | ||
|
||
// WalletConnect 2.0 requires a projectId which you can create quickly | ||
// and easily for free over at WalletConnect Cloud https://cloud.walletconnect.com/sign-in | ||
walletConnectProjectId: 'xxx', | ||
|
||
chains, | ||
connectors: [trustWallet(), metaMask(), walletConnect()], | ||
}), | ||
); | ||
|
||
const options: WalletKitOptions = { | ||
initialChainId: 56, | ||
}; | ||
|
||
export default function App() { | ||
return ( | ||
<WagmiConfig config={config}> | ||
<WalletKitProvider options={options} mode="light"> | ||
<WalletKitButton /> | ||
|
||
{/* | ||
👇 Here's the SwitchNetworkModal | ||
If the user switches to a network that is not supported by our dapp, | ||
this modal will be displayed to remind the user to switch to our supported networks. | ||
*/} | ||
<SwitchNetworkModal /> | ||
</WalletKitProvider> | ||
</WagmiConfig> | ||
); | ||
} | ||
``` |
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