Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d0e0008399 | ||
|
|
a6eeba83c1 | ||
|
|
541eceae82 | ||
|
|
3d0a1701fa | ||
|
|
0e46592f4d | ||
|
|
a561253de9 | ||
|
|
0c6a4754f0 | ||
|
|
60dd4e9699 | ||
|
|
f10f79c0ac | ||
|
|
8394c71cfa |
@@ -1,25 +0,0 @@
|
|||||||
// Copyright 2017-2023 @polkadot/api authors & contributors
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
const base = require('@polkadot/dev/config/eslint.cjs');
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
...base,
|
|
||||||
ignorePatterns: [
|
|
||||||
...base.ignorePatterns,
|
|
||||||
'/scripts'
|
|
||||||
],
|
|
||||||
parserOptions: {
|
|
||||||
...base.parserOptions,
|
|
||||||
project: [
|
|
||||||
'./tsconfig.eslint.json'
|
|
||||||
]
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
...base.rules,
|
|
||||||
// add override for any (a metric ton of them, initial conversion)
|
|
||||||
'@typescript-eslint/no-explicit-any': 'off',
|
|
||||||
// this seems very broken atm, false positives
|
|
||||||
'@typescript-eslint/unbound-method': 'off'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -21,5 +21,5 @@ jobs:
|
|||||||
- name: ${{ matrix.step }}
|
- name: ${{ matrix.step }}
|
||||||
if: always()
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
yarn install --immutable | grep -v 'YN0013'
|
yarn install --immutable
|
||||||
yarn ${{ matrix.step }}
|
yarn ${{ matrix.step }}
|
||||||
|
|||||||
@@ -27,5 +27,5 @@ jobs:
|
|||||||
node-version: 'lts/*'
|
node-version: 'lts/*'
|
||||||
- name: ${{ matrix.step }}
|
- name: ${{ matrix.step }}
|
||||||
run: |
|
run: |
|
||||||
yarn install --immutable | grep -v 'YN0013'
|
yarn install --immutable
|
||||||
yarn ${{ matrix.step }}
|
yarn ${{ matrix.step }}
|
||||||
|
|||||||
@@ -2,6 +2,11 @@ enableImmutableInstalls: false
|
|||||||
|
|
||||||
enableProgressBars: false
|
enableProgressBars: false
|
||||||
|
|
||||||
|
logFilters:
|
||||||
|
# Discard any "cannot be found in cache" messages
|
||||||
|
- code: YN0013
|
||||||
|
level: discard
|
||||||
|
|
||||||
nodeLinker: node-modules
|
nodeLinker: node-modules
|
||||||
|
|
||||||
plugins:
|
plugins:
|
||||||
|
|||||||
@@ -1,5 +1,16 @@
|
|||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
|
|
||||||
|
## 10.7.2 May 21, 2023
|
||||||
|
|
||||||
|
Contributed:
|
||||||
|
|
||||||
|
- Allow `api.setSigner(...)` to clear existing (Thanks to https://github.com/polymath-eric)
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Adjust `@polkadot/types-create` exports with no duplicates
|
||||||
|
|
||||||
|
|
||||||
## 10.7.1 May 13, 2023
|
## 10.7.1 May 13, 2023
|
||||||
|
|
||||||
Changes:
|
Changes:
|
||||||
|
|||||||
+2
-1
@@ -1,4 +1,4 @@
|
|||||||
3460 Jaco 10.7.1 (#5645)
|
3464 Jaco 10.7.2 (#5652)
|
||||||
83 Amaury Martiny StatementKind: Regular and Saft (#2303)
|
83 Amaury Martiny StatementKind: Regular and Saft (#2303)
|
||||||
37 Keith Ingram Update contract types and rpc (#4541)
|
37 Keith Ingram Update contract types and rpc (#4541)
|
||||||
35 Stefanie Doll Updated child storage parameters (#1709)
|
35 Stefanie Doll Updated child storage parameters (#1709)
|
||||||
@@ -98,6 +98,7 @@
|
|||||||
1 Paul M Fox Basic BTreeMaps codec support (#1474)
|
1 Paul M Fox Basic BTreeMaps codec support (#1474)
|
||||||
1 philipstanislaus Update types for centrifuge chain v1.2.0 (#2424)
|
1 philipstanislaus Update types for centrifuge chain v1.2.0 (#2424)
|
||||||
1 Pierre Krieger Update substrate/connect to 0.7.6 (#4940)
|
1 Pierre Krieger Update substrate/connect to 0.7.6 (#4940)
|
||||||
|
1 polymath-eric Allow unset external signer (#5649)
|
||||||
1 Qinxuan Chen Add fp_account::AccountId20 mapping (#5551)
|
1 Qinxuan Chen Add fp_account::AccountId20 mapping (#5551)
|
||||||
1 qiuhao update DeriveCustom type (#2581)
|
1 qiuhao update DeriveCustom type (#2581)
|
||||||
1 r0t0r-r0t0r Fix memory leak on raw rpc call (#4505)
|
1 r0t0r-r0t0r Fix memory leak on raw rpc call (#4505)
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
// Copyright 2017-2023 @polkadot/dev authors & contributors
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
import baseConfig from '@polkadot/dev/config/eslint';
|
||||||
|
|
||||||
|
export default [
|
||||||
|
...baseConfig,
|
||||||
|
{
|
||||||
|
rules: {
|
||||||
|
// add override for any (a metric ton of them, initial conversion)
|
||||||
|
'@typescript-eslint/no-explicit-any': 'off',
|
||||||
|
// we generally use this in isFunction, not via calling
|
||||||
|
'@typescript-eslint/unbound-method': 'off'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
];
|
||||||
+5
-5
@@ -14,10 +14,10 @@
|
|||||||
},
|
},
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "10.7.1",
|
"version": "10.7.2",
|
||||||
"versions": {
|
"versions": {
|
||||||
"git": "10.7.1",
|
"git": "10.7.2",
|
||||||
"npm": "10.7.1"
|
"npm": "10.7.2"
|
||||||
},
|
},
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"packages/*"
|
"packages/*"
|
||||||
@@ -40,9 +40,9 @@
|
|||||||
"test:one": "polkadot-dev-run-test --env node"
|
"test:one": "polkadot-dev-run-test --env node"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@polkadot/dev": "^0.73.17",
|
"@polkadot/dev": "^0.75.4",
|
||||||
"@polkadot/typegen": "workspace:packages/typegen",
|
"@polkadot/typegen": "workspace:packages/typegen",
|
||||||
"@types/node": "^20.1.3"
|
"@types/node": "^20.2.1"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"typescript": "^5.0.4"
|
"typescript": "^5.0.4"
|
||||||
|
|||||||
@@ -18,15 +18,15 @@
|
|||||||
"./detectPackage.cjs"
|
"./detectPackage.cjs"
|
||||||
],
|
],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "10.7.1",
|
"version": "10.7.2",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@polkadot/api-base": "10.7.1",
|
"@polkadot/api-base": "10.7.2",
|
||||||
"@polkadot/rpc-augment": "10.7.1",
|
"@polkadot/rpc-augment": "10.7.2",
|
||||||
"@polkadot/types": "10.7.1",
|
"@polkadot/types": "10.7.2",
|
||||||
"@polkadot/types-augment": "10.7.1",
|
"@polkadot/types-augment": "10.7.2",
|
||||||
"@polkadot/types-codec": "10.7.1",
|
"@polkadot/types-codec": "10.7.2",
|
||||||
"@polkadot/util": "^12.2.1",
|
"@polkadot/util": "^12.2.1",
|
||||||
"tslib": "^2.5.0"
|
"tslib": "^2.5.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '10.7.1' };
|
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '10.7.2' };
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"**/*.spec.ts",
|
"**/*.spec.ts",
|
||||||
|
"**/mod.ts",
|
||||||
"**/kusama/*.ts",
|
"**/kusama/*.ts",
|
||||||
"**/polkadot/*.ts"
|
"**/polkadot/*.ts"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../tsconfig.base.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"baseUrl": "..",
|
|
||||||
"outDir": "./build",
|
|
||||||
"rootDir": "./src",
|
|
||||||
"emitDeclarationOnly": false,
|
|
||||||
"noEmit": true
|
|
||||||
},
|
|
||||||
"include": [
|
|
||||||
"**/kusama/*.spec.ts"
|
|
||||||
],
|
|
||||||
"references": [
|
|
||||||
{ "path": "../api-augment/tsconfig.build.json" },
|
|
||||||
{ "path": "../api-augment/tsconfig.kusama.json" },
|
|
||||||
{ "path": "../api-base/tsconfig.build.json" },
|
|
||||||
{ "path": "../rpc-augment/tsconfig.build.json" },
|
|
||||||
{ "path": "../types/tsconfig.build.json" },
|
|
||||||
{ "path": "../types-augment/tsconfig.build.json" },
|
|
||||||
{ "path": "../types-support/tsconfig.build.json" }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -18,13 +18,13 @@
|
|||||||
"./detectPackage.cjs"
|
"./detectPackage.cjs"
|
||||||
],
|
],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "10.7.1",
|
"version": "10.7.2",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@polkadot/rpc-core": "10.7.1",
|
"@polkadot/rpc-core": "10.7.2",
|
||||||
"@polkadot/types": "10.7.1",
|
"@polkadot/types": "10.7.2",
|
||||||
"@polkadot/util": "^12.2.1",
|
"@polkadot/util": "^12.2.1",
|
||||||
"rxjs": "^7.8.1",
|
"rxjs": "^7.8.1",
|
||||||
"tslib": "^2.5.0"
|
"tslib": "^2.5.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '10.7.1' };
|
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '10.7.2' };
|
||||||
|
|||||||
@@ -5,6 +5,9 @@
|
|||||||
"outDir": "./build",
|
"outDir": "./build",
|
||||||
"rootDir": "./src"
|
"rootDir": "./src"
|
||||||
},
|
},
|
||||||
|
"exclude": [
|
||||||
|
"**/mod.ts"
|
||||||
|
],
|
||||||
"references": [
|
"references": [
|
||||||
{ "path": "../rpc-core/tsconfig.build.json" },
|
{ "path": "../rpc-core/tsconfig.build.json" },
|
||||||
{ "path": "../types/tsconfig.build.json" }
|
{ "path": "../types/tsconfig.build.json" }
|
||||||
|
|||||||
@@ -18,20 +18,20 @@
|
|||||||
"./detectPackage.cjs"
|
"./detectPackage.cjs"
|
||||||
],
|
],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "10.7.1",
|
"version": "10.7.2",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@polkadot/api": "10.7.1",
|
"@polkadot/api": "10.7.2",
|
||||||
"@polkadot/types": "10.7.1",
|
"@polkadot/types": "10.7.2",
|
||||||
"@polkadot/types-codec": "10.7.1",
|
"@polkadot/types-codec": "10.7.2",
|
||||||
"@polkadot/types-create": "10.7.1",
|
"@polkadot/types-create": "10.7.2",
|
||||||
"@polkadot/util": "^12.2.1",
|
"@polkadot/util": "^12.2.1",
|
||||||
"@polkadot/util-crypto": "^12.2.1",
|
"@polkadot/util-crypto": "^12.2.1",
|
||||||
"rxjs": "^7.8.1",
|
"rxjs": "^7.8.1",
|
||||||
"tslib": "^2.5.0"
|
"tslib": "^2.5.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@polkadot/api-augment": "10.7.1",
|
"@polkadot/api-augment": "10.7.2",
|
||||||
"@polkadot/keyring": "^12.2.1"
|
"@polkadot/keyring": "^12.2.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '10.7.1' };
|
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '10.7.2' };
|
||||||
|
|||||||
@@ -6,11 +6,10 @@
|
|||||||
"rootDir": "./src"
|
"rootDir": "./src"
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"**/test/**/*.json",
|
"**/test/**/*",
|
||||||
"**/test/**/*.ts",
|
|
||||||
"**/test/**/*.wasm",
|
|
||||||
"**/checkTypes.manual.ts",
|
|
||||||
"**/*.spec.ts",
|
"**/*.spec.ts",
|
||||||
|
"**/checkTypes.manual.ts",
|
||||||
|
"**/mod.ts",
|
||||||
"mock.ts"
|
"mock.ts"
|
||||||
],
|
],
|
||||||
"references": [
|
"references": [
|
||||||
|
|||||||
@@ -18,25 +18,25 @@
|
|||||||
"./detectPackage.cjs"
|
"./detectPackage.cjs"
|
||||||
],
|
],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "10.7.1",
|
"version": "10.7.2",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@polkadot/api": "10.7.1",
|
"@polkadot/api": "10.7.2",
|
||||||
"@polkadot/api-augment": "10.7.1",
|
"@polkadot/api-augment": "10.7.2",
|
||||||
"@polkadot/api-base": "10.7.1",
|
"@polkadot/api-base": "10.7.2",
|
||||||
"@polkadot/rpc-core": "10.7.1",
|
"@polkadot/rpc-core": "10.7.2",
|
||||||
"@polkadot/types": "10.7.1",
|
"@polkadot/types": "10.7.2",
|
||||||
"@polkadot/types-codec": "10.7.1",
|
"@polkadot/types-codec": "10.7.2",
|
||||||
"@polkadot/util": "^12.2.1",
|
"@polkadot/util": "^12.2.1",
|
||||||
"@polkadot/util-crypto": "^12.2.1",
|
"@polkadot/util-crypto": "^12.2.1",
|
||||||
"rxjs": "^7.8.1",
|
"rxjs": "^7.8.1",
|
||||||
"tslib": "^2.5.0"
|
"tslib": "^2.5.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@polkadot/api": "10.7.1",
|
"@polkadot/api": "10.7.2",
|
||||||
"@polkadot/api-augment": "10.7.1",
|
"@polkadot/api-augment": "10.7.2",
|
||||||
"@polkadot/rpc-augment": "10.7.1",
|
"@polkadot/rpc-augment": "10.7.2",
|
||||||
"@polkadot/rpc-provider": "10.7.1",
|
"@polkadot/rpc-provider": "10.7.2",
|
||||||
"@polkadot/types-support": "10.7.1"
|
"@polkadot/types-support": "10.7.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '10.7.1' };
|
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '10.7.2' };
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
"exclude": [
|
"exclude": [
|
||||||
"**/test/*",
|
"**/test/*",
|
||||||
"**/checkTypes.manual.ts",
|
"**/checkTypes.manual.ts",
|
||||||
|
"**/mod.ts",
|
||||||
"**/*.spec.ts"
|
"**/*.spec.ts"
|
||||||
],
|
],
|
||||||
"references": [
|
"references": [
|
||||||
|
|||||||
+15
-15
@@ -18,29 +18,29 @@
|
|||||||
"./detectPackage.cjs"
|
"./detectPackage.cjs"
|
||||||
],
|
],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "10.7.1",
|
"version": "10.7.2",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@polkadot/api-augment": "10.7.1",
|
"@polkadot/api-augment": "10.7.2",
|
||||||
"@polkadot/api-base": "10.7.1",
|
"@polkadot/api-base": "10.7.2",
|
||||||
"@polkadot/api-derive": "10.7.1",
|
"@polkadot/api-derive": "10.7.2",
|
||||||
"@polkadot/keyring": "^12.2.1",
|
"@polkadot/keyring": "^12.2.1",
|
||||||
"@polkadot/rpc-augment": "10.7.1",
|
"@polkadot/rpc-augment": "10.7.2",
|
||||||
"@polkadot/rpc-core": "10.7.1",
|
"@polkadot/rpc-core": "10.7.2",
|
||||||
"@polkadot/rpc-provider": "10.7.1",
|
"@polkadot/rpc-provider": "10.7.2",
|
||||||
"@polkadot/types": "10.7.1",
|
"@polkadot/types": "10.7.2",
|
||||||
"@polkadot/types-augment": "10.7.1",
|
"@polkadot/types-augment": "10.7.2",
|
||||||
"@polkadot/types-codec": "10.7.1",
|
"@polkadot/types-codec": "10.7.2",
|
||||||
"@polkadot/types-create": "10.7.1",
|
"@polkadot/types-create": "10.7.2",
|
||||||
"@polkadot/types-known": "10.7.1",
|
"@polkadot/types-known": "10.7.2",
|
||||||
"@polkadot/util": "^12.2.1",
|
"@polkadot/util": "^12.2.1",
|
||||||
"@polkadot/util-crypto": "^12.2.1",
|
"@polkadot/util-crypto": "^12.2.1",
|
||||||
"eventemitter3": "^5.0.1",
|
"eventemitter3": "^5.0.1",
|
||||||
"rxjs": "^7.8.1",
|
"rxjs": "^7.8.1",
|
||||||
"tslib": "^2.5.0"
|
"tslib": "^2.5.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@polkadot/api-augment": "10.7.1",
|
"@polkadot/api-augment": "10.7.2",
|
||||||
"@polkadot/types-support": "10.7.1"
|
"@polkadot/types-support": "10.7.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ export abstract class ApiBase<ApiType extends ApiTypes> extends Getters<ApiType>
|
|||||||
/**
|
/**
|
||||||
* @description Set an external signer which will be used to sign extrinsic when account passed in is not KeyringPair
|
* @description Set an external signer which will be used to sign extrinsic when account passed in is not KeyringPair
|
||||||
*/
|
*/
|
||||||
public setSigner (signer: Signer): void {
|
public setSigner (signer: Signer | undefined): void {
|
||||||
this._rx.signer = signer;
|
this._rx.signer = signer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '10.7.1' };
|
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '10.7.2' };
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ describe('Combinator', (): void => {
|
|||||||
fns = [];
|
fns = [];
|
||||||
});
|
});
|
||||||
|
|
||||||
it('it triggers on all values', async (): Promise<void> => {
|
it('triggers on all values', async (): Promise<void> => {
|
||||||
await new Promise<boolean>((resolve) => {
|
await new Promise<boolean>((resolve) => {
|
||||||
let count = 0;
|
let count = 0;
|
||||||
const combinator = new Combinator(
|
const combinator = new Combinator(
|
||||||
@@ -90,6 +90,7 @@ describe('Combinator', (): void => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// eslint-disable-next-line jest/expect-expect
|
||||||
it('unsubscribes as required', async (): Promise<void> => {
|
it('unsubscribes as required', async (): Promise<void> => {
|
||||||
await new Promise<void>((resolve) => {
|
await new Promise<void>((resolve) => {
|
||||||
// eslint-disable-next-line @typescript-eslint/require-await
|
// eslint-disable-next-line @typescript-eslint/require-await
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ describe('ApiPromise', (): void => {
|
|||||||
await api.disconnect();
|
await api.disconnect();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// eslint-disable-next-line jest/expect-expect
|
||||||
it('Create API instance will error on failure to await ready', async (): Promise<void> => {
|
it('Create API instance will error on failure to await ready', async (): Promise<void> => {
|
||||||
class ErrorApiPromise extends ApiPromise {
|
class ErrorApiPromise extends ApiPromise {
|
||||||
constructor () {
|
constructor () {
|
||||||
|
|||||||
@@ -25,12 +25,19 @@ export type { Signer, SignerResult } from '@polkadot/types/types';
|
|||||||
export { ApiBase } from '../base/index.js';
|
export { ApiBase } from '../base/index.js';
|
||||||
|
|
||||||
// all starred
|
// all starred
|
||||||
|
// eslint-disable-next-line import/export
|
||||||
export * from '@polkadot/api/types/calls';
|
export * from '@polkadot/api/types/calls';
|
||||||
|
// eslint-disable-next-line import/export
|
||||||
export * from '@polkadot/api/types/consts';
|
export * from '@polkadot/api/types/consts';
|
||||||
|
// eslint-disable-next-line import/export
|
||||||
export * from '@polkadot/api/types/errors';
|
export * from '@polkadot/api/types/errors';
|
||||||
|
// eslint-disable-next-line import/export
|
||||||
export * from '@polkadot/api/types/events';
|
export * from '@polkadot/api/types/events';
|
||||||
|
// eslint-disable-next-line import/export
|
||||||
export * from '@polkadot/api/types/storage';
|
export * from '@polkadot/api/types/storage';
|
||||||
|
// eslint-disable-next-line import/export
|
||||||
export * from '@polkadot/api/types/submittable';
|
export * from '@polkadot/api/types/submittable';
|
||||||
|
// eslint-disable-next-line import/export
|
||||||
export * from '@polkadot/api-base/types';
|
export * from '@polkadot/api-base/types';
|
||||||
|
|
||||||
// A smaller interface of ApiRx, used in derive and in SubmittableExtrinsic
|
// A smaller interface of ApiRx, used in derive and in SubmittableExtrinsic
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ describe('extractStorageArgs', (): void => {
|
|||||||
).toThrow('staking.payee(AccountId32) is a map, requiring 1 arguments, 0 found');
|
).toThrow('staking.payee(AccountId32) is a map, requiring 1 arguments, 0 found');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('validates map, 1 arg (failing with no args)', (): void => {
|
it('validates map, 1 arg (failing with more args)', (): void => {
|
||||||
expect(
|
expect(
|
||||||
() => extractStorageArgs(registry, storage.staking.payee, ['abc', 'def'])
|
() => extractStorageArgs(registry, storage.staking.payee, ['abc', 'def'])
|
||||||
).toThrow('staking.payee(AccountId32) is a map, requiring 1 arguments, 2 found');
|
).toThrow('staking.payee(AccountId32) is a map, requiring 1 arguments, 2 found');
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"**/checkTypes.manual.ts",
|
"**/checkTypes.manual.ts",
|
||||||
|
"**/mod.ts",
|
||||||
"**/*.spec.ts",
|
"**/*.spec.ts",
|
||||||
"**/test/**/*"
|
"**/test/**/*"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -18,13 +18,13 @@
|
|||||||
"./detectPackage.cjs"
|
"./detectPackage.cjs"
|
||||||
],
|
],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "10.7.1",
|
"version": "10.7.2",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@polkadot/rpc-core": "10.7.1",
|
"@polkadot/rpc-core": "10.7.2",
|
||||||
"@polkadot/types": "10.7.1",
|
"@polkadot/types": "10.7.2",
|
||||||
"@polkadot/types-codec": "10.7.1",
|
"@polkadot/types-codec": "10.7.2",
|
||||||
"@polkadot/util": "^12.2.1",
|
"@polkadot/util": "^12.2.1",
|
||||||
"tslib": "^2.5.0"
|
"tslib": "^2.5.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '10.7.1' };
|
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '10.7.2' };
|
||||||
|
|||||||
@@ -5,6 +5,9 @@
|
|||||||
"outDir": "./build",
|
"outDir": "./build",
|
||||||
"rootDir": "./src"
|
"rootDir": "./src"
|
||||||
},
|
},
|
||||||
|
"exclude": [
|
||||||
|
"**/mod.ts"
|
||||||
|
],
|
||||||
"references": [
|
"references": [
|
||||||
{ "path": "../rpc-core/tsconfig.build.json" },
|
{ "path": "../rpc-core/tsconfig.build.json" },
|
||||||
{ "path": "../types/tsconfig.build.json" },
|
{ "path": "../types/tsconfig.build.json" },
|
||||||
|
|||||||
@@ -18,18 +18,18 @@
|
|||||||
"./detectPackage.cjs"
|
"./detectPackage.cjs"
|
||||||
],
|
],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "10.7.1",
|
"version": "10.7.2",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@polkadot/rpc-augment": "10.7.1",
|
"@polkadot/rpc-augment": "10.7.2",
|
||||||
"@polkadot/rpc-provider": "10.7.1",
|
"@polkadot/rpc-provider": "10.7.2",
|
||||||
"@polkadot/types": "10.7.1",
|
"@polkadot/types": "10.7.2",
|
||||||
"@polkadot/util": "^12.2.1",
|
"@polkadot/util": "^12.2.1",
|
||||||
"rxjs": "^7.8.1",
|
"rxjs": "^7.8.1",
|
||||||
"tslib": "^2.5.0"
|
"tslib": "^2.5.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@polkadot/keyring": "^12.2.1",
|
"@polkadot/keyring": "^12.2.1",
|
||||||
"@polkadot/rpc-augment": "10.7.1"
|
"@polkadot/rpc-augment": "10.7.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '10.7.1' };
|
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '10.7.2' };
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ describe('replay', (): void => {
|
|||||||
await new Promise<boolean>((resolve) => {
|
await new Promise<boolean>((resolve) => {
|
||||||
rpc.system.chain().subscribe((value: any): void => {
|
rpc.system.chain().subscribe((value: any): void => {
|
||||||
if (value) {
|
if (value) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access, jest/no-conditional-expect
|
||||||
expect(value.toString()).toEqual('mockChain'); // Defined in MockProvider
|
expect(value.toString()).toEqual('mockChain'); // Defined in MockProvider
|
||||||
resolve(true);
|
resolve(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"**/checkTypes.manual.ts",
|
"**/checkTypes.manual.ts",
|
||||||
|
"**/mod.ts",
|
||||||
"**/*.spec.ts"
|
"**/*.spec.ts"
|
||||||
],
|
],
|
||||||
"references": [
|
"references": [
|
||||||
|
|||||||
@@ -18,12 +18,12 @@
|
|||||||
"./detectPackage.cjs"
|
"./detectPackage.cjs"
|
||||||
],
|
],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "10.7.1",
|
"version": "10.7.2",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@polkadot/keyring": "^12.2.1",
|
"@polkadot/keyring": "^12.2.1",
|
||||||
"@polkadot/types": "10.7.1",
|
"@polkadot/types": "10.7.2",
|
||||||
"@polkadot/types-support": "10.7.1",
|
"@polkadot/types-support": "10.7.2",
|
||||||
"@polkadot/util": "^12.2.1",
|
"@polkadot/util": "^12.2.1",
|
||||||
"@polkadot/util-crypto": "^12.2.1",
|
"@polkadot/util-crypto": "^12.2.1",
|
||||||
"@polkadot/x-fetch": "^12.2.1",
|
"@polkadot/x-fetch": "^12.2.1",
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
"eventemitter3": "^5.0.1",
|
"eventemitter3": "^5.0.1",
|
||||||
"mock-socket": "^9.2.1",
|
"mock-socket": "^9.2.1",
|
||||||
"nock": "^13.3.1",
|
"nock": "^13.3.1",
|
||||||
"tslib": "^2.5.0"
|
"tslib": "^2.5.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@substrate/connect": "0.7.26"
|
"@substrate/connect": "0.7.26"
|
||||||
|
|||||||
@@ -45,14 +45,17 @@ describe('Http', (): void => {
|
|||||||
|
|
||||||
it('does not (yet) support subscribe', async (): Promise<void> => {
|
it('does not (yet) support subscribe', async (): Promise<void> => {
|
||||||
await http.subscribe('', '', [], (cb): void => {
|
await http.subscribe('', '', [], (cb): void => {
|
||||||
|
// eslint-disable-next-line jest/no-conditional-expect
|
||||||
expect(cb).toEqual(expect.anything());
|
expect(cb).toEqual(expect.anything());
|
||||||
}).catch((error): void => {
|
}).catch((error): void => {
|
||||||
|
// eslint-disable-next-line jest/no-conditional-expect
|
||||||
expect((error as Error).message).toMatch(/does not have subscriptions/);
|
expect((error as Error).message).toMatch(/does not have subscriptions/);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('does not (yet) support unsubscribe', async (): Promise<void> => {
|
it('does not (yet) support unsubscribe', async (): Promise<void> => {
|
||||||
await http.unsubscribe('', '', 0).catch((error): void => {
|
await http.unsubscribe('', '', 0).catch((error): void => {
|
||||||
|
// eslint-disable-next-line jest/no-conditional-expect
|
||||||
expect((error as Error).message).toMatch(/does not have subscriptions/);
|
expect((error as Error).message).toMatch(/does not have subscriptions/);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import { HttpProvider } from './index.js';
|
|||||||
|
|
||||||
// Does not work with Node 18 (native fetch)
|
// Does not work with Node 18 (native fetch)
|
||||||
// See https://github.com/nock/nock/issues/2397
|
// See https://github.com/nock/nock/issues/2397
|
||||||
|
// eslint-disable-next-line jest/no-disabled-tests
|
||||||
describe.skip('send', (): void => {
|
describe.skip('send', (): void => {
|
||||||
let http: HttpProvider;
|
let http: HttpProvider;
|
||||||
let mock: Mock;
|
let mock: Mock;
|
||||||
@@ -53,6 +54,7 @@ describe.skip('send', (): void => {
|
|||||||
return http
|
return http
|
||||||
.send('test_error', [])
|
.send('test_error', [])
|
||||||
.catch((error): void => {
|
.catch((error): void => {
|
||||||
|
// eslint-disable-next-line jest/no-conditional-expect
|
||||||
expect((error as Error).message).toMatch(/\[500\]/);
|
expect((error as Error).message).toMatch(/\[500\]/);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ describe('on', (): void => {
|
|||||||
await mock.disconnect();
|
await mock.disconnect();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('it emits both connected and disconnected events', async (): Promise<void> => {
|
// eslint-disable-next-line jest/expect-expect
|
||||||
|
it('emits both connected and disconnected events', async (): Promise<void> => {
|
||||||
const events: Record<string, boolean> = { connected: false, disconnected: false };
|
const events: Record<string, boolean> = { connected: false, disconnected: false };
|
||||||
|
|
||||||
await new Promise<boolean>((resolve) => {
|
await new Promise<boolean>((resolve) => {
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ describe('send', (): void => {
|
|||||||
return mock
|
return mock
|
||||||
.send('something_invalid', [])
|
.send('something_invalid', [])
|
||||||
.catch((error): void => {
|
.catch((error): void => {
|
||||||
|
// eslint-disable-next-line jest/no-conditional-expect
|
||||||
expect((error as Error).message).toMatch(/Invalid method/);
|
expect((error as Error).message).toMatch(/Invalid method/);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ describe('subscribe', (): void => {
|
|||||||
await mock
|
await mock
|
||||||
.subscribe('test', 'test_notFound')
|
.subscribe('test', 'test_notFound')
|
||||||
.catch((error): void => {
|
.catch((error): void => {
|
||||||
|
// eslint-disable-next-line jest/no-conditional-expect
|
||||||
expect((error as Error).message).toMatch(/Invalid method 'test_notFound'/);
|
expect((error as Error).message).toMatch(/Invalid method 'test_notFound'/);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -41,12 +42,14 @@ describe('subscribe', (): void => {
|
|||||||
|
|
||||||
await new Promise<boolean>((resolve) => {
|
await new Promise<boolean>((resolve) => {
|
||||||
mock.subscribe('chain_newHead', 'chain_subscribeNewHead', (_: any, value: string): void => {
|
mock.subscribe('chain_newHead', 'chain_subscribeNewHead', (_: any, value: string): void => {
|
||||||
|
// eslint-disable-next-line jest/no-conditional-expect
|
||||||
expect(value).toEqual('testValue');
|
expect(value).toEqual('testValue');
|
||||||
resolve(true);
|
resolve(true);
|
||||||
}).catch(console.error);
|
}).catch(console.error);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// eslint-disable-next-line jest/expect-expect
|
||||||
it('calls back with new headers', async (): Promise<void> => {
|
it('calls back with new headers', async (): Promise<void> => {
|
||||||
await new Promise<boolean>((resolve) => {
|
await new Promise<boolean>((resolve) => {
|
||||||
mock.subscribe('chain_newHead', 'chain_subscribeNewHead', (_: any, header: { number: number }): void => {
|
mock.subscribe('chain_newHead', 'chain_subscribeNewHead', (_: any, header: { number: number }): void => {
|
||||||
@@ -57,6 +60,7 @@ describe('subscribe', (): void => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// eslint-disable-next-line jest/expect-expect
|
||||||
it('handles errors within callbacks gracefully', async (): Promise<void> => {
|
it('handles errors within callbacks gracefully', async (): Promise<void> => {
|
||||||
let hasThrown = false;
|
let hasThrown = false;
|
||||||
|
|
||||||
|
|||||||
@@ -30,12 +30,14 @@ describe('unsubscribe', (): void => {
|
|||||||
await mock
|
await mock
|
||||||
.unsubscribe('chain_newHead', 'chain_subscribeNewHead', 5)
|
.unsubscribe('chain_newHead', 'chain_subscribeNewHead', 5)
|
||||||
.catch((error): boolean => {
|
.catch((error): boolean => {
|
||||||
|
// eslint-disable-next-line jest/no-conditional-expect
|
||||||
expect((error as Error).message).toMatch(/Unable to find/);
|
expect((error as Error).message).toMatch(/Unable to find/);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// eslint-disable-next-line jest/expect-expect
|
||||||
it('unsubscribes successfully', async (): Promise<void> => {
|
it('unsubscribes successfully', async (): Promise<void> => {
|
||||||
await mock.unsubscribe('chain_newHead', 'chain_subscribeNewHead', id);
|
await mock.unsubscribe('chain_newHead', 'chain_subscribeNewHead', id);
|
||||||
});
|
});
|
||||||
@@ -46,6 +48,7 @@ describe('unsubscribe', (): void => {
|
|||||||
mock.unsubscribe('chain_newHead', 'chain_subscribeNewHead', id)
|
mock.unsubscribe('chain_newHead', 'chain_subscribeNewHead', id)
|
||||||
)
|
)
|
||||||
.catch((error): boolean => {
|
.catch((error): boolean => {
|
||||||
|
// eslint-disable-next-line jest/no-conditional-expect
|
||||||
expect((error as Error).message).toMatch(/Unable to find/);
|
expect((error as Error).message).toMatch(/Unable to find/);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '10.7.1' };
|
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '10.7.2' };
|
||||||
|
|||||||
@@ -321,6 +321,7 @@ describe('ScProvider', () => {
|
|||||||
expect(chain._isTerminated()).toBe(true);
|
expect(chain._isTerminated()).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// eslint-disable-next-line jest/expect-expect
|
||||||
it('does not throw when disconnecting on an already disconnected Provider', async () => {
|
it('does not throw when disconnecting on an already disconnected Provider', async () => {
|
||||||
const provider = new ScProvider(mockSc, '');
|
const provider = new ScProvider(mockSc, '');
|
||||||
|
|
||||||
|
|||||||
@@ -39,10 +39,12 @@ describe('Ws', (): void => {
|
|||||||
).toEqual(false);
|
).toEqual(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// eslint-disable-next-line jest/expect-expect
|
||||||
it('allows you to initialize the provider with custom headers', () => {
|
it('allows you to initialize the provider with custom headers', () => {
|
||||||
createWs([], 100, { foo: 'bar' });
|
createWs([], 100, { foo: 'bar' });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// eslint-disable-next-line jest/expect-expect
|
||||||
it('allows you to set custom timeout value for handlers', () => {
|
it('allows you to set custom timeout value for handlers', () => {
|
||||||
const CUSTOM_TIMEOUT_S = 90;
|
const CUSTOM_TIMEOUT_S = 90;
|
||||||
const CUSTOM_TIMEOUT_MS = CUSTOM_TIMEOUT_S * 1000;
|
const CUSTOM_TIMEOUT_MS = CUSTOM_TIMEOUT_S * 1000;
|
||||||
@@ -52,6 +54,7 @@ describe('Ws', (): void => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('Endpoint Parsing', (): void => {
|
describe('Endpoint Parsing', (): void => {
|
||||||
|
// eslint-disable-next-line jest/expect-expect
|
||||||
it('Succeeds when WsProvider endpoint is a valid string', () => {
|
it('Succeeds when WsProvider endpoint is a valid string', () => {
|
||||||
/* eslint-disable no-new */
|
/* eslint-disable no-new */
|
||||||
new WsProvider(TEST_WS_URL, 0);
|
new WsProvider(TEST_WS_URL, 0);
|
||||||
@@ -63,6 +66,7 @@ describe('Endpoint Parsing', (): void => {
|
|||||||
).toThrow(/^Endpoint should start with /);
|
).toThrow(/^Endpoint should start with /);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// eslint-disable-next-line jest/expect-expect
|
||||||
it('Succeeds when WsProvider endpoint is a valid array', () => {
|
it('Succeeds when WsProvider endpoint is a valid array', () => {
|
||||||
const endpoints: string[] = ['ws://127.0.0.1:9955', 'wss://testnet.io:9944', 'ws://mychain.com:9933'];
|
const endpoints: string[] = ['ws://127.0.0.1:9955', 'wss://testnet.io:9944', 'ws://mychain.com:9933'];
|
||||||
|
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ describe('send', (): void => {
|
|||||||
ws
|
ws
|
||||||
.send('test_encoding', [{ error: 'send error' }])
|
.send('test_encoding', [{ error: 'send error' }])
|
||||||
.catch((error): void => {
|
.catch((error): void => {
|
||||||
|
// eslint-disable-next-line jest/no-conditional-expect
|
||||||
expect((error as Error).message).toEqual('send error');
|
expect((error as Error).message).toEqual('send error');
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
@@ -99,6 +100,7 @@ describe('send', (): void => {
|
|||||||
ws
|
ws
|
||||||
.send('test_error', [])
|
.send('test_error', [])
|
||||||
.catch((error): void => {
|
.catch((error): void => {
|
||||||
|
// eslint-disable-next-line jest/no-conditional-expect
|
||||||
expect((error as Error).message).toMatch(/666: error/);
|
expect((error as Error).message).toMatch(/666: error/);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -7,7 +7,8 @@
|
|||||||
"resolveJsonModule": true
|
"resolveJsonModule": true
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"**/*.spec.ts"
|
"**/*.spec.ts",
|
||||||
|
"**/mod.ts"
|
||||||
],
|
],
|
||||||
"references": [
|
"references": [
|
||||||
{ "path": "../types/tsconfig.build.json" },
|
{ "path": "../types/tsconfig.build.json" },
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
"baseUrl": "..",
|
"baseUrl": "..",
|
||||||
"outDir": "./build",
|
"outDir": "./build",
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"resolveJsonModule": true,
|
|
||||||
"emitDeclarationOnly": false,
|
"emitDeclarationOnly": false,
|
||||||
|
"resolveJsonModule": true,
|
||||||
"noEmit": true
|
"noEmit": true
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
"./detectPackage.cjs"
|
"./detectPackage.cjs"
|
||||||
],
|
],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "10.7.1",
|
"version": "10.7.2",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.mjs",
|
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.mjs",
|
||||||
@@ -28,20 +28,20 @@
|
|||||||
"polkadot-types-internal-metadata": "./scripts/polkadot-types-internal-metadata.mjs"
|
"polkadot-types-internal-metadata": "./scripts/polkadot-types-internal-metadata.mjs"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@polkadot/api": "10.7.1",
|
"@polkadot/api": "10.7.2",
|
||||||
"@polkadot/api-augment": "10.7.1",
|
"@polkadot/api-augment": "10.7.2",
|
||||||
"@polkadot/rpc-augment": "10.7.1",
|
"@polkadot/rpc-augment": "10.7.2",
|
||||||
"@polkadot/rpc-provider": "10.7.1",
|
"@polkadot/rpc-provider": "10.7.2",
|
||||||
"@polkadot/types": "10.7.1",
|
"@polkadot/types": "10.7.2",
|
||||||
"@polkadot/types-augment": "10.7.1",
|
"@polkadot/types-augment": "10.7.2",
|
||||||
"@polkadot/types-codec": "10.7.1",
|
"@polkadot/types-codec": "10.7.2",
|
||||||
"@polkadot/types-create": "10.7.1",
|
"@polkadot/types-create": "10.7.2",
|
||||||
"@polkadot/types-support": "10.7.1",
|
"@polkadot/types-support": "10.7.2",
|
||||||
"@polkadot/util": "^12.2.1",
|
"@polkadot/util": "^12.2.1",
|
||||||
"@polkadot/util-crypto": "^12.2.1",
|
"@polkadot/util-crypto": "^12.2.1",
|
||||||
"@polkadot/x-ws": "^12.2.1",
|
"@polkadot/x-ws": "^12.2.1",
|
||||||
"handlebars": "^4.7.7",
|
"handlebars": "^4.7.7",
|
||||||
"tslib": "^2.5.0",
|
"tslib": "^2.5.2",
|
||||||
"yargs": "^17.7.2"
|
"yargs": "^17.7.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '10.7.1' };
|
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '10.7.2' };
|
||||||
|
|||||||
@@ -8,3 +8,6 @@ import { readTemplate } from './file.js';
|
|||||||
Handlebars.registerPartial({
|
Handlebars.registerPartial({
|
||||||
docs: Handlebars.compile(readTemplate('docs'))
|
docs: Handlebars.compile(readTemplate('docs'))
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// empty export
|
||||||
|
export const __TYPEGEN_DUMMY_DOCS = 'DUMMY_DOCS';
|
||||||
|
|||||||
@@ -5,6 +5,14 @@
|
|||||||
"outDir": "./build",
|
"outDir": "./build",
|
||||||
"rootDir": "./src"
|
"rootDir": "./src"
|
||||||
},
|
},
|
||||||
|
"include": [
|
||||||
|
"src/**/*"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"scripts/**/*",
|
||||||
|
"**/*.spec.ts",
|
||||||
|
"**/mod.ts"
|
||||||
|
],
|
||||||
"references": [
|
"references": [
|
||||||
{ "path": "../api/tsconfig.build.json" },
|
{ "path": "../api/tsconfig.build.json" },
|
||||||
{ "path": "../api-augment/tsconfig.build.json" },
|
{ "path": "../api-augment/tsconfig.build.json" },
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"baseUrl": "..",
|
||||||
|
"outDir": "./build",
|
||||||
|
"rootDir": "./scripts",
|
||||||
|
"emitDeclarationOnly": false,
|
||||||
|
"noEmit": true
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"scripts/**/*"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"src/**/*"
|
||||||
|
],
|
||||||
|
"references": [
|
||||||
|
{ "path": "../typegen/tsconfig.build.json" }
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"baseUrl": "..",
|
||||||
|
"outDir": "./build",
|
||||||
|
"rootDir": "./src",
|
||||||
|
"emitDeclarationOnly": false,
|
||||||
|
"noEmit": true
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"**/*.spec.ts"
|
||||||
|
],
|
||||||
|
"references": [
|
||||||
|
{ "path": "../typegen/tsconfig.build.json" },
|
||||||
|
{ "path": "../types/tsconfig.build.json" }
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -18,12 +18,12 @@
|
|||||||
"./detectPackage.cjs"
|
"./detectPackage.cjs"
|
||||||
],
|
],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "10.7.1",
|
"version": "10.7.2",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@polkadot/types": "10.7.1",
|
"@polkadot/types": "10.7.2",
|
||||||
"@polkadot/types-codec": "10.7.1",
|
"@polkadot/types-codec": "10.7.2",
|
||||||
"@polkadot/util": "^12.2.1",
|
"@polkadot/util": "^12.2.1",
|
||||||
"tslib": "^2.5.0"
|
"tslib": "^2.5.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '10.7.1' };
|
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '10.7.2' };
|
||||||
|
|||||||
@@ -5,6 +5,9 @@
|
|||||||
"outDir": "./build",
|
"outDir": "./build",
|
||||||
"rootDir": "./src"
|
"rootDir": "./src"
|
||||||
},
|
},
|
||||||
|
"exclude": [
|
||||||
|
"**/mod.ts"
|
||||||
|
],
|
||||||
"references": [
|
"references": [
|
||||||
{ "path": "../types/tsconfig.build.json" },
|
{ "path": "../types/tsconfig.build.json" },
|
||||||
{ "path": "../types-codec/tsconfig.build.json" }
|
{ "path": "../types-codec/tsconfig.build.json" }
|
||||||
|
|||||||
@@ -18,17 +18,17 @@
|
|||||||
"./detectPackage.cjs"
|
"./detectPackage.cjs"
|
||||||
],
|
],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "10.7.1",
|
"version": "10.7.2",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@polkadot/util": "^12.2.1",
|
"@polkadot/util": "^12.2.1",
|
||||||
"@polkadot/x-bigint": "^12.2.1",
|
"@polkadot/x-bigint": "^12.2.1",
|
||||||
"tslib": "^2.5.0"
|
"tslib": "^2.5.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@polkadot/types": "10.7.1",
|
"@polkadot/types": "10.7.2",
|
||||||
"@polkadot/types-augment": "10.7.1",
|
"@polkadot/types-augment": "10.7.2",
|
||||||
"@polkadot/types-support": "10.7.1",
|
"@polkadot/types-support": "10.7.2",
|
||||||
"@polkadot/util-crypto": "^12.2.1"
|
"@polkadot/util-crypto": "^12.2.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ describe('Compact', (): void => {
|
|||||||
|
|
||||||
describe('constructor', (): void => {
|
describe('constructor', (): void => {
|
||||||
it('fails on > MAX_SAFE_INTEGER', (): void => {
|
it('fails on > MAX_SAFE_INTEGER', (): void => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-loss-of-precision
|
// eslint-disable-next-line @typescript-eslint/no-loss-of-precision, no-loss-of-precision
|
||||||
expect(() => new Compact(registry, 'u128', 9007199254740999)).toThrow(/integer <= Number.MAX_SAFE_INTEGER/);
|
expect(() => new Compact(registry, 'u128', 9007199254740999)).toThrow(/integer <= Number.MAX_SAFE_INTEGER/);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ describe('Result', (): void => {
|
|||||||
it('decodes from a u8a (success)', (): void => {
|
it('decodes from a u8a (success)', (): void => {
|
||||||
const result = new Type(registry, new Uint8Array([0, 1, 2, 3, 4]));
|
const result = new Type(registry, new Uint8Array([0, 1, 2, 3, 4]));
|
||||||
|
|
||||||
expect(result.isOk);
|
expect(result.isOk).toBe(true);
|
||||||
expect(result.asOk.toU8a()).toEqual(new Uint8Array([1, 2, 3, 4]));
|
expect(result.asOk.toU8a()).toEqual(new Uint8Array([1, 2, 3, 4]));
|
||||||
expect(result.toHex()).toEqual('0x0001020304');
|
expect(result.toHex()).toEqual('0x0001020304');
|
||||||
expect(result.toJSON()).toEqual({
|
expect(result.toJSON()).toEqual({
|
||||||
@@ -29,7 +29,7 @@ describe('Result', (): void => {
|
|||||||
it('decodes from a u8a (error)', (): void => {
|
it('decodes from a u8a (error)', (): void => {
|
||||||
const result = new Type(registry, new Uint8Array([1, 4 << 2, 100, 101, 102, 103]));
|
const result = new Type(registry, new Uint8Array([1, 4 << 2, 100, 101, 102, 103]));
|
||||||
|
|
||||||
expect(result.isErr);
|
expect(result.isErr).toBe(true);
|
||||||
expect(result.asErr.toU8a()).toEqual(new Uint8Array([4 << 2, 100, 101, 102, 103]));
|
expect(result.asErr.toU8a()).toEqual(new Uint8Array([4 << 2, 100, 101, 102, 103]));
|
||||||
expect(result.toHex()).toEqual('0x011064656667');
|
expect(result.toHex()).toEqual('0x011064656667');
|
||||||
expect(result.toJSON()).toEqual({
|
expect(result.toJSON()).toEqual({
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ describe('UInt', (): void => {
|
|||||||
const registry = new TypeRegistry();
|
const registry = new TypeRegistry();
|
||||||
|
|
||||||
it('fails on > MAX_SAFE_INTEGER and float', (): void => {
|
it('fails on > MAX_SAFE_INTEGER and float', (): void => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-loss-of-precision
|
// eslint-disable-next-line @typescript-eslint/no-loss-of-precision, no-loss-of-precision
|
||||||
expect(() => new UInt(registry, 9007199254740999)).toThrow(/integer <= Number.MAX_SAFE_INTEGER/);
|
expect(() => new UInt(registry, 9007199254740999)).toThrow(/integer <= Number.MAX_SAFE_INTEGER/);
|
||||||
// eslint-disable-next-line @typescript-eslint/no-loss-of-precision
|
// eslint-disable-next-line @typescript-eslint/no-loss-of-precision, no-loss-of-precision
|
||||||
expect(() => new UInt(registry, -9007199254740999)).toThrow(/integer <= Number.MAX_SAFE_INTEGER/);
|
expect(() => new UInt(registry, -9007199254740999)).toThrow(/integer <= Number.MAX_SAFE_INTEGER/);
|
||||||
expect(() => new UInt(registry, 9.123)).toThrow(/integer <= Number.MAX_SAFE_INTEGER/);
|
expect(() => new UInt(registry, 9.123)).toThrow(/integer <= Number.MAX_SAFE_INTEGER/);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ describe('Vec', (): void => {
|
|||||||
expect(new Vec(registry, Text, null)).toHaveLength(0);
|
expect(new Vec(registry, Text, null)).toHaveLength(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('decodes a complex type via construction', (): void => {
|
it('decodes a complex type via construction (1)', (): void => {
|
||||||
const test = createTypeUnsafe<Vec<ITuple<[PropIndex, AccountId]>>>(registry, 'Vec<(PropIndex, AccountId)>', [new Uint8Array([
|
const test = createTypeUnsafe<Vec<ITuple<[PropIndex, AccountId]>>>(registry, 'Vec<(PropIndex, AccountId)>', [new Uint8Array([
|
||||||
4, 10, 0, 0, 0, 209, 114, 167, 76, 218, 76, 134, 89, 18, 195, 43, 160, 168, 10, 87, 174, 105, 171, 174, 65, 14, 92, 203, 89, 222, 232, 78, 47, 68, 50, 219, 79
|
4, 10, 0, 0, 0, 209, 114, 167, 76, 218, 76, 134, 89, 18, 195, 43, 160, 168, 10, 87, 174, 105, 171, 174, 65, 14, 92, 203, 89, 222, 232, 78, 47, 68, 50, 219, 79
|
||||||
])]);
|
])]);
|
||||||
@@ -48,7 +48,7 @@ describe('Vec', (): void => {
|
|||||||
expect(test[0][1].toString()).toEqual('5GoKvZWG5ZPYL1WUovuHW3zJBWBP5eT8CbqjdRY4Q6iMaQua');
|
expect(test[0][1].toString()).toEqual('5GoKvZWG5ZPYL1WUovuHW3zJBWBP5eT8CbqjdRY4Q6iMaQua');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('decodes a complex type via construction', (): void => {
|
it('decodes a complex type via construction (2)', (): void => {
|
||||||
const INPUT = '0x08cc0200000000ce0200000001';
|
const INPUT = '0x08cc0200000000ce0200000001';
|
||||||
const test = createTypeUnsafe<Vec<Codec>>(registry, 'Vec<(u32, [u32; 0], u16)>', [INPUT]);
|
const test = createTypeUnsafe<Vec<Codec>>(registry, 'Vec<(u32, [u32; 0], u16)>', [INPUT]);
|
||||||
|
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ export class BTreeSet<V extends Codec = Codec> extends Set<V> implements ISet<V>
|
|||||||
* @description Returns a breakdown of the hex encoding for this Codec
|
* @description Returns a breakdown of the hex encoding for this Codec
|
||||||
*/
|
*/
|
||||||
public inspect (): Inspect {
|
public inspect (): Inspect {
|
||||||
const inner = new Array<Inspect>();
|
const inner: Inspect[] = [];
|
||||||
|
|
||||||
for (const v of this.values()) {
|
for (const v of this.values()) {
|
||||||
inner.push(v.inspect());
|
inner.push(v.inspect());
|
||||||
@@ -218,7 +218,7 @@ export class BTreeSet<V extends Codec = Codec> extends Set<V> implements ISet<V>
|
|||||||
* @param isBare true when the value has none of the type-specific prefixes (internal)
|
* @param isBare true when the value has none of the type-specific prefixes (internal)
|
||||||
*/
|
*/
|
||||||
public toU8a (isBare?: boolean): Uint8Array {
|
public toU8a (isBare?: boolean): Uint8Array {
|
||||||
const encoded = new Array<Uint8Array>();
|
const encoded: Uint8Array[] = [];
|
||||||
|
|
||||||
if (!isBare) {
|
if (!isBare) {
|
||||||
encoded.push(compactToU8a(this.size));
|
encoded.push(compactToU8a(this.size));
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const registry = new TypeRegistry();
|
|||||||
describe('BitVec', (): void => {
|
describe('BitVec', (): void => {
|
||||||
describe('decoding known', (): void => {
|
describe('decoding known', (): void => {
|
||||||
TESTS.forEach((test): void => {
|
TESTS.forEach((test): void => {
|
||||||
describe(test, (): void => {
|
describe(`${test}`, (): void => {
|
||||||
const input = hexToU8a(test);
|
const input = hexToU8a(test);
|
||||||
const bitvec = new BitVec(registry, input);
|
const bitvec = new BitVec(registry, input);
|
||||||
|
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ export class CodecMap<K extends Codec = Codec, V extends Codec = Codec> extends
|
|||||||
* @description Returns a breakdown of the hex encoding for this Codec
|
* @description Returns a breakdown of the hex encoding for this Codec
|
||||||
*/
|
*/
|
||||||
public inspect (): Inspect {
|
public inspect (): Inspect {
|
||||||
const inner = new Array<Inspect>();
|
const inner: Inspect[] = [];
|
||||||
|
|
||||||
for (const [k, v] of this.entries()) {
|
for (const [k, v] of this.entries()) {
|
||||||
inner.push(k.inspect());
|
inner.push(k.inspect());
|
||||||
@@ -240,7 +240,7 @@ export class CodecMap<K extends Codec = Codec, V extends Codec = Codec> extends
|
|||||||
* @param isBare true when the value has none of the type-specific prefixes (internal)
|
* @param isBare true when the value has none of the type-specific prefixes (internal)
|
||||||
*/
|
*/
|
||||||
public toU8a (isBare?: boolean): Uint8Array {
|
public toU8a (isBare?: boolean): Uint8Array {
|
||||||
const encoded = new Array<Uint8Array>();
|
const encoded: Uint8Array[] = [];
|
||||||
|
|
||||||
if (!isBare) {
|
if (!isBare) {
|
||||||
encoded.push(compactToU8a(this.size));
|
encoded.push(compactToU8a(this.size));
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ export class Struct<
|
|||||||
* @description Returns a breakdown of the hex encoding for this Codec
|
* @description Returns a breakdown of the hex encoding for this Codec
|
||||||
*/
|
*/
|
||||||
public inspect (isBare?: BareOpts): Inspect {
|
public inspect (isBare?: BareOpts): Inspect {
|
||||||
const inner = new Array<Inspect>();
|
const inner: Inspect[] = [];
|
||||||
|
|
||||||
for (const [k, v] of this.entries()) {
|
for (const [k, v] of this.entries()) {
|
||||||
inner.push({
|
inner.push({
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/types-codec', path: 'auto', type: 'auto', version: '10.7.1' };
|
export const packageInfo = { name: '@polkadot/types-codec', path: 'auto', type: 'auto', version: '10.7.2' };
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
// Copyright 2017-2023 @polkadot/types-codec authors & contributors
|
// Copyright 2017-2023 @polkadot/types-codec authors & contributors
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
/* global it */
|
||||||
|
|
||||||
// Shamelessly copied from @polkadot/util/test
|
// Shamelessly copied from @polkadot/util/test
|
||||||
|
|
||||||
import { formatDecimal, formatNumber } from '@polkadot/util';
|
import { formatDecimal, formatNumber } from '@polkadot/util';
|
||||||
|
|||||||
@@ -3,12 +3,12 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"baseUrl": "..",
|
"baseUrl": "..",
|
||||||
"outDir": "./build",
|
"outDir": "./build",
|
||||||
"rootDir": "./src",
|
"rootDir": "./src"
|
||||||
"resolveJsonModule": true
|
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"**/*.data.ts",
|
"**/*.data.ts",
|
||||||
"**/checkTypes.manual.ts",
|
"**/checkTypes.manual.ts",
|
||||||
|
"**/mod.ts",
|
||||||
"**/*.spec.ts",
|
"**/*.spec.ts",
|
||||||
"**/test/*"
|
"**/test/*"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
"outDir": "./build",
|
"outDir": "./build",
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"emitDeclarationOnly": false,
|
"emitDeclarationOnly": false,
|
||||||
"resolveJsonModule": true,
|
|
||||||
"noEmit": true
|
"noEmit": true
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
|
|||||||
@@ -18,14 +18,14 @@
|
|||||||
"./detectPackage.cjs"
|
"./detectPackage.cjs"
|
||||||
],
|
],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "10.7.1",
|
"version": "10.7.2",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@polkadot/types-codec": "10.7.1",
|
"@polkadot/types-codec": "10.7.2",
|
||||||
"@polkadot/util": "^12.2.1",
|
"@polkadot/util": "^12.2.1",
|
||||||
"tslib": "^2.5.0"
|
"tslib": "^2.5.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@polkadot/types": "10.7.1"
|
"@polkadot/types": "10.7.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,5 +6,4 @@ export { packageInfo } from './packageInfo.js';
|
|||||||
export { TypeDefInfo } from './types/index.js';
|
export { TypeDefInfo } from './types/index.js';
|
||||||
|
|
||||||
// all starred
|
// all starred
|
||||||
export * from './create/index.js';
|
export * from './exports.js';
|
||||||
export * from './util/index.js';
|
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
// Copyright 2017-2023 @polkadot/types-codec authors & contributors
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
// all starred
|
||||||
|
export * from './create/index.js';
|
||||||
|
export * from './util/index.js';
|
||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/types-create', path: 'auto', type: 'auto', version: '10.7.1' };
|
export const packageInfo = { name: '@polkadot/types-create', path: 'auto', type: 'auto', version: '10.7.2' };
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"baseUrl": "..",
|
"baseUrl": "..",
|
||||||
"outDir": "./build",
|
"outDir": "./build",
|
||||||
"rootDir": "./src",
|
"rootDir": "./src"
|
||||||
"resolveJsonModule": true
|
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"**/*.spec.ts"
|
"**/*.spec.ts",
|
||||||
|
"**/mod.ts"
|
||||||
],
|
],
|
||||||
"references": [
|
"references": [
|
||||||
{ "path": "../types-codec/tsconfig.build.json" }
|
{ "path": "../types-codec/tsconfig.build.json" }
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
"outDir": "./build",
|
"outDir": "./build",
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"emitDeclarationOnly": false,
|
"emitDeclarationOnly": false,
|
||||||
"resolveJsonModule": true,
|
|
||||||
"noEmit": true
|
"noEmit": true
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
|
|||||||
@@ -18,17 +18,17 @@
|
|||||||
"./detectPackage.cjs"
|
"./detectPackage.cjs"
|
||||||
],
|
],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "10.7.1",
|
"version": "10.7.2",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@polkadot/networks": "^12.2.1",
|
"@polkadot/networks": "^12.2.1",
|
||||||
"@polkadot/types": "10.7.1",
|
"@polkadot/types": "10.7.2",
|
||||||
"@polkadot/types-codec": "10.7.1",
|
"@polkadot/types-codec": "10.7.2",
|
||||||
"@polkadot/types-create": "10.7.1",
|
"@polkadot/types-create": "10.7.2",
|
||||||
"@polkadot/util": "^12.2.1",
|
"@polkadot/util": "^12.2.1",
|
||||||
"tslib": "^2.5.0"
|
"tslib": "^2.5.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@polkadot/api": "10.7.1"
|
"@polkadot/api": "10.7.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/types-known', path: 'auto', type: 'auto', version: '10.7.1' };
|
export const packageInfo = { name: '@polkadot/types-known', path: 'auto', type: 'auto', version: '10.7.2' };
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ for (const chain of keys) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
for (const [blockNumber, specVersion] of allMan[chain]) {
|
for (const [blockNumber, specVersion] of allMan[chain]) {
|
||||||
|
// eslint-disable-next-line jest/expect-expect
|
||||||
it(`blockNumber=${blockNumber}, specVersion=${specVersion}`, async (): Promise<void> => {
|
it(`blockNumber=${blockNumber}, specVersion=${specVersion}`, async (): Promise<void> => {
|
||||||
const found = avail.find(([n, s]) => n === blockNumber && s === specVersion);
|
const found = avail.find(([n, s]) => n === blockNumber && s === specVersion);
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,8 @@ describe('generated', (): void => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
for (const chain of Object.keys(allMan)) {
|
for (const chain of Object.keys(allMan)) {
|
||||||
describe(chain, (): void => {
|
describe(`${chain}`, (): void => {
|
||||||
|
// eslint-disable-next-line jest/expect-expect
|
||||||
it('should have all generated', (): void => {
|
it('should have all generated', (): void => {
|
||||||
const missing = allMan[chain as keyof typeof allMan].filter(([na, sa]) =>
|
const missing = allMan[chain as keyof typeof allMan].filter(([na, sa]) =>
|
||||||
!allGen[chain as keyof typeof allGen].some(([nb, sb]) =>
|
!allGen[chain as keyof typeof allGen].some(([nb, sb]) =>
|
||||||
@@ -78,10 +79,12 @@ describe('generated', (): void => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// eslint-disable-next-line jest/expect-expect
|
||||||
it('manual should be correctly ordered', (): void => {
|
it('manual should be correctly ordered', (): void => {
|
||||||
checkOrder(chain, (allGen as Record<string, ChainUpgradesExpanded>)[chain]);
|
checkOrder(chain, (allGen as Record<string, ChainUpgradesExpanded>)[chain]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// eslint-disable-next-line jest/expect-expect
|
||||||
it('generated should be correctly ordered', (): void => {
|
it('generated should be correctly ordered', (): void => {
|
||||||
checkOrder(chain, (allMan as Record<string, ChainUpgradesRaw>)[chain]);
|
checkOrder(chain, (allMan as Record<string, ChainUpgradesRaw>)[chain]);
|
||||||
});
|
});
|
||||||
@@ -91,7 +94,7 @@ describe('generated', (): void => {
|
|||||||
|
|
||||||
describe('upgrades', (): void => {
|
describe('upgrades', (): void => {
|
||||||
TESTS.forEach(({ genesisHash, network, versions }): void => {
|
TESTS.forEach(({ genesisHash, network, versions }): void => {
|
||||||
describe(network, (): void => {
|
describe(`${network}`, (): void => {
|
||||||
const chain = upgrades.find((n) => n.network === network);
|
const chain = upgrades.find((n) => n.network === network);
|
||||||
|
|
||||||
if (!chain) {
|
if (!chain) {
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
"rootDir": "./src"
|
"rootDir": "./src"
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"**/*.spec.ts"
|
"**/*.spec.ts",
|
||||||
|
"**/mod.ts"
|
||||||
],
|
],
|
||||||
"references": [
|
"references": [
|
||||||
{ "path": "../types/tsconfig.build.json" },
|
{ "path": "../types/tsconfig.build.json" },
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
"outDir": "./build",
|
"outDir": "./build",
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"emitDeclarationOnly": false,
|
"emitDeclarationOnly": false,
|
||||||
"resolveJsonModule": true,
|
|
||||||
"noEmit": true
|
"noEmit": true
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
|
|||||||
@@ -18,10 +18,10 @@
|
|||||||
"./detectPackage.cjs"
|
"./detectPackage.cjs"
|
||||||
],
|
],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "10.7.1",
|
"version": "10.7.2",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@polkadot/util": "^12.2.1",
|
"@polkadot/util": "^12.2.1",
|
||||||
"tslib": "^2.5.0"
|
"tslib": "^2.5.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/types-support', path: 'auto', type: 'auto', version: '10.7.1' };
|
export const packageInfo = { name: '@polkadot/types-support', path: 'auto', type: 'auto', version: '10.7.2' };
|
||||||
|
|||||||
@@ -10,5 +10,8 @@
|
|||||||
"src/**/*.json",
|
"src/**/*.json",
|
||||||
"src/**/*.ts"
|
"src/**/*.ts"
|
||||||
],
|
],
|
||||||
|
"exclude": [
|
||||||
|
"**/mod.ts"
|
||||||
|
],
|
||||||
"references": []
|
"references": []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,20 +18,20 @@
|
|||||||
"./detectPackage.cjs"
|
"./detectPackage.cjs"
|
||||||
],
|
],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "10.7.1",
|
"version": "10.7.2",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@polkadot/keyring": "^12.2.1",
|
"@polkadot/keyring": "^12.2.1",
|
||||||
"@polkadot/types-augment": "10.7.1",
|
"@polkadot/types-augment": "10.7.2",
|
||||||
"@polkadot/types-codec": "10.7.1",
|
"@polkadot/types-codec": "10.7.2",
|
||||||
"@polkadot/types-create": "10.7.1",
|
"@polkadot/types-create": "10.7.2",
|
||||||
"@polkadot/util": "^12.2.1",
|
"@polkadot/util": "^12.2.1",
|
||||||
"@polkadot/util-crypto": "^12.2.1",
|
"@polkadot/util-crypto": "^12.2.1",
|
||||||
"rxjs": "^7.8.1",
|
"rxjs": "^7.8.1",
|
||||||
"tslib": "^2.5.0"
|
"tslib": "^2.5.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@polkadot/keyring": "^12.2.1",
|
"@polkadot/keyring": "^12.2.1",
|
||||||
"@polkadot/types-support": "10.7.1"
|
"@polkadot/types-support": "10.7.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -198,14 +198,14 @@ describe('createType', (): void => {
|
|||||||
it('allows for re-registration of a type', (): void => {
|
it('allows for re-registration of a type', (): void => {
|
||||||
const balDef = registry.createType('Balance');
|
const balDef = registry.createType('Balance');
|
||||||
|
|
||||||
expect(balDef instanceof registry.createClass('Balance'));
|
expect(balDef instanceof registry.createClass('Balance')).toBe(true);
|
||||||
expect(balDef.bitLength()).toEqual(128);
|
expect(balDef.bitLength()).toEqual(128);
|
||||||
|
|
||||||
registry.register({ Balance: 'u32' });
|
registry.register({ Balance: 'u32' });
|
||||||
|
|
||||||
const balu32 = registry.createType('Balance');
|
const balu32 = registry.createType('Balance');
|
||||||
|
|
||||||
expect(balu32 instanceof registry.createClass('Balance'));
|
expect(balu32 instanceof registry.createClass('Balance')).toBe(true);
|
||||||
expect(balu32.bitLength()).toEqual(32);
|
expect(balu32.bitLength()).toEqual(32);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
// all external
|
// all external
|
||||||
export * from '@polkadot/types-create';
|
export * from '@polkadot/types-create/exports';
|
||||||
|
|
||||||
// all local
|
// all local
|
||||||
export * from './createClass.js';
|
export * from './createClass.js';
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ describe('TypeRegistry', (): void => {
|
|||||||
|
|
||||||
expect(Type).toBeDefined();
|
expect(Type).toBeDefined();
|
||||||
// eslint-disable-next-line no-prototype-builtins
|
// eslint-disable-next-line no-prototype-builtins
|
||||||
expect(isChildClass(DoNotConstruct, Type));
|
expect(isChildClass(DoNotConstruct, Type)).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can register single type', (): void => {
|
it('can register single type', (): void => {
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
// Copyright 2017-2023 @polkadot/types authors & contributors
|
// Copyright 2017-2023 @polkadot/types authors & contributors
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
/* eslint-disable jest/expect-expect */
|
||||||
|
|
||||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||||
|
|
||||||
import { BN } from '@polkadot/util';
|
import { BN } from '@polkadot/util';
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ describe('ChainProperties', (): void => {
|
|||||||
expect(tokenSymbol.unwrap().eq(['KSM'])).toBe(true);
|
expect(tokenSymbol.unwrap().eq(['KSM'])).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('has a sane toHuman', (): void => {
|
it('has a sane toHuman (single tokenDecimals)', (): void => {
|
||||||
expect(
|
expect(
|
||||||
registry.createType('ChainProperties', {
|
registry.createType('ChainProperties', {
|
||||||
ss58Format: 42,
|
ss58Format: 42,
|
||||||
@@ -69,7 +69,7 @@ describe('ChainProperties', (): void => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('has a sane toHuman', (): void => {
|
it('has a sane toHuman (multiple tokenDecimals)', (): void => {
|
||||||
expect(
|
expect(
|
||||||
registry.createType('ChainProperties', {
|
registry.createType('ChainProperties', {
|
||||||
ss58Format: 2,
|
ss58Format: 2,
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ const metadata = new Metadata(registry, metadataStatic);
|
|||||||
registry.setMetadata(metadata);
|
registry.setMetadata(metadata);
|
||||||
|
|
||||||
function testTypes (type: string, typeNames: string[]): void {
|
function testTypes (type: string, typeNames: string[]): void {
|
||||||
describe(type, (): void => {
|
describe(`${type}`, (): void => {
|
||||||
describe(`${type}:: default creation`, (): void => {
|
describe(`${type}:: default creation`, (): void => {
|
||||||
typeNames.forEach((name): void => {
|
typeNames.forEach((name): void => {
|
||||||
it(`creates an empty ${name}`, (): void => {
|
it(`creates an empty ${name}`, (): void => {
|
||||||
@@ -38,8 +38,10 @@ function testTypes (type: string, typeNames: string[]): void {
|
|||||||
registry.createType(name);
|
registry.createType(name);
|
||||||
|
|
||||||
if (UNCONSTRUCTABLE.includes(name.toLowerCase())) {
|
if (UNCONSTRUCTABLE.includes(name.toLowerCase())) {
|
||||||
|
// eslint-disable-next-line jest/no-conditional-expect
|
||||||
expect(constructFn).toThrow();
|
expect(constructFn).toThrow();
|
||||||
} else {
|
} else {
|
||||||
|
// eslint-disable-next-line jest/no-conditional-expect
|
||||||
expect(constructFn).not.toThrow();
|
expect(constructFn).not.toThrow();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -53,8 +55,10 @@ function testTypes (type: string, typeNames: string[]): void {
|
|||||||
registry.createType(name, registry.createType('Bytes'));
|
registry.createType(name, registry.createType('Bytes'));
|
||||||
|
|
||||||
if (UNCONSTRUCTABLE.includes(name.toLowerCase())) {
|
if (UNCONSTRUCTABLE.includes(name.toLowerCase())) {
|
||||||
|
// eslint-disable-next-line jest/no-conditional-expect
|
||||||
expect(constructFn).toThrow();
|
expect(constructFn).toThrow();
|
||||||
} else {
|
} else {
|
||||||
|
// eslint-disable-next-line jest/no-conditional-expect
|
||||||
expect(constructFn).not.toThrow();
|
expect(constructFn).not.toThrow();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ describe('type definitions', (): void => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
for (const [key, { types }] of allTypes) {
|
for (const [key, { types }] of allTypes) {
|
||||||
describe(key, (): void => {
|
describe(`${key}`, (): void => {
|
||||||
const typesKeys = Object.keys(types).filter((type) =>
|
const typesKeys = Object.keys(types).filter((type) =>
|
||||||
// meant to fail
|
// meant to fail
|
||||||
type !== 'ExtrinsicUnknown' &&
|
type !== 'ExtrinsicUnknown' &&
|
||||||
@@ -80,11 +80,11 @@ describe('rpc definitions', (): void => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
for (const [section, { rpc }] of rpcs) {
|
for (const [section, { rpc }] of rpcs) {
|
||||||
describe(section, (): void => {
|
describe(`${section}`, (): void => {
|
||||||
const methodsEntries = Object.entries<DefinitionRpc>(rpc);
|
const methodsEntries = Object.entries<DefinitionRpc>(rpc);
|
||||||
|
|
||||||
for (const [method, { params, type }] of methodsEntries) {
|
for (const [method, { params, type }] of methodsEntries) {
|
||||||
describe(method, (): void => {
|
describe(`${method}`, (): void => {
|
||||||
// We cannot constuct V0, so just ignore
|
// We cannot constuct V0, so just ignore
|
||||||
if (section !== 'state' || method !== 'getMetadata') {
|
if (section !== 'state' || method !== 'getMetadata') {
|
||||||
it(`output ${type} is known`, (): void => {
|
it(`output ${type} is known`, (): void => {
|
||||||
@@ -114,17 +114,17 @@ describe('runtime definitions', (): void => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
for (const [key, { runtime }] of runtimes) {
|
for (const [key, { runtime }] of runtimes) {
|
||||||
describe(key, (): void => {
|
describe(`${key}`, (): void => {
|
||||||
const versionsEntries = Object.entries<DefinitionsCallEntry[]>(runtime);
|
const versionsEntries = Object.entries<DefinitionsCallEntry[]>(runtime);
|
||||||
|
|
||||||
for (const [key, versions] of versionsEntries) {
|
for (const [key, versions] of versionsEntries) {
|
||||||
describe(key, (): void => {
|
describe(`${key}`, (): void => {
|
||||||
for (const { methods, version } of versions) {
|
for (const { methods, version } of versions) {
|
||||||
describe(`version ${version}`, (): void => {
|
describe(`version ${version}`, (): void => {
|
||||||
const methodsEntries = Object.entries<DefinitionCall>(methods);
|
const methodsEntries = Object.entries<DefinitionCall>(methods);
|
||||||
|
|
||||||
for (const [key, { params, type }] of methodsEntries) {
|
for (const [key, { params, type }] of methodsEntries) {
|
||||||
describe(key, (): void => {
|
describe(`${key}`, (): void => {
|
||||||
// Applied from runtime, used in Funglibles
|
// Applied from runtime, used in Funglibles
|
||||||
if (type !== 'Result<Vec<XcmV3MultiAsset>, FungiblesAccessError>') {
|
if (type !== 'Result<Vec<XcmV3MultiAsset>, FungiblesAccessError>') {
|
||||||
it(`output ${type} is known`, (): void => {
|
it(`output ${type} is known`, (): void => {
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
/// <reference types="@polkadot/dev-test/globals.d.ts" />
|
||||||
|
|
||||||
|
/* global describe, it, expect */
|
||||||
|
|
||||||
import type { Registry } from '@polkadot/types-codec/types';
|
import type { Registry } from '@polkadot/types-codec/types';
|
||||||
import type { Check } from './types.js';
|
import type { Check } from './types.js';
|
||||||
|
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/types', path: 'auto', type: 'auto', version: '10.7.1' };
|
export const packageInfo = { name: '@polkadot/types', path: 'auto', type: 'auto', version: '10.7.2' };
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"baseUrl": "..",
|
"baseUrl": "..",
|
||||||
"outDir": "./build",
|
"outDir": "./build",
|
||||||
"rootDir": "./src",
|
"rootDir": "./src"
|
||||||
"resolveJsonModule": true
|
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"**/checkTypes.manual.ts",
|
"**/checkTypes.manual.ts",
|
||||||
|
"**/mod.ts",
|
||||||
"**/*.spec.ts"
|
"**/*.spec.ts"
|
||||||
],
|
],
|
||||||
"references": [
|
"references": [
|
||||||
|
|||||||
@@ -30,11 +30,12 @@ const entries = [
|
|||||||
...all,
|
...all,
|
||||||
[`@polkadot/${p}`]: path.resolve(process.cwd(), `packages/${p}/build/bundle.js`)
|
[`@polkadot/${p}`]: path.resolve(process.cwd(), `packages/${p}/build/bundle.js`)
|
||||||
}), {
|
}), {
|
||||||
|
// re-exported in @polkadot/util-crypto, map directly
|
||||||
|
'@polkadot/networks': '@polkadot/util-crypto',
|
||||||
// we point to a specific file for these (default augmentations)
|
// we point to a specific file for these (default augmentations)
|
||||||
'@polkadot/rpc-core/types/jsonrpc': path.resolve(process.cwd(), 'packages/rpc-core/build/types/jsonrpc.js'),
|
'@polkadot/rpc-core/types/jsonrpc': path.resolve(process.cwd(), 'packages/rpc-core/build/types/jsonrpc.js'),
|
||||||
'@polkadot/types-codec/types/registry': path.resolve(process.cwd(), 'packages/types-codec/build/types/registry.js'),
|
'@polkadot/types-codec/types/registry': path.resolve(process.cwd(), 'packages/types-codec/build/types/registry.js'),
|
||||||
// re-exported in @polkadot/util-crypto, map directly
|
'@polkadot/types-create/exports': path.resolve(process.cwd(), 'packages/types-create/build/exports.js')
|
||||||
'@polkadot/networks': '@polkadot/util-crypto'
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const overrides = {};
|
const overrides = {};
|
||||||
@@ -5,16 +5,20 @@ import fs from 'node:fs';
|
|||||||
|
|
||||||
import { fetch } from '@polkadot/x-fetch';
|
import { fetch } from '@polkadot/x-fetch';
|
||||||
|
|
||||||
const META = 14;
|
const PREAMBLE = '// Copyright 2017-2023 @polkadot/types-support authors & contributors\n// SPDX-License-Identifier: Apache-2.0\n\n/* eslint-disable */\n\n';
|
||||||
const PREAMBLE = `// Copyright 2017-2023 @polkadot/types-support authors & contributors\n// SPDX-License-Identifier: Apache-2.0\n\n/* eslint-disable */\n\n`;
|
|
||||||
const CMD = {
|
const CMD = {
|
||||||
kusama: `${PREAMBLE}// cargo run --release -- purge-chain -y --chain kusama-dev && cargo run --release -- --chain kusama-dev --alice --force-authoring\n\nexport default`,
|
kusama: `${PREAMBLE}// cargo run --release -- purge-chain -y --chain kusama-dev && cargo run --release -- --chain kusama-dev --alice --force-authoring\n\nexport default`,
|
||||||
polkadot: `${PREAMBLE}// cargo run --release -- purge-chain -y --dev && cargo run --release -- --dev\n\nexport default`,
|
polkadot: `${PREAMBLE}// cargo run --release -- purge-chain -y --dev && cargo run --release -- --dev\n\nexport default`,
|
||||||
substrate: `${PREAMBLE}// cargo run --release -- purge-chain -y --dev && cargo run --release -- --dev\n\nexport default`
|
substrate: `${PREAMBLE}// cargo run --release -- purge-chain -y --dev && cargo run --release -- --dev\n\nexport default`
|
||||||
}
|
};
|
||||||
|
|
||||||
let requestId = 0;
|
let requestId = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {'rpc_methods' | 'state_getMetadata' | 'state_getRuntimeVersion'} method
|
||||||
|
* @returns {Promise<any>}
|
||||||
|
*/
|
||||||
async function get (method) {
|
async function get (method) {
|
||||||
const res = await fetch('http://127.0.0.1:9944', {
|
const res = await fetch('http://127.0.0.1:9944', {
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
@@ -24,7 +28,7 @@ async function get (method) {
|
|||||||
params: []
|
params: []
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
'Accept': 'application/json',
|
Accept: 'application/json',
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
method: 'post'
|
method: 'post'
|
||||||
@@ -34,6 +38,7 @@ async function get (method) {
|
|||||||
return body.result;
|
return body.result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @type {[string[], string, { specName: 'polkadot' | 'kusama' | 'node'; specVersion: string; }]} */
|
||||||
const [methods, metadata, version] = await Promise.all([
|
const [methods, metadata, version] = await Promise.all([
|
||||||
get('rpc_methods'),
|
get('rpc_methods'),
|
||||||
get('state_getMetadata'),
|
get('state_getMetadata'),
|
||||||
@@ -42,10 +47,11 @@ const [methods, metadata, version] = await Promise.all([
|
|||||||
const chain = version.specName === 'node'
|
const chain = version.specName === 'node'
|
||||||
? 'substrate'
|
? 'substrate'
|
||||||
: version.specName;
|
: version.specName;
|
||||||
const path = `packages/types-support/src/metadata/v${META}/${chain}`;
|
const metaVer = parseInt(metadata.substring(10, 12), 16);
|
||||||
|
const path = `packages/types-support/src/metadata/v${metaVer}/${chain}`;
|
||||||
|
|
||||||
fs.writeFileSync(`${path}-hex.ts`, `${CMD[chain]} '${metadata}';\n`);
|
fs.writeFileSync(`${path}-hex.ts`, `${CMD[chain]} '${metadata}';\n`);
|
||||||
fs.writeFileSync(`${path}-rpc.ts`, `${CMD[chain]} ${JSON.stringify(methods, null, 2)};\n`);
|
fs.writeFileSync(`${path}-rpc.ts`, `${CMD[chain]} ${JSON.stringify(methods, null, 2)};\n`);
|
||||||
fs.writeFileSync(`${path}-ver.ts`, `${CMD[chain]} ${JSON.stringify(version, null, 2)};\n`);
|
fs.writeFileSync(`${path}-ver.ts`, `${CMD[chain]} ${JSON.stringify(version, null, 2)};\n`);
|
||||||
|
|
||||||
console.log(`Done. ${chain}/${version.specVersion}`);
|
console.log(`Retrieved ${chain}/${version.specVersion}, metadata v${metaVer}`);
|
||||||
|
|||||||
@@ -60,6 +60,7 @@
|
|||||||
"@polkadot/types-codec/types": ["types-codec/src/types/index.ts"],
|
"@polkadot/types-codec/types": ["types-codec/src/types/index.ts"],
|
||||||
"@polkadot/types-codec/types/*": ["types-codec/src/types/*.ts"],
|
"@polkadot/types-codec/types/*": ["types-codec/src/types/*.ts"],
|
||||||
"@polkadot/types-create": ["types-create/src/index.ts"],
|
"@polkadot/types-create": ["types-create/src/index.ts"],
|
||||||
|
"@polkadot/types-create/exports": ["types-create/src/exports.ts"],
|
||||||
"@polkadot/types-create/packageInfo": ["types-create/src/packageInfo.ts"],
|
"@polkadot/types-create/packageInfo": ["types-create/src/packageInfo.ts"],
|
||||||
"@polkadot/types-create/types": ["types-create/src/types/index.ts"],
|
"@polkadot/types-create/types": ["types-create/src/types/index.ts"],
|
||||||
"@polkadot/types-create/types/*": ["types-create/src/types/*.ts"],
|
"@polkadot/types-create/types/*": ["types-create/src/types/*.ts"],
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user