πŸ”ƒInstallation

Setting up the Polkasafe SDK is a straightforward process.

Here's a step-by-step guide to installing and using the SDK:

NOTE: Polkasafe is built on top of the Polkadot.js API, so make sure you have also installed the required packages: @polkadot/api and @polkadot/extension-dapp.

// npm
npm install polkasafe bn.js dayjs 

Creating an Instance

import { Polkasafe } from 'polkasafe';
const client = new Polkasafe();

NOTE: Connecting with polkasafe is essential. Before using any functions, use connect function to set the network, address, and injector.

/**
 * @param {string} network
 * @param {string} address
 * @param {Injected} injector
 */
// injector: Simplify transaction signing and submission using the injector parameter
client.connect(network, address, injector)

Replace network, address, and injector with your specific values. That's it! You have now set up the Polkasafe SDK and you are ready to start using it in your application.

Last updated