@polymeshassociation/polymesh-sdk 15.0.0 โ†’ 15.0.1-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,140 +1,6 @@
1
- # [15.0.0](https://github.com/PolymathNetwork/polymesh-sdk/compare/v14.1.2...v15.0.0) (2022-08-10)
1
+ ## [15.0.1-beta.1](https://github.com/PolymathNetwork/polymesh-sdk/compare/v15.0.0...v15.0.1-beta.1) (2022-08-11)
2
2
 
3
3
 
4
4
  ### Bug Fixes
5
5
 
6
- * ๐Ÿ› Add missing validations in `controllerTransfer` proc ([efb07c8](https://github.com/PolymathNetwork/polymesh-sdk/commit/efb07c8b650cb416ce69b46433510cdf3cee3797))
7
- * ๐Ÿ› Correct the `amount`, `withheldTax` returned by `DividendDistribution.getPaymentHistory` ([f6ab2c5](https://github.com/PolymathNetwork/polymesh-sdk/commit/f6ab2c57bbc0e46664990e5bd1450f0c48c5b767))
8
- * ๐Ÿ› disregard pallets without calls ([af684ae](https://github.com/PolymathNetwork/polymesh-sdk/commit/af684ae30c58687c38924fc5e00bfa0115e504fb))
9
- * ๐Ÿ› Fix asset.settlement.canTransfer method ([6f32e4d](https://github.com/PolymathNetwork/polymesh-sdk/commit/6f32e4d72b19795a8bf73f9c5943f4bcb5e7a6d6))
10
- * ๐Ÿ› Handle NoData claimType in conversion util ([1f9bbfa](https://github.com/PolymathNetwork/polymesh-sdk/commit/1f9bbfa3bbc049092c8913bc05a71e2bbaa3dc9a))
11
- * ๐Ÿ› ignore portfolio locked balances with zero amount ([be57838](https://github.com/PolymathNetwork/polymesh-sdk/commit/be57838b616b4035a6e8de757cd38ff2768bfe6f))
12
- * ๐Ÿ› Pin polkadot dependencies ([d79f561](https://github.com/PolymathNetwork/polymesh-sdk/commit/d79f561124846c3681d2bf01ec5639b4c738600a))
13
- * ๐Ÿ› Remove polymeshApi Proxy in Context ([fdd14a8](https://github.com/PolymathNetwork/polymesh-sdk/commit/fdd14a86945c6cde66c6cb7a81ac46766366c055))
14
- * ๐Ÿ› Settlement not being modifable before end block ([#762](https://github.com/PolymathNetwork/polymesh-sdk/issues/762)) ([517a2a7](https://github.com/PolymathNetwork/polymesh-sdk/commit/517a2a712c9e0da8d365e74efe7585806653e7b3))
15
- * ๐Ÿ› Undo postProcess augment-rpc ([c758e08](https://github.com/PolymathNetwork/polymesh-sdk/commit/c758e08191db2d9c66c47536df544127ac06d011))
16
- * ๐Ÿ› Update polkadot api to fix pagination issue ([6c032e6](https://github.com/PolymathNetwork/polymesh-sdk/commit/6c032e667d969f11c59ef33128a206e100e05c1a))
17
- * ๐Ÿ› use proper type for document URIs ([615782a](https://github.com/PolymathNetwork/polymesh-sdk/commit/615782a471e9cafcb832af42231b80c16d8279a3))
18
- * ๐Ÿ› Validate primary key on `modifySignerPermissions` ([0676035](https://github.com/PolymathNetwork/polymesh-sdk/commit/06760350625d2fccdd67e5fedc4d521d58b247d3))
19
-
20
-
21
- ### Code Refactoring
22
-
23
- * ๐Ÿ’ก GetReturnType to GetTransferRestrictionReturnType ([cff18a5](https://github.com/PolymathNetwork/polymesh-sdk/commit/cff18a5d6b4b2aa3a7271eb560b002370089f4ae))
24
- * ๐Ÿ’ก Rename `toJson` to `toHuman` in all entities ([cb684fb](https://github.com/PolymathNetwork/polymesh-sdk/commit/cb684fb7e868e5ae351a93ce0fec8860e5a33352))
25
-
26
-
27
- * Da 179/upgrade 5.0.0 (#742) ([2450467](https://github.com/PolymathNetwork/polymesh-sdk/commit/245046707f68ffae4a3c97aad0c2fb74babc6a7d)), closes [#742](https://github.com/PolymathNetwork/polymesh-sdk/issues/742)
28
-
29
-
30
- ### Features
31
-
32
- * ๐ŸŽธ (WIP) Add support for 5.0.0 rc-1 ([7a4e503](https://github.com/PolymathNetwork/polymesh-sdk/commit/7a4e50346ea855cdf462c0585ab5c7b6f15deea2))
33
- * ๐ŸŽธ (WIP) Add support for 5.0.0 rc-1 ([a7d7a8b](https://github.com/PolymathNetwork/polymesh-sdk/commit/a7d7a8b97339d339d4a33d8b17b602142bd828c4))
34
- * ๐ŸŽธ Add enableStat to transferRestriction namespace ([#782](https://github.com/PolymathNetwork/polymesh-sdk/issues/782)) ([c862841](https://github.com/PolymathNetwork/polymesh-sdk/commit/c862841b0bec896e3a040085890d7a5cbd365c19))
35
- * ๐ŸŽธ add getSecondaryPermissions method ([86e86fd](https://github.com/PolymathNetwork/polymesh-sdk/commit/86e86fddb0a3c5b73b6c08d26e43b927dbe612cf))
36
- * ๐ŸŽธ Add guard to Asset.investorCount if stat is not enabled ([3cfcc58](https://github.com/PolymathNetwork/polymesh-sdk/commit/3cfcc58085c3856093e44138accec0c070b76677))
37
- * ๐ŸŽธ Add method to get all assets on chain (with pagination) ([77f1579](https://github.com/PolymathNetwork/polymesh-sdk/commit/77f1579286f4f85e7f4e8d973c7142e047d53926))
38
- * ๐ŸŽธ add pagination for getSecondaryAccounts ([7d37e02](https://github.com/PolymathNetwork/polymesh-sdk/commit/7d37e026511af9481dd6131f0f45fc127327e38a))
39
- * ๐ŸŽธ Add support for FIGI asset identifiers ([6fa8cf1](https://github.com/PolymathNetwork/polymesh-sdk/commit/6fa8cf139ac79ea26809a2fe6663764aff7581ca))
40
- * ๐ŸŽธ Always return `TickerReservation` from `assets.getTickerReservation` ([4b59621](https://github.com/PolymathNetwork/polymesh-sdk/commit/4b59621ee74144d5fa9a9a5147e476710be3fee3))
41
- * ๐ŸŽธ bump supported chain version to 5.0.2 ([a73ced2](https://github.com/PolymathNetwork/polymesh-sdk/commit/a73ced246ee34ef9d8180c9785bde5676c8572cc))
42
- * ๐ŸŽธ Bump supported version range to 5.0.x ([44ec9f5](https://github.com/PolymathNetwork/polymesh-sdk/commit/44ec9f57429f7ab4c2eee52a66c2728181486dad))
43
- * ๐ŸŽธ DA-311 Add support for middleware v2 with claims POC ([3b75f49](https://github.com/PolymathNetwork/polymesh-sdk/commit/3b75f49444d80645f0e1757f052f2786682b82fa))
44
- * ๐ŸŽธ DA-315 Migrate middleware queries to subquery native ([389e84d](https://github.com/PolymathNetwork/polymesh-sdk/commit/389e84d8ff9f859a040aea47567603a45d9fbbb2))
45
- * ๐ŸŽธ expose transaction index within block ([e6c6983](https://github.com/PolymathNetwork/polymesh-sdk/commit/e6c6983433487c3935b4b28f5204c44a95268fb5))
46
- * ๐ŸŽธ log a warning for minor and patch version mismatch ([30dd691](https://github.com/PolymathNetwork/polymesh-sdk/commit/30dd69163aa75df81614f1feea8f45803f1a59d6))
47
- * ๐ŸŽธ Migrate external agents queries to subquery native ([1f6a5c7](https://github.com/PolymathNetwork/polymesh-sdk/commit/1f6a5c72c3a271276242763ecee99b4d904c93c6))
48
- * ๐ŸŽธ Migrate settlements query to subquery native ([e3ac5c2](https://github.com/PolymathNetwork/polymesh-sdk/commit/e3ac5c2ca7fe135195f47e3bac178c0ce1782bae))
49
- * ๐ŸŽธ move getSecondaryAccountPermissions into internal tool ([d547463](https://github.com/PolymathNetwork/polymesh-sdk/commit/d5474634564142f99683af8b85dcc28d45173d0e))
50
- * ๐ŸŽธ Multiple tags support while getting protocol fees ([e0f8897](https://github.com/PolymathNetwork/polymesh-sdk/commit/e0f889701737a7b3dceab5371c91074cf8c09a6f))
51
- * ๐ŸŽธ Pin transtive polkadot dependencies ([463ce32](https://github.com/PolymathNetwork/polymesh-sdk/commit/463ce3254c59f5741bcbea10eb9657894a208f71))
52
- * ๐ŸŽธ Proper calculation of investor count with PUIS enabled ([1924cdd](https://github.com/PolymathNetwork/polymesh-sdk/commit/1924cddeae75165583ef9948dac36afcacd9a35e))
53
- * ๐ŸŽธ Publish to polymesh association npm ([#777](https://github.com/PolymathNetwork/polymesh-sdk/issues/777)) ([38ee807](https://github.com/PolymathNetwork/polymesh-sdk/commit/38ee8078e5ec6c3a825431c6338e2c3d1fd08974))
54
- * ๐ŸŽธ Refactor code to use new trasnfer restrictions api ([37b146a](https://github.com/PolymathNetwork/polymesh-sdk/commit/37b146a2d2d4f37dc2070a24db652f782e5bf9a2))
55
- * ๐ŸŽธ Return gasFees, protocolFees in `getTransactionByHash` ([032222c](https://github.com/PolymathNetwork/polymesh-sdk/commit/032222c6aeb28b8dd62f73de4eb34fecf4318a69))
56
- * ๐ŸŽธ Round post-tax dividend amounts ([dfb9625](https://github.com/PolymathNetwork/polymesh-sdk/commit/dfb962504c874396362205d470cbf7fb2d91ce18))
57
- * ๐ŸŽธ Support 5.0.0-rc-1 ([33b77e4](https://github.com/PolymathNetwork/polymesh-sdk/commit/33b77e4af822f2a9e03eded85042bd4643c2e142))
58
- * ๐ŸŽธ Support callback for getSecondaryAccounts ([1a9c6fe](https://github.com/PolymathNetwork/polymesh-sdk/commit/1a9c6fed13472b3c95f4426c7d93258ee1dfd798))
59
- * ๐ŸŽธ support passing existing group permissions ([ff3e8ae](https://github.com/PolymathNetwork/polymesh-sdk/commit/ff3e8aecdb9ce7f953d0474721cd3b99bf4eb7aa))
60
- * ๐ŸŽธ support passing null (full) permissions on `inviteAgent ([8001b7b](https://github.com/PolymathNetwork/polymesh-sdk/commit/8001b7b6d7570eb9fe1cdc6a0c21decd82fbdb82))
61
- * ๐ŸŽธ throw an error when fetching an asset identity ([8949e13](https://github.com/PolymathNetwork/polymesh-sdk/commit/8949e13ad2969b8db6659a01f10f8bd66dcb44cc))
62
- * ๐ŸŽธ Update granular permissions results for new types ([fe2b072](https://github.com/PolymathNetwork/polymesh-sdk/commit/fe2b072545f8d89be7cb6edae1557be4939b586e))
63
- * ๐ŸŽธ Upgrade polkadot SDK along with 5.0.0 chain types ([2e9ee2c](https://github.com/PolymathNetwork/polymesh-sdk/commit/2e9ee2ca40421ba95b97d92f37d013dc5e2de553))
64
- * ๐ŸŽธ upgrade polkadot.js to 8.9.1 ([ba358ad](https://github.com/PolymathNetwork/polymesh-sdk/commit/ba358ada87ac3f7a1d04b2273d416e39bc895dfa))
65
- * ๐ŸŽธ use `createGroupAndAddAuth` when appropriate ([ed0d022](https://github.com/PolymathNetwork/polymesh-sdk/commit/ed0d022e46e28336831336671dee5a433fc421dd))
66
- * ๐ŸŽธ Use batching fully for add restriction ([5bd29d5](https://github.com/PolymathNetwork/polymesh-sdk/commit/5bd29d51161d4ee5b281fae4ddd124ee4976783d))
67
- * ๐ŸŽธ use batching when modifying CA defaults ([296949b](https://github.com/PolymathNetwork/polymesh-sdk/commit/296949bd4187b9949d3f5fa01b0bbe34bfced0ca))
68
- * ๐ŸŽธ use composite extrinsic to create and change group ([8c0a9f0](https://github.com/PolymathNetwork/polymesh-sdk/commit/8c0a9f02c291622a2ece31f2ba35689e57bbdf01))
69
- * ๐ŸŽธ use composite extrinsic to create CA and distribution ([29fb0ad](https://github.com/PolymathNetwork/polymesh-sdk/commit/29fb0ad65d5a1f2ca4db28ee6951d4b5b4ca372a))
70
- * ๐ŸŽธ Use names prefixed with PolymeshPrimitives and Pallet ([7874b57](https://github.com/PolymathNetwork/polymesh-sdk/commit/7874b57fde6b054e25e376e846e0e61b135b2bc0))
71
- * ๐ŸŽธ Use proper batching for setTransferRestriction ([f895ec8](https://github.com/PolymathNetwork/polymesh-sdk/commit/f895ec85c68f41b0449a3117cf103122ee44f949))
72
- * ๐ŸŽธ validate chain spec version when connecting ([af76f93](https://github.com/PolymathNetwork/polymesh-sdk/commit/af76f93796c577a9c8ef72b9a7fc55c0c99d65e8))
73
- * ๐ŸŽธ WIP Update transfer restrictions to create stats ([32d7d94](https://github.com/PolymathNetwork/polymesh-sdk/commit/32d7d94e939c5d1f0194d62addd9ed01ceb15e45))
74
-
75
-
76
- ### BREAKING CHANGES
77
-
78
- * ๐Ÿงจ getSecondaryAccounts is now paginated
79
- * ๐Ÿงจ Type `GetReturnType<T>` is now renamed to
80
- `GetTransferRestrictionReturnType<T>`
81
- * ๐Ÿงจ no longer throw an error when adding an external agent with explicit
82
- permissions if there is already an existing permission group with those
83
- permissions
84
- * ๐Ÿงจ `accountManagement.modifyPermissions` and `accountManagement.revokePermissions`
85
- now throw an error if the signing Account is not the primary Account of the Identity
86
- whose secondary Accounts' permissions are modified/revoked
87
- * ๐Ÿงจ Asset.investorCount throws if stat is not enabled
88
-
89
- * fix: ๐Ÿ› Remove polymeshApi Proxy in Context
90
-
91
- polkadot.js began using a private accesor (e.g. #registry) internally.
92
- This causes an error to be thrown when called by a proxied instance.
93
- Context Proxy was used to guard against having no signer which is taken
94
- care of by the singning manager, so this shouldn't cause any behavior to
95
- change
96
-
97
- * feat: ๐ŸŽธ Bump supported version range to 5.0.x
98
-
99
- * chore: ๐Ÿค– use stored metadata to generate country code enum
100
-
101
- * chore: ๐Ÿค– remove country code generation from definitions script
102
-
103
- * feat: ๐ŸŽธ expose transaction index within block
104
-
105
- Also fix compilation errors that arise in sandbox
106
-
107
- * fix: ๐Ÿ› disregard pallets without calls
108
-
109
- * fix: ๐Ÿ› use proper type for document URIs
110
-
111
- Also fixed documentHash conversion util tests
112
-
113
- * feat: ๐ŸŽธ validate chain spec version when connecting
114
- * ๐Ÿงจ throw an error instead of a warning when the chain versions aren't
115
- within the expected ranges
116
-
117
- * refactor: ๐Ÿ’ก Eliminate RPC specific conversion functions
118
-
119
- Modify the schema object to make its types compatible with the rest of
120
- the api. This elminates snake case conversion functions to DRY the code
121
- base
122
-
123
- Update types to use PolymeshPrimitivesIdentityId instead of IdentityId
124
-
125
- * feat: ๐ŸŽธ log a warning for minor and patch version mismatch
126
-
127
- Co-authored-by: Jeremias Diaz <monitz87@gmail.com>
128
- Co-authored-by: Victor Vicente <VictorVicente@users.noreply.github.com>
129
- * ๐Ÿงจ `network.getProtocolFees` now supports passing multiple `TxTags`.
130
- Also, the return type has been changed from `Promise<BigNumber>`
131
- to `Promise<ProtocolFees[]>` specifying protocol fees for each tag argument.
132
- * ๐Ÿงจ throw an error instead of a warning when the chain versions aren't
133
- within the expected ranges
134
- * ๐Ÿงจ Asset.investorCount throws if stat is not enabled
135
- * ๐Ÿงจ Return type of `network.getTransactionByHash` is changed from
136
- `Promise<ExtrinsicData | null>` to `Promise<ExtrinsicDataWithFees | null>`
137
- * ๐Ÿงจ `toJson` method within all entities has been renamed to `toHuman`
138
- * ๐Ÿงจ `assets.isTickerAvailable` has been removed.
139
- To check ticker availability, directly get the `TickerReservation` instance
140
- and use `details.status` to check the availability
6
+ * ๐Ÿ› missing readme from npm ([9632afe](https://github.com/PolymathNetwork/polymesh-sdk/commit/9632afec9f2217cdb2d24c66f1af4780acc122a5))
package/README.md ADDED
@@ -0,0 +1,109 @@
1
+ [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
2
+ [![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg?style=flat-square)](https://github.com/standard/semistandard)
3
+ [![Types](https://img.shields.io/npm/types/@polymathnetwork/polymesh-sdk)](https://)
4
+ [![npm](https://img.shields.io/npm/v/@polymathnetwork/polymesh-sdk)](https://www.npmjs.com/package/@polymathnetwork/polymesh-sdk)
5
+ [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
6
+ [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=PolymathNetwork_polymesh-sdk&metric=coverage)](https://sonarcloud.io/dashboard?id=PolymathNetwork_polymesh-sdk)
7
+ [![Github Actions Workflow](https://github.com/PolymathNetwork/polymesh-sdk/actions/workflows/main.yml/badge.svg)](https://github.com/Polymathnetwork/polymesh-sdk/actions)
8
+ [![Sonarcloud Status](https://sonarcloud.io/api/project_badges/measure?project=PolymathNetwork_polymesh-sdk&metric=alert_status)](https://sonarcloud.io/dashboard?id=PolymathNetwork_polymesh-sdk)
9
+ [![Issues](https://img.shields.io/github/issues/PolymathNetwork/polymesh-sdk)](https://github.com/PolymathNetwork/polymesh-sdk/issues)
10
+
11
+ ## @polymathnetwork/polymesh-sdk
12
+
13
+ <!--- This section is autogenerated, do not modify --->
14
+
15
+ ## Polymesh version
16
+
17
+ This release is compatible with Polymesh v5.0
18
+
19
+ <!--- End of section --->
20
+
21
+ ## Getting Started
22
+
23
+ ### Purpose
24
+
25
+ The Polymesh 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 Polymesh protocol. It focuses on abstracting away all the complexities of the Polymesh blockchain and expose a simple but complete interface. The result is a feature-rich, user-friendly node.js library.
26
+
27
+ ### Before moving on
28
+
29
+ This document assumes you are already familiar with [Security Tokens](https://thesecuritytokenstandard.org/) in general and [Polymath](https://www.polymath.network/) as well as [Polymesh](https://polymath.network/polymesh) in particular.
30
+
31
+ ### Technical Pre-requisites
32
+
33
+ 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.
34
+
35
+ ### Documentation
36
+
37
+ Token Studio SDK Walkthrough:
38
+
39
+ https://developers.polymath.network/token-studio-api-walkthrough/
40
+
41
+ Polymesh SDK API Reference:
42
+
43
+ https://github.com/PolymeshAssociation/polymesh-sdk/wiki
44
+
45
+ ### How to use
46
+
47
+ #### Installation
48
+
49
+ `npm i @polymathnetwork/polymesh-sdk --save`
50
+
51
+ Or, if you're using yarn
52
+
53
+ `yarn add @polymathnetwork/polymesh-sdk`
54
+
55
+ Or, if using pnpm
56
+
57
+ `pnpm add @polymathnetwork/polymesh-sdk`
58
+
59
+ **NOTE** it is _highly_ recommended that you use one of these three package managers. This project uses package resolutions/overrides to pin certain problematic dependencies, and these are only supported by the aforementioned package managers. Using a different package manager may result in unexpected behavior
60
+
61
+ **NOTE** if using TypeScript the compiler option "skipLibCheck" should be set to true in your tsconfig.json file
62
+
63
+ #### Initializing the client
64
+
65
+ Before you can start registering Tickers and creating Assets, you have to connect the Polymesh SDK client to a Polymesh node. This is a pretty straightforward process:
66
+
67
+ ```typescript
68
+ import { Polymesh } from '@polymathnetwork/polymesh-sdk';
69
+ import { LocalSigningManager } from '@polymathnetwork/local-signing-manager';
70
+
71
+ async function run() {
72
+ const signingManager = await LocalSigningManager.create({
73
+ accounts: [
74
+ {
75
+ seed: 'YOU_WISH',
76
+ },
77
+ ],
78
+ });
79
+ const polyClient = await Polymesh.connect({
80
+ nodeUrl: 'wss://some-node-url.com',
81
+ signingManager,
82
+ });
83
+
84
+ // do stuff with the client
85
+ }
86
+ ```
87
+
88
+ Here is an overview of the parameters passed to the `connect` function:
89
+
90
+ - `nodeUrl` is a URL that points to a running Polymesh node
91
+ - `signingManager` is an object that complies with the `SigningManager` interface. It holds the Accounts capable of signing transactions, and the signing logic itself. In this example, `LocalSigningManager` is a simple signing manager that holds private keys in memory and signs with them
92
+
93
+ **NOTE:** if using the SDK on a browser environment \(i.e. with the Polymesh wallet browser extension\), you would use the `BrowserExtensionSigningManager` provided by `@polymathnetwork/browser-extension-signing-manager`
94
+
95
+ ```typescript
96
+ import { Polymesh } from '@polymathnetwork/polymesh-sdk';
97
+ import { BrowserExtensionSigningManager } from '@polymathnetwork/browser-extension-signing-manager';
98
+
99
+ async function run() {
100
+ const signingManager = await BrowserExtensionSigningManager.create('MY_APP_NAME'); // The Polymesh wallet extension will ask the user to authorize MY_APP_NAME for access
101
+
102
+ const polyClient = await Polymesh.connect({
103
+ nodeUrl: 'wss://some-node-url.com',
104
+ signingManager,
105
+ });
106
+
107
+ // do stuff with the client
108
+ }
109
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polymeshassociation/polymesh-sdk",
3
- "version": "15.0.0",
3
+ "version": "15.0.1-beta.1",
4
4
  "description": "High-level API to interact with the Polymesh blockchain",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",