Introduction

Purpose

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.

Before continuing

This document assumes you are already familiar with Security Tokensarrow-up-right in general and Polymatharrow-up-right as well as Polymesharrow-up-right in particular.

Technical Pre-requisites

In order to use the Polymath SDK, you must install nodearrow-up-right (version 10) and npmarrow-up-right. The library is written in typescriptarrow-up-right, but can also be used in plain javascript. This document will assume you are using typescript, but the translation to javascript is very simple.

Get Started

Installation

npm i @polymathnetwork/polymesh-sdk --save

Or, if you're using yarn

yarn add @polymathnetwork/polymesh-sdk

Initializing the client

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

NOTE: if using the SDK on a browser environment (i.e. with the Polymesh wallet browser extensionarrow-up-right), 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)

Obtaining POLYX

POLYX is the Polymesh network's protocol token that can be used to pay network fees and protocol feesarrow-up-right. As Polymesh is only available on the Alcyone testnet, POLYX can only be acquired via the POLY Upgrade bridgearrow-up-right. Please follow the instructions throughout the POLY Upgrade bridge to successfully upgrade your POLY from Kovan to POLYX on Polymesh.

A few notes on obtaining POLYX:

  • You will need the Metamask browser extensionarrow-up-right and an account with some KETH (Kovan ETH). You can request KETH from a faucet herearrow-up-right.

  • You will need a Polymesh-compatible wallet and ID. The easiest way to set this up is to download the Polymesh Testing Wallet extensionarrow-up-right. 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 W3C foundationarrow-up-right) and given a Customer Due Diligence ("CDD") attestation by a network approved provider. Once you have a DID with a CDD attestation.

Extra Resources

Token Studio UI (This is our implementation of the Polymesh SDK)arrow-up-right

Polymesh whitepaperarrow-up-right

Intro to Polymatharrow-up-right

The New and Improved Token Studioarrow-up-right

Last updated

Was this helpful?