-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add simple README for wallet-connector
- Loading branch information
Showing
1 changed file
with
56 additions
and
0 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,56 @@ | ||
# Wallet Service | ||
|
||
The WalletService.ts file contains the implementation of a wallet service, designed to manage wallet. It includes the enableWallet function responsible for enabling the wallet connection and allows get cip95 functions. | ||
|
||
1. Install wallet-connector package. | ||
|
||
```sh | ||
yarn install wallet-connector | ||
``` | ||
|
||
2. Import service from wallet-connector. | ||
|
||
```javascript | ||
import { WalletService } from "@wallet-connector"; | ||
``` | ||
|
||
3. Usage - for enable your browser wallet extension. | ||
EXAMPLE: | ||
|
||
```javascript | ||
const newWalletAPI = await WalletService.enableWallet("%WALLET_NAME%"); | ||
``` | ||
|
||
# Wallet Provider | ||
|
||
WalletProvider component which serves as a React Context Provider to facilitate wallet integration across components. | ||
|
||
1. Install wallet-connector package | ||
|
||
```sh | ||
yarn install wallet-connector | ||
``` | ||
|
||
2. Import WalletProvider from wallet-connector and wrap your app. | ||
|
||
```javascript | ||
import { WalletProvider } from "@wallet-connector"; | ||
|
||
<WalletProvider> | ||
<App /> | ||
</WalletProvider>; | ||
``` | ||
|
||
3. Usage | ||
|
||
```javascript | ||
import { useWalletContext } from "@wallet-connector"; | ||
|
||
const { | ||
disconnectWallet, | ||
enableError, | ||
enableWallet, | ||
isEnableLoading, | ||
walletAPI, | ||
} = useWalletContext(); | ||
``` |