Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jacogr authored Dec 4, 2019
1 parent f78bf9d commit 64a4bb2
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 25 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# 0.98.1

- Make the TypeScript generation script mor re-usable (Thanks to @xlc)
- Add `.entries()` for all map-types, returning storage keys and values
- Add `.signAsync` to submittable extrinsics (Thanks to @c410-f3r)
- Cleanup circular references between internal dependencies
- Support for new Substrate democracy with preimages in derive
- Alignment of types with Substrate/Polkadot master branches

# 0.97.1

- **Breaking change** Add the passing on an explicit `Registry` to all calls to `createType` as well as all codec classes. If you are upgrading form an older version, use the [migration guide](UPGRADING.md) to walk through the changes required.
Expand Down
2 changes: 1 addition & 1 deletion UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This is an upgrade guide for users of the API. It does not attempt to detail eac
While we try to keep the user-facing interfaces as stable as possible, sometimes you just need to make additions to move forward and improve things down the road, as painful as they may be. Like you, we are also users of the API, and eat our own dog food - and as such, feel any pains introduced first.


## 0.97.1 (and newer), from 0.90.1 (and older)
## 0.97.1 (and newer)

The 0.97 series lays the groundwork to allow type registration to be ties to a specific chain and a specific Api instance. In the past, 2 Api instances in the same process would share types, which mean that you could not connect to 2 independent chains with different types. This is very problematic for Polkadot chains, where the idea is to connect to multiple chains.

Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"packages": [
"packages/*"
],
"version": "0.98.0-beta.10"
"version": "0.98.0"
}
4 changes: 2 additions & 2 deletions packages/api-contract/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@polkadot/api-contract",
"version": "0.98.0-beta.10",
"version": "0.98.0",
"description": "Interfaces for interacting with contracts and contract ABIs",
"main": "index.js",
"keywords": [
Expand All @@ -27,6 +27,6 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme",
"dependencies": {
"@babel/runtime": "^7.7.4",
"@polkadot/types": "^0.98.0-beta.10"
"@polkadot/types": "^0.98.0"
}
}
6 changes: 3 additions & 3 deletions packages/api-derive/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@polkadot/api-derive",
"version": "0.98.0-beta.10",
"version": "0.98.0",
"description": "Common functions used across Polkadot, derived from RPC calls and storage queries.",
"main": "index.js",
"keywords": [
Expand Down Expand Up @@ -28,8 +28,8 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-derive#readme",
"dependencies": {
"@babel/runtime": "^7.7.4",
"@polkadot/api": "^0.98.0-beta.10",
"@polkadot/types": "^0.98.0-beta.10"
"@polkadot/api": "^0.98.0",
"@polkadot/types": "^0.98.0"
},
"devDependencies": {
"@polkadot/keyring": "^1.7.1"
Expand Down
12 changes: 6 additions & 6 deletions packages/api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@polkadot/api",
"version": "0.98.0-beta.10",
"version": "0.98.0",
"description": "Promise and RxJS wrappers around the Polkadot JS RPC",
"main": "index.js",
"keywords": [
Expand All @@ -27,12 +27,12 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api#readme",
"dependencies": {
"@babel/runtime": "^7.7.4",
"@polkadot/api-derive": "^0.98.0-beta.10",
"@polkadot/api-derive": "^0.98.0",
"@polkadot/keyring": "^1.7.1",
"@polkadot/metadata": "^0.98.0-beta.10",
"@polkadot/rpc-core": "^0.98.0-beta.10",
"@polkadot/rpc-provider": "^0.98.0-beta.10",
"@polkadot/types": "^0.98.0-beta.10",
"@polkadot/metadata": "^0.98.0",
"@polkadot/rpc-core": "^0.98.0",
"@polkadot/rpc-provider": "^0.98.0",
"@polkadot/types": "^0.98.0",
"@polkadot/util-crypto": "^1.7.1"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/metadata/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@polkadot/metadata",
"version": "0.98.0-beta.10",
"version": "0.98.0",
"description": "Helpers to extract information from runtime metadata",
"main": "index.js",
"publishConfig": {
Expand All @@ -27,7 +27,7 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/type-metadata#readme",
"dependencies": {
"@babel/runtime": "^7.7.4",
"@polkadot/types": "^0.98.0-beta.10",
"@polkadot/types": "^0.98.0",
"@polkadot/util": "^1.7.1",
"@polkadot/util-crypto": "^1.7.1"
},
Expand Down
8 changes: 4 additions & 4 deletions packages/rpc-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@polkadot/rpc-core",
"version": "0.98.0-beta.10",
"version": "0.98.0",
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
"main": "index.js",
"keywords": [
Expand All @@ -27,9 +27,9 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-core#readme",
"dependencies": {
"@babel/runtime": "^7.7.4",
"@polkadot/jsonrpc": "^0.98.0-beta.10",
"@polkadot/rpc-provider": "^0.98.0-beta.10",
"@polkadot/types": "^0.98.0-beta.10",
"@polkadot/jsonrpc": "^0.98.0",
"@polkadot/rpc-provider": "^0.98.0",
"@polkadot/types": "^0.98.0",
"@polkadot/util": "^1.7.1",
"rxjs": "^6.5.3"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/rpc-provider/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@polkadot/rpc-provider",
"version": "0.98.0-beta.10",
"version": "0.98.0",
"description": "Transport providers for the API",
"main": "index.js",
"keywords": [
Expand All @@ -27,7 +27,7 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme",
"dependencies": {
"@babel/runtime": "^7.7.4",
"@polkadot/metadata": "^0.98.0-beta.10",
"@polkadot/metadata": "^0.98.0",
"@polkadot/util": "^1.7.1",
"@polkadot/util-crypto": "^1.7.1",
"eventemitter3": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/type-jsonrpc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@polkadot/jsonrpc",
"version": "0.98.0-beta.10",
"version": "0.98.0",
"description": "Method definitions for the Polkadot RPC layer",
"main": "index.js",
"publishConfig": {
Expand Down
4 changes: 2 additions & 2 deletions packages/types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@polkadot/types",
"version": "0.98.0-beta.10",
"version": "0.98.0",
"description": "Implementation of the Parity codec",
"main": "index.js",
"keywords": [
Expand All @@ -27,7 +27,7 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme",
"dependencies": {
"@babel/runtime": "^7.7.4",
"@polkadot/metadata": "^0.98.0-beta.10",
"@polkadot/metadata": "^0.98.0",
"@polkadot/util": "^1.7.1",
"@polkadot/util-crypto": "^1.7.1",
"@types/memoizee": "^0.4.3",
Expand Down
5 changes: 4 additions & 1 deletion packages/types/src/codec/create/createType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,12 @@ function initType<T extends Codec = Codec, K extends string = string> (registry:
// An unsafe version of the `createType` below. It's unsafe because the `type`
// argument here can be any string, which, if not parseable, will yield a
// runtime error.
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function createTypeUnsafe<T extends Codec = Codec, K extends string = string> (registry: Registry, type: K, params: any[] = [], isPedantic?: boolean): T {
try {
return initType(registry, createClass<T, K>(registry, type), params, isPedantic);
// Circle back to isPedenatic when it handles all cases 100% - as of now,
// it provides false wraning which is more hinderance than help
return initType(registry, createClass<T, K>(registry, type), params); // , isPedantic);
} catch (error) {
throw new Error(`createType(${type}):: ${error.message}`);
}
Expand Down

0 comments on commit 64a4bb2

Please sign in to comment.