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

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

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.

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.

JavaScript
const twoPi = new TwoPi({
apiKey: '...',
apiSecret: '...',
mnemonic: '...',
});
Copy link
On this page
Installation
Initialization
Method Parameters
Example