Pure JavaScript

You can import Pools SDK into your web dapp to enable your users to easily connect to the Pools Wallet. The SDK for other web frameworks has the same prerequisites as for standard JavaScript.

1. Install the SDKarrow-up-right

In your project directory, install the SDK using Yarn or npm:

yarn add @pools/sdk

or

npm i @pools/sdk

2. Import the SDKarrow-up-right

In your project script, add the following to import the SDK:

import { PoolsSDK } from '@pools/sdk';

3. Instantiate the SDKarrow-up-right

Instantiate the SDK using any options:

const PSDK = new PoolsSDK(options);

const ethereum = PSDK.getProvider(); // You can also access via window.ethereum

4. Use the SDKarrow-up-right

Use the SDK by calling any provider API methods. Always call eth_requestAccounts using ethereum.request() first, since it prompts the installation or connection popup to appear.

Last updated