🖋️
Token Studio SDK Walkthrough
  • Introduction
  • Summary of Features
  • Token Creation
  • Token Compliance
  • Attestations
Powered by GitBook
On this page
  • Purpose
  • Before continuing
  • Technical Pre-requisites
  • Get Started
  • Installation
  • Initializing the client
  • Obtaining POLYX
  • Extra Resources

Was this helpful?

Introduction

NextSummary of Features

Last updated 4 years ago

Was this helpful?

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 in general and as well as in particular.

Technical Pre-requisites

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.

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:

import { Polymesh } from '@polymathnetwork/polymesh-sdk';

async function run() {
  const polyClient = await Polymesh.connect({
    nodeUrl: 'https://some-node-url.com',
    accountSeed: 'YOUWISH',
  });

  // do stuff with the client
}

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

import { Polymesh, Keyring } from '@polymathnetwork/polymesh-sdk';

async function run() {
  const keyring = new Keyring();
  keyring.addFromAddress(accountAddress);
  const signer = getSignerFromExtension(); // this is not an existing function, how you get this depends on the extension

  const polyClient = await Polymesh.connect({
    nodeUrl: 'https://some-node-url.com',
    keyring,
    signer,
  });

  // do stuff with the client
}

Obtaining POLYX

A few notes on obtaining POLYX:

Extra Resources

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.

Security Tokens
Polymath
Polymesh
node
npm
typescript
Polymesh wallet browser extension
pay network fees and protocol fees
POLY Upgrade bridge
Metamask browser extension
here
Polymesh Testing Wallet extension
W3C foundation
Token Studio UI (This is our implementation of the Polymesh SDK)
Polymesh whitepaper
Intro to Polymath
The New and Improved Token Studio