Skip to content

Commit

Permalink
Merge pull request #212 from PolymathNetwork/beta
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
monitz87 committed Jun 18, 2020
2 parents a2a8585 + ded7ab6 commit 7af254d
Show file tree
Hide file tree
Showing 605 changed files with 73,860 additions and 12,669 deletions.
77 changes: 77 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"parser": "@typescript-eslint/parser",
"extends": ["airbnb-base", "prettier", "prettier/@typescript-eslint"],
"env": {
"browser": true,
"jest": true
},
"rules": {
"no-unused-vars": "off",
"camelcase": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"vars": "all",
"args": "after-used",
"ignoreRestSiblings": true
}
],
"import/no-unresolved": "off",
"no-extra-boolean-cast": "off",
"func-names": "off",
"max-len": [
"error",
{
"code": 100,
"ignoreComments": true,
"ignoreStrings": true,
"ignoreRegExpLiterals": true,
"ignoreTemplateLiterals": true
}
],
"import/prefer-default-export": "off",
"class-methods-use-this": "off",
"no-underscore-dangle": "off",
"no-confusing-arrow": "off",
"arrow-body-style": "off",
"no-else-return": "off",
"no-plusplus": "off",
"no-nested-ternary": "off",
"no-restricted-globals": "off",
"arrow-parens": "off",
"no-multi-str": "off",
"implicit-arrow-linebreak": "off",
"comma-dangle": [
"error",
{
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "never"
}
],
"import/no-extraneous-dependencies": [
"off",
{
"packageDir": ["../../", "./"]
}
],
"require-jsdoc": [
"warn",
{
"require": {
"FunctionDeclaration": true,
"MethodDefinition": true,
"ClassDeclaration": true,
"ArrowFunctionExpression": true,
"FunctionExpression": true
}
}
]
},
"plugins": ["@typescript-eslint"],
"parserOptions": {
"sourceType": "module"
}
}
1 change: 1 addition & 0 deletions .gitbook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
root: ./docs/api/
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
node_modules/
dist/
yarn-error.log
npm-package/
npm-package/
.idea/
coverage/
test.ts
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__tests__
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docs
4 changes: 3 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"singleQuote": true,
"trailingComma": "es5"
"trailingComma": "es5",
"tabWidth": 2,
"printWidth": 100
}
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ jobs:
script:
- yarn
- yarn build:ci
- yarn test
- yarn coveralls
- yarn semantic-release
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib",
"editor.tabSize": 2,
"editor.formatOnSave": true
}
2 changes: 1 addition & 1 deletion .yarnclean
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ docs
doc
website
images
assets
!istanbul-reports/lib/html/assets

# examples
example
Expand Down
64 changes: 63 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,71 @@
![Polymath logo](Polymath.png)
[![Coverage Status](https://coveralls.io/repos/github/PolymathNetwork/polymath-sdk/badge.svg?branch=master)](https://coveralls.io/github/PolymathNetwork/polymath-sdk?branch=master)

# Polymath SDK

A Javascript SDK for interacting with the Polymath network for the browser and Node.js

# Supported Polymath Protocol versions

- 3.0
- 3.1

# Usage

First, configure your Polymath Client:

```ts
// polyClient.ts
import { Polymath, browserUtils } from '@polymathnetwork/sdk';

// create the necessary Web3 providers on its own. You can pass custom ones
// if you want though.
const config = {
polymathRegistryAddress: '0x1234...',
};

// You could have multiple configs for each network you support:
const networkConfigs = {
['1']: {
/* */
},
['42']: {
/* */
},
};
const networkId = await browserUtils.getNetworkId();
const config = networkConfigs[networkId];

// You'll want to reuse the smae instance of the Polymath client in the rest of
// your app for the same network.
export const polyClient = new Polymath(config);
```

Initializing your client

```ts
// Pending
```

Finally, let's start a procedure to reserve a Security Token

```ts
// Builds a list of transactions required to reserve a security token
const transactionQueue = await polyClient.reserveSecurityToken({
name: 'My Token',
symbol: 'MY-TOKEN',
});

// We can listen to events for individual transactions as well as the queue
// itself. For now, let's just listen to the whole queue

await transactionQueue.run(); // Will run sequentially every transaction required

// At this point my token has been reserved
const myTokenReservation = await polyClient.getSecurityTokenReservation({
symbol: 'MY-TOKEN',
});
```

# Documentation

https://developers.polymath.network/developers/
53 changes: 0 additions & 53 deletions build/DSL/polymath_sdk_pull_request.kts

This file was deleted.

72 changes: 0 additions & 72 deletions build/DSL/polymath_sdk_release.kt

This file was deleted.

Loading

0 comments on commit 7af254d

Please sign in to comment.