Links

Quickstart guide

2PI requires npm and node.js 14 or above to work properly.

Installation

npm install --save @2pi-network/sdk
or with yarn
yarn add @2pi-network/sdk

Initialization

TwoPi({apiKey, apiSecret, mnemonic})
TwoPi creates an instance of the TwoPi object to be used as the entry point to the 2PI network.
If you do not have your credentials yet, create a new account using this guide.
Once your account is created you will be given the credetials you need to initialize the SDK.

Method Parameters

Parameter
Type
Optionality
Description
apiKey
String
optional
API key
apiSecret
String
optional
API secret
mnemonic
String
optional
Used to initialize the wallet responsible for signing ang sending all the transactions.

Example

JavaScript
const twoPi = new TwoPi({
apiKey: '...',
apiSecret: '...',
mnemonic: '...',
});