Skip to content

Commit

Permalink
add simple README for wallet-connector
Browse files Browse the repository at this point in the history
  • Loading branch information
Sworzen1 committed May 7, 2024
1 parent 10564fa commit 05d1462
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions govtool/packages/wallet-connector/README.md
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();
```

0 comments on commit 05d1462

Please sign in to comment.