Twitter
Discord
Medium
Github
Search…
2PI Documentation
Getting credentials
Security & Audits
SDK
Quickstart guide
Retrieving vaults
Making a deposit
Making a withdraw
API
Overview
Smart Contracts
Overview
Initialization
Appendix
Supported Blockchains & Tokens
Resources
Terms and Conditions
Cookie Policy
Privacy Policy
Powered By
GitBook
Quickstart guide
2PI requires npm and node.js 14 or above to work properly.
Installation
1
npm install --save @2pi-network/sdk
Copied!
or with yarn
1
yarn add @2pi-network/sdk
Copied!
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
1
const
twoPi
=
new
TwoPi
({
2
apiKey
:
'...'
,
3
apiSecret
:
'...'
,
4
mnemonic
:
'...'
,
5
});
Copied!
Previous
Security & Audits
Next
Retrieving vaults
Last modified
2mo ago
Copy link
Contents
Installation
Initialization
Method Parameters
Example