Skip to content

Commit

Permalink
GitBook: [master] 745 pages and one asset modified
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremias Diaz authored and gitbook-bot committed Jun 18, 2020
1 parent 357d8ce commit 24f67a0
Show file tree
Hide file tree
Showing 660 changed files with 48,860 additions and 17,880 deletions.
Binary file added docs/api/.gitbook/assets/Polymath.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 16 additions & 13 deletions docs/api/README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
# @polymathnetwork/sdk - v3.0.0
# Introduction

# Getting Started
## @polymathnetwork/sdk - v3.0.0

## Purpose
## Getting Started

The Polymath SDK's main goal is to provide external developers with a set of tools that will allow them to build powerful applications that interact with the Polymath protocol. It focuses on abstracting away all the complexities of the smart contracts (and the blockchain itself) and expose a simple but complete interface. The result is a feature-rich, user-friendly node.js library.
### Purpose

## Before moving on
The Polymath SDK's main goal is to provide external developers with a set of tools that will allow them to build powerful applications that interact with the Polymath protocol. It focuses on abstracting away all the complexities of the smart contracts \(and the blockchain itself\) and expose a simple but complete interface. The result is a feature-rich, user-friendly node.js library.

### Before moving on

This document assumes you are already familiar with [Security Tokens](https://thesecuritytokenstandard.org/) in general and [Polymath](https://www.polymath.network/) in particular.

## Technical Pre-requisites
### Technical Pre-requisites

In order to use the Polymath SDK, you must install [node](https://nodejs.org/) (version 10) and [npm](https://www.npmjs.com/). The library is written in [typescript](https://www.typescriptlang.org/), but can also be used in plain javascript. This document will assume you are using typescript, but the translation to javascript is very simple.
In order to use the Polymath SDK, you must install [node](https://nodejs.org/) \(version 10\) and [npm](https://www.npmjs.com/). The library is written in [typescript](https://www.typescriptlang.org/), but can also be used in plain javascript. This document will assume you are using typescript, but the translation to javascript is very simple.

## How to use
### How to use

### Installation
#### Installation

`npm i @polymathnetwork/sdk --save`

Or, if you're using yarn

`yarn add @polymathnetwork/sdk`

### Initializing the client
#### Initializing the client

Before you can start creating Security Tokens and launching STOs, you have to connect the Polymath SDK client to an Ethereum node. This is a pretty straightforward process:

Expand All @@ -46,7 +48,8 @@ connectAndReturnStatus().then(status => console.log(`Connection status: ${status

Here is an overview of the parameters passed to the `connect` function:

- `providerUrl` is a URL that points to a running Ethereum node
- `privateKey` is the private key of the wallet that will be performing transactions
* `providerUrl` is a URL that points to a running Ethereum node
* `privateKey` is the private key of the wallet that will be performing transactions

**NOTE:** if using the SDK on a browser environment \(i.e. with MetaMask\), there is no need to supply the node URL nor the private key.

**NOTE:** if using the SDK on a browser environment (i.e. with MetaMask), there is no need to supply the node URL nor the private key.
752 changes: 378 additions & 374 deletions docs/api/SUMMARY.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/api/classes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Classes

43 changes: 20 additions & 23 deletions docs/api/classes/_context_.context.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Class: Context
# Context

Context in which the SDK is being used

- Holds the current instance of the contract wrappers
- Holds the current wallet
- Holds the factories that create and cache entities
* Holds the current instance of the contract wrappers
* Holds the current wallet
* Holds the factories that create and cache entities

## Hierarchy

Expand All @@ -24,40 +24,37 @@ Context in which the SDK is being used

## Constructors

### constructor
### constructor

\+ **new Context**(`params`: [ConstructorParams](../interfaces/_context_.constructorparams.md)): *[Context](_context_.context.md)*
+ **new Context**\(`params`: [ConstructorParams](../interfaces/_context_.constructorparams.md)\): [_Context_](_context_.context.md)

*Defined in [src/Context.ts:45](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/Context.ts#L45)*
_Defined in_ [_src/Context.ts:45_](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/Context.ts#L45)

**Parameters:**

Name | Type |
------ | ------ |
`params` | [ConstructorParams](../interfaces/_context_.constructorparams.md) |
| Name | Type |
| :--- | :--- |
| `params` | [ConstructorParams](../interfaces/_context_.constructorparams.md) |

**Returns:** *[Context](_context_.context.md)*
**Returns:** [_Context_](_context_.context.md)

## Properties

### contractWrappers
### contractWrappers

**contractWrappers**: *[PolymathBase](_polymathbase_.polymathbase.md)*
**contractWrappers**: [_PolymathBase_](_polymathbase_.polymathbase.md)

*Defined in [src/Context.ts:41](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/Context.ts#L41)*
_Defined in_ [_src/Context.ts:41_](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/Context.ts#L41)

___
### currentWallet

### currentWallet
**currentWallet**: _Wallet_

**currentWallet**: *Wallet*
_Defined in_ [_src/Context.ts:43_](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/Context.ts#L43)

*Defined in [src/Context.ts:43](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/Context.ts#L43)*
### factories

___
**factories**: [_Factories_](../interfaces/_context_.factories.md)

### factories
_Defined in_ [_src/Context.ts:45_](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/Context.ts#L45)

**factories**: *[Factories](../interfaces/_context_.factories.md)*

*Defined in [src/Context.ts:45](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/Context.ts#L45)*
168 changes: 71 additions & 97 deletions docs/api/classes/_entities_checkpoint_.checkpoint.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Class: Checkpoint
# Checkpoint

Represents a snapshot of the Security Token's supply and Tokenholder balances at a certain point in time

Expand Down Expand Up @@ -27,186 +27,160 @@ Represents a snapshot of the Security Token's supply and Tokenholder balances at

### Methods

* [_refresh](_entities_checkpoint_.checkpoint.md#_refresh)
* [\_refresh](_entities_checkpoint_.checkpoint.md#_refresh)
* [toPojo](_entities_checkpoint_.checkpoint.md#topojo)
* [generateId](_entities_checkpoint_.checkpoint.md#static-generateid)
* [unserialize](_entities_checkpoint_.checkpoint.md#static-unserialize)

## Constructors

### constructor
### constructor

\+ **new Checkpoint**(`params`: [Params](../interfaces/_entities_checkpoint_.params.md) & [UniqueIdentifiers](../interfaces/_entities_checkpoint_.uniqueidentifiers.md)): *[Checkpoint](_entities_checkpoint_.checkpoint.md)*
+ **new Checkpoint**\(`params`: [Params](../interfaces/_entities_checkpoint_.params.md) & [UniqueIdentifiers](../interfaces/_entities_checkpoint_.uniqueidentifiers.md)\): [_Checkpoint_](_entities_checkpoint_.checkpoint.md)

*Defined in [src/entities/Checkpoint.ts:106](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/entities/Checkpoint.ts#L106)*
_Defined in_ [_src/entities/Checkpoint.ts:106_](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/entities/Checkpoint.ts#L106)

Create a new Chekpoint instance

**Parameters:**

Name | Type |
------ | ------ |
`params` | [Params](../interfaces/_entities_checkpoint_.params.md) & [UniqueIdentifiers](../interfaces/_entities_checkpoint_.uniqueidentifiers.md) |
| Name | Type |
| :--- | :--- |
| `params` | [Params](../interfaces/_entities_checkpoint_.params.md) & [UniqueIdentifiers](../interfaces/_entities_checkpoint_.uniqueidentifiers.md) |

**Returns:** *[Checkpoint](_entities_checkpoint_.checkpoint.md)*
**Returns:** [_Checkpoint_](_entities_checkpoint_.checkpoint.md)

## Properties

### createdAt
### createdAt

**createdAt**: *Date*
**createdAt**: _Date_

*Defined in [src/entities/Checkpoint.ts:106](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/entities/Checkpoint.ts#L106)*
_Defined in_ [_src/entities/Checkpoint.ts:106_](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/entities/Checkpoint.ts#L106)

___
### dividendDistributions

### dividendDistributions
**dividendDistributions**: [_DividendDistribution_](_entities_dividenddistribution_.dividenddistribution.md)_\[\]_

**dividendDistributions**: *[DividendDistribution](_entities_dividenddistribution_.dividenddistribution.md)[]*

*Defined in [src/entities/Checkpoint.ts:88](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/entities/Checkpoint.ts#L88)*
_Defined in_ [_src/entities/Checkpoint.ts:88_](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/entities/Checkpoint.ts#L88)

dividend distributions associated to this snapshot

___

### index
### index

**index**: *number*
**index**: _number_

*Defined in [src/entities/Checkpoint.ts:97](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/entities/Checkpoint.ts#L97)*
_Defined in_ [_src/entities/Checkpoint.ts:97_](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/entities/Checkpoint.ts#L97)

numerical index of the checkpoint associated to this snapshot

___

### securityTokenId

**securityTokenId**: *string*

*Defined in [src/entities/Checkpoint.ts:92](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/entities/Checkpoint.ts#L92)*
### securityTokenId

___
**securityTokenId**: _string_

### securityTokenSymbol
_Defined in_ [_src/entities/Checkpoint.ts:92_](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/entities/Checkpoint.ts#L92)

**securityTokenSymbol**: *string*
### securityTokenSymbol

*Defined in [src/entities/Checkpoint.ts:90](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/entities/Checkpoint.ts#L90)*
**securityTokenSymbol**: _string_

___
_Defined in_ [_src/entities/Checkpoint.ts:90_](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/entities/Checkpoint.ts#L90)

### tokenholderBalances
### tokenholderBalances

**tokenholderBalances**: *[TokenholderBalance](../interfaces/_types_index_.tokenholderbalance.md)[]*
**tokenholderBalances**: [_TokenholderBalance_](../interfaces/_types_index_.tokenholderbalance.md)_\[\]_

*Defined in [src/entities/Checkpoint.ts:102](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/entities/Checkpoint.ts#L102)*
_Defined in_ [_src/entities/Checkpoint.ts:102_](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/entities/Checkpoint.ts#L102)

tokenholder balances at this specific checkpoint

___
### totalSupply

### totalSupply
**totalSupply**: _BigNumber_

**totalSupply**: *BigNumber*
_Defined in_ [_src/entities/Checkpoint.ts:104_](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/entities/Checkpoint.ts#L104)

*Defined in [src/entities/Checkpoint.ts:104](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/entities/Checkpoint.ts#L104)*
### uid

___
**uid**: _string_

### uid
_Overrides_ [_Entity_](_entities_entity_.entity.md)_._[_uid_](_entities_entity_.entity.md#abstract-uid)

**uid**: *string*

*Overrides [Entity](_entities_entity_.entity.md).[uid](_entities_entity_.entity.md#abstract-uid)*

*Defined in [src/entities/Checkpoint.ts:83](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/entities/Checkpoint.ts#L83)*
_Defined in_ [_src/entities/Checkpoint.ts:83_](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/entities/Checkpoint.ts#L83)

## Methods

### _refresh
### \_refresh

**_refresh**(`params`: Partial‹[Params](../interfaces/_entities_checkpoint_.params.md)›): *void*
**\_refresh**\(`params`: Partial‹[Params](../interfaces/_entities_checkpoint_.params.md)\): _void_

*Overrides [Entity](_entities_entity_.entity.md).[_refresh](_entities_entity_.entity.md#abstract-_refresh)*
_Overrides_ [_Entity_](_entities_entity_.entity.md)_._[_\_refresh_](_entities_entity_.entity.md#abstract-_refresh)

*Defined in [src/entities/Checkpoint.ts:164](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/entities/Checkpoint.ts#L164)*
_Defined in_ [_src/entities/Checkpoint.ts:164_](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/entities/Checkpoint.ts#L164)

Hydrate the entity

**Parameters:**

Name | Type |
------ | ------ |
`params` | Partial‹[Params](../interfaces/_entities_checkpoint_.params.md)› |

**Returns:** *void*

___
| Name | Type |
| :--- | :--- |
| `params` | Partial‹[Params](../interfaces/_entities_checkpoint_.params.md)|

### toPojo
**Returns:** _void_

**toPojo**(): *object*
### toPojo

*Overrides [Entity](_entities_entity_.entity.md).[toPojo](_entities_entity_.entity.md#abstract-topojo)*
**toPojo**\(\): _object_

*Defined in [src/entities/Checkpoint.ts:137](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/entities/Checkpoint.ts#L137)*
_Overrides_ [_Entity_](_entities_entity_.entity.md)_._[_toPojo_](_entities_entity_.entity.md#abstract-topojo)

Convert entity to a POJO (Plain Old Javascript Object)
_Defined in_ [_src/entities/Checkpoint.ts:137_](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/entities/Checkpoint.ts#L137)

**Returns:** *object*
Convert entity to a POJO \(Plain Old Javascript Object\)

* **createdAt**: *Date*
**Returns:** _object_

* **dividendDistributions**: *object[]* = dividendDistributions.map(distribution => distribution.toPojo())

* **index**: *number*

* **securityTokenId**: *string*

* **securityTokenSymbol**: *string*

* **tokenholderBalances**: *[TokenholderBalance](../interfaces/_types_index_.tokenholderbalance.md)[]*

* **totalSupply**: *BigNumber*

* **uid**: *string*

___
* **createdAt**: _Date_
* **dividendDistributions**: _object\[\]_ = dividendDistributions.map\(distribution => distribution.toPojo\(\)\)
* **index**: _number_
* **securityTokenId**: _string_
* **securityTokenSymbol**: _string_
* **tokenholderBalances**: [_TokenholderBalance_](../interfaces/_types_index_.tokenholderbalance.md)_\[\]_
* **totalSupply**: _BigNumber_
* **uid**: _string_

### `Static` generateId

**generateId**(`__namedParameters`: object): *string*
**generateId**\(`__namedParameters`: object\): _string_

*Defined in [src/entities/Checkpoint.ts:58](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/entities/Checkpoint.ts#L58)*
_Defined in_ [_src/entities/Checkpoint.ts:58_](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/entities/Checkpoint.ts#L58)

Generate the Checkpoint's UUID from its identifying properties

**Parameters:**

**__namedParameters**: *object*
**\_\_namedParameters**: _object_

Name | Type |
------ | ------ |
`index` | number |
`securityTokenId` | string |
| Name | Type |
| :--- | :--- |
| `index` | number |
| `securityTokenId` | string |

**Returns:** *string*

___
**Returns:** _string_

### `Static` unserialize

**unserialize**(`serialized`: string): *[UniqueIdentifiers](../interfaces/_entities_checkpoint_.uniqueidentifiers.md)*
**unserialize**\(`serialized`: string\): [_UniqueIdentifiers_](../interfaces/_entities_checkpoint_.uniqueidentifiers.md)

*Defined in [src/entities/Checkpoint.ts:70](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/entities/Checkpoint.ts#L70)*
_Defined in_ [_src/entities/Checkpoint.ts:70_](https://github.com/PolymathNetwork/polymath-sdk/blob/e8bbc1e/src/entities/Checkpoint.ts#L70)

Unserialize string to Checkpoint object

**Parameters:**

Name | Type |
------ | ------ |
`serialized` | string |
| Name | Type |
| :--- | :--- |
| `serialized` | string |

**Returns:** [_UniqueIdentifiers_](../interfaces/_entities_checkpoint_.uniqueidentifiers.md)

**Returns:** *[UniqueIdentifiers](../interfaces/_entities_checkpoint_.uniqueidentifiers.md)*
Loading

0 comments on commit 24f67a0

Please sign in to comment.