diff --git a/package.json b/package.json index 7015e33f99..9d783d432e 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@babel/register": "^7.0.0", "@babel/runtime": "^7.3.4", "@polkadot/dev": "^0.25.12", - "@polkadot/ts": "^0.1.55", + "@polkadot/ts": "^0.1.56", "gh-pages": "^2.0.1" } } diff --git a/packages/api/package.json b/packages/api/package.json index e2771daaf8..4dbf265faf 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -36,6 +36,6 @@ "@polkadot/rpc-rx": "^0.46.4", "@polkadot/storage": "^0.46.4", "@polkadot/types": "^0.46.4", - "@polkadot/util-crypto": "^0.35.1" + "@polkadot/util-crypto": "^0.35.4" } } diff --git a/packages/rpc-core/package.json b/packages/rpc-core/package.json index 8a679234c5..e254d985ec 100644 --- a/packages/rpc-core/package.json +++ b/packages/rpc-core/package.json @@ -33,6 +33,6 @@ "@polkadot/jsonrpc": "^0.46.4", "@polkadot/rpc-provider": "^0.46.4", "@polkadot/types": "^0.46.4", - "@polkadot/util": "^0.35.1" + "@polkadot/util": "^0.35.4" } } diff --git a/packages/rpc-provider/package.json b/packages/rpc-provider/package.json index aafc3db620..3cd25d1eeb 100644 --- a/packages/rpc-provider/package.json +++ b/packages/rpc-provider/package.json @@ -30,10 +30,10 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme", "dependencies": { "@babel/runtime": "^7.3.4", - "@polkadot/keyring": "^0.35.1", + "@polkadot/keyring": "^0.35.4", "@polkadot/storage": "^0.46.4", - "@polkadot/util": "^0.35.1", - "@polkadot/util-crypto": "^0.35.1", + "@polkadot/util": "^0.35.4", + "@polkadot/util-crypto": "^0.35.4", "@types/nock": "^9.3.1", "eventemitter3": "^3.1.0", "isomorphic-fetch": "^2.2.1", diff --git a/packages/type-extrinsics/package.json b/packages/type-extrinsics/package.json index cb706240de..513d4cd71e 100644 --- a/packages/type-extrinsics/package.json +++ b/packages/type-extrinsics/package.json @@ -12,6 +12,6 @@ "dependencies": { "@babel/runtime": "^7.3.4", "@polkadot/types": "^0.46.4", - "@polkadot/util": "^0.35.1" + "@polkadot/util": "^0.35.4" } } diff --git a/packages/type-storage/package.json b/packages/type-storage/package.json index 6dae09bcbf..6fe12394fc 100644 --- a/packages/type-storage/package.json +++ b/packages/type-storage/package.json @@ -30,9 +30,9 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/type-storage#readme", "dependencies": { "@babel/runtime": "^7.3.4", - "@polkadot/keyring": "^0.35.1", + "@polkadot/keyring": "^0.35.4", "@polkadot/types": "^0.46.4", - "@polkadot/util": "^0.35.1", - "@polkadot/util-crypto": "^0.35.1" + "@polkadot/util": "^0.35.4", + "@polkadot/util-crypto": "^0.35.4" } } diff --git a/packages/types/package.json b/packages/types/package.json index 9a73fe9ed1..73c5d1399e 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -30,8 +30,8 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme", "dependencies": { "@babel/runtime": "^7.3.4", - "@polkadot/keyring": "^0.35.1", - "@polkadot/util": "^0.35.1", + "@polkadot/keyring": "^0.35.4", + "@polkadot/util": "^0.35.4", "core-js": "^2.6.5" } } diff --git a/packages/types/src/codec/Enum.ts b/packages/types/src/codec/Enum.ts index 083bb30e95..d6823c3b6c 100644 --- a/packages/types/src/codec/Enum.ts +++ b/packages/types/src/codec/Enum.ts @@ -65,6 +65,13 @@ export default class Enum extends Base implements Codec { return 1; } + /** + * @description Returns the index for this value (equivalent to toNumber) + */ + get index (): number { + return this.raw; + } + /** * @description Checks if the value is an empty value (always false) */ diff --git a/packages/types/src/codec/EnumType.ts b/packages/types/src/codec/EnumType.ts index 72caab3cc2..4e6b350e87 100644 --- a/packages/types/src/codec/EnumType.ts +++ b/packages/types/src/codec/EnumType.ts @@ -133,7 +133,7 @@ export default class EnumType extends Base implements Codec { * @description Checks if the Enum points to a [[Null]] type */ get isNone (): boolean { - return this.raw instanceof Null; + return this.isNull; } /** diff --git a/yarn.lock b/yarn.lock index f61b655968..bf84d7e509 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1429,14 +1429,14 @@ typescript "^3.3.3333" vuepress "^1.0.0-alpha.40" -"@polkadot/keyring@^0.35.1": - version "0.35.1" - resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-0.35.1.tgz#04a61da22eccee11d704911a719d9b29130bf1ea" - integrity sha512-jbKI7W/YO8YRo7Op7BaLypzERHwvNbkoWGLVHApS3TB2Jiog2lbMYAcZc7LdSJ/iJmq9qq32YwdW/X9enshmmw== +"@polkadot/keyring@^0.35.4": + version "0.35.4" + resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-0.35.4.tgz#c7a6eca79a53c0468fa2a32b4647e5866460f9de" + integrity sha512-muqVxGXigwW+ahQKBCDc0vdeOatP82vbcu4p7tz/LIzgfKmHX85JBWi63lcNTWljabJSRf9mqlf3jaU7L4OXlw== dependencies: "@babel/runtime" "^7.3.4" - "@polkadot/util" "^0.35.1" - "@polkadot/util-crypto" "^0.35.1" + "@polkadot/util" "^0.35.4" + "@polkadot/util-crypto" "^0.35.4" "@types/bs58" "^4.0.0" bs58 "^4.0.1" @@ -1445,19 +1445,19 @@ resolved "https://registry.yarnpkg.com/@polkadot/schnorrkel-js/-/schnorrkel-js-0.1.2-3.tgz#9117ac5126b465a1cf53c2b6bb68a17efc7e0390" integrity sha512-1LgF4wtER3q5uqY67CdOsQQ/SBqT6v0ZKQIS3cOTVByF16WtApD6U324uCJyMdie+GZFv0xr/40I4Ni2It+8jw== -"@polkadot/ts@^0.1.55": - version "0.1.55" - resolved "https://registry.yarnpkg.com/@polkadot/ts/-/ts-0.1.55.tgz#6bd5840035e8bde0e53932b136253e90398313b7" - integrity sha512-OWB9GTS3BUVY1VU5JtDnN02RytchS+nN5WJg/aLhGR1BMU4DNqef7rgDonhJEaEbZzlQ/j+S+colK/0MYzQ9Bw== +"@polkadot/ts@^0.1.56": + version "0.1.56" + resolved "https://registry.yarnpkg.com/@polkadot/ts/-/ts-0.1.56.tgz#ffd6e9c95704a7fb90b918193b9dc5c440114b27" + integrity sha512-wnt4zXxZXyz6WaubTO/I+nUElwV2DogFzdl6CrKfVn2PTWp8uHN06W9s40FH57ORtmQfDr9rLRP8Nq+oIyElbg== -"@polkadot/util-crypto@^0.35.1": - version "0.35.1" - resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-0.35.1.tgz#ffab577638f3f2e5344920664687fad31ab7e4a5" - integrity sha512-sicQrYAbaRPkcVAmGinE619e+CO5zwHgBLzLap9bWiKl5TDIjhnr1464yUFvDHcfVmyetsTBDEvqMVkUBhjL7w== +"@polkadot/util-crypto@^0.35.4": + version "0.35.4" + resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-0.35.4.tgz#f63d9a0fb1527b506e391ec77e51edcbfb5597f5" + integrity sha512-CsdP2u+OEzk7zIuptHY6OEJpCvamgb2p+n80qO3g+VCF9144ArB/UzOE1Zw0ixNHOs6Dj6M2qYUMZf8hUrIvAg== dependencies: "@babel/runtime" "^7.3.4" "@polkadot/schnorrkel-js" "^0.1.2-3" - "@polkadot/util" "^0.35.1" + "@polkadot/util" "^0.35.4" "@types/bip39" "^2.4.2" "@types/pbkdf2" "^3.0.0" "@types/secp256k1" "^3.5.0" @@ -1470,10 +1470,10 @@ tweetnacl "^1.0.1" xxhashjs "^0.2.2" -"@polkadot/util@^0.35.1": - version "0.35.1" - resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-0.35.1.tgz#77df48a38c67d7eee62f797673b74cdf8c145879" - integrity sha512-F5SFQNvEOEV3DInXUpjfwP22N2+W5yaFuo6gTB+7JyrqIU46V/ilqFgc8FG/I1EHDMnYuvdelNmij1XJli2YEQ== +"@polkadot/util@^0.35.4": + version "0.35.4" + resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-0.35.4.tgz#1e84ca76c08768b8ac7d73c84308c1d7d1077295" + integrity sha512-JhhfqDBcxHud3dlBt6xqDvnCS52mz7RN1QJOZMiOTrf12vyq3GN6NrEUcTOgiTGy3mUyB2t+5zx24VX8HrTeKA== dependencies: "@babel/runtime" "^7.3.4" "@types/bn.js" "^4.11.4"