-
Notifications
You must be signed in to change notification settings - Fork 10
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
1 parent
935f7c8
commit f912883
Showing
3 changed files
with
60 additions
and
3 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,59 @@ | ||
# `@vechainfoundation/vanilla-wallet-kit` | ||
|
||
## Why ? | ||
|
||
- Creating some reusable UI components for connecting wallets | ||
- Allow easy interaction with all wallets. | ||
- Connex is designed to play nice with one wallet at a time, this library provides a layer on top of Connex to easily | ||
allow interaction with all wallets. | ||
- Easy setup for wallet connect. | ||
|
||
## Installation | ||
|
||
- See the parent [README](../../README.md) for installation instructions. | ||
|
||
### Build | ||
|
||
```bash | ||
yarn build | ||
``` | ||
|
||
## Usage | ||
|
||
```bash | ||
yarn add @vechainfoundation/vanilla-wallet-kit | ||
``` | ||
|
||
- In your root `index.ts` | ||
|
||
```typescript | ||
import type { WalletConnectOptions } from '@vechainfoundation/wallet-connect'; | ||
import type { Options } from '@vechain/connex'; | ||
import { configureThorModal } from '@vechainfoundation/vanilla-wallet-kit'; | ||
|
||
const walletConnectOptions: WalletConnectOptions = { | ||
projectId: '<PROJECT_ID>', // Create your project here: https://cloud.walletconnect.com/sign-up | ||
metadata: { | ||
name: 'My dApp', | ||
description: 'My dApp description', | ||
url: window.location.origin, // Your app URL | ||
icons: [`${window.location.origin}/images/my-dapp-icon.png`], // Your app Icon | ||
}, | ||
}; | ||
|
||
const nodeOptions: Omit<Options, 'signer'> = { | ||
node: 'https://testnet.vechain.org/', | ||
network: 'test', | ||
}; | ||
|
||
configureThorModal(vechainWalletKitOptions); | ||
``` | ||
|
||
- In your root `index.html`. This will add a button to your page, when clicked it will open a modal with the wallet | ||
connect QR code. | ||
|
||
```html | ||
<body> | ||
<vwk-connect-button-with-modal mode="DARK"></vwk-connect-button-with-modal> | ||
</body> | ||
``` |
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