Introduction
Last updated
Was this helpful?
Last updated
Was this helpful?
The Polymesh SDK walk-through focuses primarily on the implementation of Polymath's Token Studio on Polymesh. Token Studio is a Polymath dApp that allows users to create and manage security tokens using the Polymesh blockchain's architecture.
The goal of the SDK is to abstract away from the rust-based development of Polymesh and allow external developers to use a typescript-based SDK to build and integrate Token Studio functionality without the burden of searching through a technical document.
This document assumes you are already familiar with in general and as well as in particular.
In order to use the Polymath SDK, you must install (version 10) and . The library is written in , but can also be used in plain javascript. This document will assume you are using typescript, but the translation to javascript is very simple.
npm i @polymathnetwork/polymesh-sdk --save
Or, if you're using yarn
yarn add @polymathnetwork/polymesh-sdk
Before you can start registering Tickers and creating Security Tokens, you have to connect the Polymesh SDK client to a Polymesh node. This is a pretty straightforward process:
Here is an overview of the parameters passed to the connect
function:
nodeUrl
is a URL that points to a running Polymesh node
accountSeed
is the seed (akin to a private key) of the account that will be performing transactions
A few notes on obtaining POLYX:
NOTE: if using the SDK on a browser environment (i.e. with the ), there is no need to provide the account seed. Instead, you pass a Keyring object that contains the address, and a signer for that address (which you would typically get from the wallet extension)
POLYX is the Polymesh network's protocol token that can be used to . As Polymesh is only available on the Alcyone testnet, POLYX can only be acquired via the . Please follow the instructions throughout the POLY Upgrade bridge to successfully upgrade your POLY from Kovan to POLYX on Polymesh.
You will need the and an account with some KETH (Kovan ETH). You can request KETH from a faucet .
You will need a Polymesh-compatible wallet and ID. The easiest way to set this up is to download the . Remember to store your mnemonic seed as you will need it when testing your project.
POLYX can only be sent between Polymesh addresses assigned to verified IDs. When you go through the Upgrade Bridge, you will be directed to a page to verify your Polymesh ID. During this process you will be assigned a DID (Decentralized Identifier, as standardized by the ) and given a Customer Due Diligence ("CDD") attestation by a network approved provider. Once you have a DID with a CDD attestation.