Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9217f83870 | ||
|
|
cf261724c3 | ||
|
|
375afb5dff | ||
|
|
9e5779644c | ||
|
|
a6a92837e4 | ||
|
|
d84f40dd77 | ||
|
|
5183c28d5e | ||
|
|
5ed3ea51d3 | ||
|
|
39d76c969d | ||
|
|
5cf4c4edbe | ||
|
|
f6c376a3e7 | ||
|
|
d9a2265b0f | ||
|
|
0c1b1c48f2 | ||
|
|
7c24998e28 | ||
|
|
bf442a4bd4 | ||
|
|
40f432badb | ||
|
|
15a8681ba0 | ||
|
|
61ed6e97f4 | ||
|
|
eee4bf51d6 | ||
|
|
b9cbb9e2e8 |
+2
-1
@@ -6,7 +6,8 @@ const base = require('@polkadot/dev/config/eslint.cjs');
|
||||
module.exports = {
|
||||
...base,
|
||||
ignorePatterns: [
|
||||
...base.ignorePatterns
|
||||
...base.ignorePatterns,
|
||||
'/scripts'
|
||||
],
|
||||
parserOptions: {
|
||||
...base.parserOptions,
|
||||
|
||||
@@ -1,5 +1,39 @@
|
||||
# CHANGELOG
|
||||
|
||||
## 9.13.6 Feb 5, 2023
|
||||
|
||||
Contributed:
|
||||
|
||||
- Align `eth_getTransactionCount` with frontier (Thanks to https://github.com/alko89)
|
||||
|
||||
Changes:
|
||||
|
||||
- Additional override for `Compact<{ refTime: u64 }>` chains
|
||||
- Add script to retrieve local rpc, version & metadata for typegen
|
||||
|
||||
|
||||
## 9.13.5 Feb 2, 2023
|
||||
|
||||
Changes:
|
||||
|
||||
- Adjust `Weight` alias for 1.5 chains
|
||||
- Ensure correct registry is pass through for runtime TS generation
|
||||
|
||||
|
||||
## 9.13.4 Feb 1, 2023
|
||||
|
||||
Changes:
|
||||
|
||||
- None from 9.13.3 (The previous version had npm registry publishing issues)
|
||||
|
||||
|
||||
## 9.13.3 Feb 1, 2023
|
||||
|
||||
Changes:
|
||||
|
||||
- Adjust `Weight` alias detection to cater for `WeightV0/u32` overrides (e.g. early Kusama blocks)
|
||||
|
||||
|
||||
## 9.13.2 Jan 29, 2023
|
||||
|
||||
Changes:
|
||||
|
||||
+2
-1
@@ -1,4 +1,4 @@
|
||||
3351 Jaco Allow null as valid param to Int/UInt (#5458)
|
||||
3360 Jaco 9.13.6 (#5475)
|
||||
83 Amaury Martiny StatementKind: Regular and Saft (#2303)
|
||||
37 Keith Ingram Update contract types and rpc (#4541)
|
||||
35 Stefanie Doll Updated child storage parameters (#1709)
|
||||
@@ -46,6 +46,7 @@
|
||||
2 Zannis Kalampoukis fix: Typegen handles structs and vectors of structs without erroring (#4743)
|
||||
2 扩散性百万甜面包 Typo, deocrateMethod -> decorateMethod (#1594)
|
||||
1 Alan Sapede Adds Eth feeHistory & maxPriorityFeePerGas rpc (#4956)
|
||||
1 Aleš Ferlan fix: use H160 for address in getTransactionCount (#5472)
|
||||
1 Brad Larson [NEW] Support for custom headers with providers (#2423)
|
||||
1 Btwiuse Arch Add side effect check workaround (#4994) (#5009)
|
||||
1 chriswmercer little readme tweak (#279)
|
||||
|
||||
+5
-5
@@ -11,10 +11,10 @@
|
||||
},
|
||||
"sideEffects": false,
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.6",
|
||||
"versions": {
|
||||
"git": "9.13.2",
|
||||
"npm": "9.13.2"
|
||||
"git": "9.13.6",
|
||||
"npm": "9.13.6"
|
||||
},
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
@@ -39,12 +39,12 @@
|
||||
"@babel/core": "^7.20.12",
|
||||
"@babel/register": "^7.18.9",
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@polkadot/dev": "^0.68.2",
|
||||
"@polkadot/dev": "^0.68.5",
|
||||
"@polkadot/typegen": "workspace:packages/typegen",
|
||||
"@types/jest": "^29.4.0",
|
||||
"copyfiles": "^2.4.1"
|
||||
},
|
||||
"resolutions": {
|
||||
"typescript": "^4.9.4"
|
||||
"typescript": "^4.9.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,15 +20,15 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.6",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@polkadot/api-base": "9.13.2",
|
||||
"@polkadot/rpc-augment": "9.13.2",
|
||||
"@polkadot/types": "9.13.2",
|
||||
"@polkadot/types-augment": "9.13.2",
|
||||
"@polkadot/types-codec": "9.13.2",
|
||||
"@polkadot/api-base": "9.13.6",
|
||||
"@polkadot/rpc-augment": "9.13.6",
|
||||
"@polkadot/types": "9.13.6",
|
||||
"@polkadot/types-augment": "9.13.6",
|
||||
"@polkadot/types-codec": "9.13.6",
|
||||
"@polkadot/util": "^10.3.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '9.13.2' };
|
||||
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '9.13.6' };
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.6",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@polkadot/rpc-core": "9.13.2",
|
||||
"@polkadot/types": "9.13.2",
|
||||
"@polkadot/rpc-core": "9.13.6",
|
||||
"@polkadot/types": "9.13.6",
|
||||
"@polkadot/util": "^10.3.1",
|
||||
"rxjs": "^7.8.0"
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '9.13.2' };
|
||||
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '9.13.6' };
|
||||
|
||||
@@ -20,20 +20,20 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.6",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@polkadot/api": "9.13.2",
|
||||
"@polkadot/types": "9.13.2",
|
||||
"@polkadot/types-codec": "9.13.2",
|
||||
"@polkadot/types-create": "9.13.2",
|
||||
"@polkadot/api": "9.13.6",
|
||||
"@polkadot/types": "9.13.6",
|
||||
"@polkadot/types-codec": "9.13.6",
|
||||
"@polkadot/types-create": "9.13.6",
|
||||
"@polkadot/util": "^10.3.1",
|
||||
"@polkadot/util-crypto": "^10.3.1",
|
||||
"rxjs": "^7.8.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/api-augment": "9.13.2",
|
||||
"@polkadot/api-augment": "9.13.6",
|
||||
"@polkadot/keyring": "^10.3.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '9.13.2' };
|
||||
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '9.13.6' };
|
||||
|
||||
@@ -20,25 +20,25 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.6",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@polkadot/api": "9.13.2",
|
||||
"@polkadot/api-augment": "9.13.2",
|
||||
"@polkadot/api-base": "9.13.2",
|
||||
"@polkadot/rpc-core": "9.13.2",
|
||||
"@polkadot/types": "9.13.2",
|
||||
"@polkadot/types-codec": "9.13.2",
|
||||
"@polkadot/api": "9.13.6",
|
||||
"@polkadot/api-augment": "9.13.6",
|
||||
"@polkadot/api-base": "9.13.6",
|
||||
"@polkadot/rpc-core": "9.13.6",
|
||||
"@polkadot/types": "9.13.6",
|
||||
"@polkadot/types-codec": "9.13.6",
|
||||
"@polkadot/util": "^10.3.1",
|
||||
"@polkadot/util-crypto": "^10.3.1",
|
||||
"rxjs": "^7.8.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/api": "9.13.2",
|
||||
"@polkadot/api-augment": "9.13.2",
|
||||
"@polkadot/rpc-augment": "9.13.2",
|
||||
"@polkadot/rpc-provider": "9.13.2",
|
||||
"@polkadot/types-support": "9.13.2"
|
||||
"@polkadot/api": "9.13.6",
|
||||
"@polkadot/api-augment": "9.13.6",
|
||||
"@polkadot/rpc-augment": "9.13.6",
|
||||
"@polkadot/rpc-provider": "9.13.6",
|
||||
"@polkadot/types-support": "9.13.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '9.13.2' };
|
||||
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '9.13.6' };
|
||||
|
||||
+14
-14
@@ -20,29 +20,29 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.6",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@polkadot/api-augment": "9.13.2",
|
||||
"@polkadot/api-base": "9.13.2",
|
||||
"@polkadot/api-derive": "9.13.2",
|
||||
"@polkadot/api-augment": "9.13.6",
|
||||
"@polkadot/api-base": "9.13.6",
|
||||
"@polkadot/api-derive": "9.13.6",
|
||||
"@polkadot/keyring": "^10.3.1",
|
||||
"@polkadot/rpc-augment": "9.13.2",
|
||||
"@polkadot/rpc-core": "9.13.2",
|
||||
"@polkadot/rpc-provider": "9.13.2",
|
||||
"@polkadot/types": "9.13.2",
|
||||
"@polkadot/types-augment": "9.13.2",
|
||||
"@polkadot/types-codec": "9.13.2",
|
||||
"@polkadot/types-create": "9.13.2",
|
||||
"@polkadot/types-known": "9.13.2",
|
||||
"@polkadot/rpc-augment": "9.13.6",
|
||||
"@polkadot/rpc-core": "9.13.6",
|
||||
"@polkadot/rpc-provider": "9.13.6",
|
||||
"@polkadot/types": "9.13.6",
|
||||
"@polkadot/types-augment": "9.13.6",
|
||||
"@polkadot/types-codec": "9.13.6",
|
||||
"@polkadot/types-create": "9.13.6",
|
||||
"@polkadot/types-known": "9.13.6",
|
||||
"@polkadot/util": "^10.3.1",
|
||||
"@polkadot/util-crypto": "^10.3.1",
|
||||
"eventemitter3": "^5.0.0",
|
||||
"rxjs": "^7.8.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/api-augment": "9.13.2",
|
||||
"@polkadot/types-support": "9.13.2"
|
||||
"@polkadot/api-augment": "9.13.6",
|
||||
"@polkadot/types-support": "9.13.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -363,8 +363,10 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
}
|
||||
}
|
||||
|
||||
const filterKey = (k: string) => !allKeys.includes(k);
|
||||
const unknown = exposed.filter(filterKey);
|
||||
const unknown = exposed.filter((k: string) =>
|
||||
!allKeys.includes(k) &&
|
||||
!k.includes('_unstable_')
|
||||
);
|
||||
|
||||
if (unknown.length && !this._options.noInitWarn) {
|
||||
l.warn(`RPC methods not decorated: ${unknown.join(', ')}`);
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '9.13.2' };
|
||||
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '9.13.6' };
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.6",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@polkadot/rpc-core": "9.13.2",
|
||||
"@polkadot/types": "9.13.2",
|
||||
"@polkadot/types-codec": "9.13.2",
|
||||
"@polkadot/rpc-core": "9.13.6",
|
||||
"@polkadot/types": "9.13.6",
|
||||
"@polkadot/types-codec": "9.13.6",
|
||||
"@polkadot/util": "^10.3.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ declare module '@polkadot/rpc-core/types/jsonrpc' {
|
||||
/**
|
||||
* Returns the number of transactions sent from given address at given time (block number).
|
||||
**/
|
||||
getTransactionCount: AugmentedRpc<(hash: H256 | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array) => Observable<U256>>;
|
||||
getTransactionCount: AugmentedRpc<(address: H160 | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array) => Observable<U256>>;
|
||||
/**
|
||||
* Returns transaction receipt by transaction hash.
|
||||
**/
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '9.13.2' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '9.13.6' };
|
||||
|
||||
@@ -20,18 +20,18 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.6",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@polkadot/rpc-augment": "9.13.2",
|
||||
"@polkadot/rpc-provider": "9.13.2",
|
||||
"@polkadot/types": "9.13.2",
|
||||
"@polkadot/rpc-augment": "9.13.6",
|
||||
"@polkadot/rpc-provider": "9.13.6",
|
||||
"@polkadot/types": "9.13.6",
|
||||
"@polkadot/util": "^10.3.1",
|
||||
"rxjs": "^7.8.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^10.3.1",
|
||||
"@polkadot/rpc-augment": "9.13.2"
|
||||
"@polkadot/rpc-augment": "9.13.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '9.13.2' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '9.13.6' };
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.6",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@polkadot/keyring": "^10.3.1",
|
||||
"@polkadot/types": "9.13.2",
|
||||
"@polkadot/types-support": "9.13.2",
|
||||
"@polkadot/types": "9.13.6",
|
||||
"@polkadot/types-support": "9.13.6",
|
||||
"@polkadot/util": "^10.3.1",
|
||||
"@polkadot/util-crypto": "^10.3.1",
|
||||
"@polkadot/x-fetch": "^10.3.1",
|
||||
|
||||
@@ -6,7 +6,9 @@ import type { Mock } from '../mock/types';
|
||||
import { mockHttp, TEST_HTTP_URL } from '../mock/mockHttp';
|
||||
import { HttpProvider } from './';
|
||||
|
||||
describe('send', (): void => {
|
||||
// Does not work with Node 18 (native fetch)
|
||||
// See https://github.com/nock/nock/issues/2397
|
||||
describe.skip('send', (): void => {
|
||||
let http: HttpProvider;
|
||||
let mock: Mock;
|
||||
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '9.13.2' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '9.13.6' };
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.6",
|
||||
"main": "index.js",
|
||||
"bin": {
|
||||
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.cjs",
|
||||
@@ -33,15 +33,15 @@
|
||||
"@babel/core": "^7.20.12",
|
||||
"@babel/register": "^7.18.9",
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@polkadot/api": "9.13.2",
|
||||
"@polkadot/api-augment": "9.13.2",
|
||||
"@polkadot/rpc-augment": "9.13.2",
|
||||
"@polkadot/rpc-provider": "9.13.2",
|
||||
"@polkadot/types": "9.13.2",
|
||||
"@polkadot/types-augment": "9.13.2",
|
||||
"@polkadot/types-codec": "9.13.2",
|
||||
"@polkadot/types-create": "9.13.2",
|
||||
"@polkadot/types-support": "9.13.2",
|
||||
"@polkadot/api": "9.13.6",
|
||||
"@polkadot/api-augment": "9.13.6",
|
||||
"@polkadot/rpc-augment": "9.13.6",
|
||||
"@polkadot/rpc-provider": "9.13.6",
|
||||
"@polkadot/types": "9.13.6",
|
||||
"@polkadot/types-augment": "9.13.6",
|
||||
"@polkadot/types-codec": "9.13.6",
|
||||
"@polkadot/types-create": "9.13.6",
|
||||
"@polkadot/types-support": "9.13.6",
|
||||
"@polkadot/util": "^10.3.1",
|
||||
"@polkadot/util-crypto": "^10.3.1",
|
||||
"@polkadot/x-ws": "^10.3.1",
|
||||
@@ -51,6 +51,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/websocket": "^1.0.5",
|
||||
"@types/yargs": "^17.0.20"
|
||||
"@types/yargs": "^17.0.22"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import yargs from 'yargs';
|
||||
import { Definitions } from '@polkadot/types/types';
|
||||
import { formatNumber } from '@polkadot/util';
|
||||
|
||||
import { generateDefaultCalls, generateDefaultConsts, generateDefaultErrors, generateDefaultEvents, generateDefaultQuery, generateDefaultRpc, generateDefaultTx } from './generate';
|
||||
import { generateDefaultConsts, generateDefaultErrors, generateDefaultEvents, generateDefaultQuery, generateDefaultRpc, generateDefaultRuntime, generateDefaultTx } from './generate';
|
||||
import { assertDir, assertFile, getMetadataViaWs, HEADER, writeFile } from './util';
|
||||
|
||||
function generate (metaHex: HexString, pkg: string | undefined, output: string, isStrict?: boolean): void {
|
||||
@@ -45,8 +45,8 @@ function generate (metaHex: HexString, pkg: string | undefined, output: string,
|
||||
generateDefaultEvents(path.join(outputPath, 'augment-api-events.ts'), metaHex, extraTypes, isStrict, customLookupDefinitions);
|
||||
generateDefaultQuery(path.join(outputPath, 'augment-api-query.ts'), metaHex, extraTypes, isStrict, customLookupDefinitions);
|
||||
generateDefaultRpc(path.join(outputPath, 'augment-api-rpc.ts'), extraTypes);
|
||||
generateDefaultRuntime(path.join(outputPath, 'augment-api-runtime.ts'), metaHex, extraTypes, isStrict, customLookupDefinitions);
|
||||
generateDefaultTx(path.join(outputPath, 'augment-api-tx.ts'), metaHex, extraTypes, isStrict, customLookupDefinitions);
|
||||
generateDefaultCalls(path.join(outputPath, 'augment-api-runtime.ts'), metaHex, extraTypes, isStrict, customLookupDefinitions);
|
||||
|
||||
writeFile(path.join(outputPath, 'augment-api.ts'), (): string =>
|
||||
[
|
||||
|
||||
@@ -8,6 +8,6 @@ export { generateDefaultInterface } from './interfaceRegistry';
|
||||
export { generateDefaultLookup } from './lookup';
|
||||
export { generateDefaultQuery } from './query';
|
||||
export { generateDefaultRpc } from './rpc';
|
||||
export { generateDefaultCalls } from './runtime';
|
||||
export { generateDefaultRuntime } from './runtime';
|
||||
export { generateDefaultTsDef } from './tsDef';
|
||||
export { generateDefaultTx } from './tx';
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Metadata } from '@polkadot/types/metadata/Metadata';
|
||||
import type { DefinitionCallNamed, Definitions } from '@polkadot/types/types';
|
||||
import type { DefinitionCallNamed, Definitions, Registry } from '@polkadot/types/types';
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { ExtraTypes } from './types';
|
||||
|
||||
@@ -67,7 +67,7 @@ function getDefs (apis: Apis | null, defs: Record<string, Definitions>): Record<
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export function generateCallTypes (meta: Metadata, dest: string, extraTypes: ExtraTypes, isStrict: boolean, customLookupDefinitions?: Definitions): void {
|
||||
export function generateCallTypes (registry: Registry, meta: Metadata, dest: string, extraTypes: ExtraTypes, isStrict: boolean, customLookupDefinitions?: Definitions): void {
|
||||
writeFile(dest, (): string => {
|
||||
const allTypes: ExtraTypes = {
|
||||
'@polkadot/types-augment': {
|
||||
@@ -83,8 +83,7 @@ export function generateCallTypes (meta: Metadata, dest: string, extraTypes: Ext
|
||||
|
||||
// find the system.Version in metadata
|
||||
let apis: Apis | null = null;
|
||||
const { pallets, registry } = meta.asLatest;
|
||||
const sysp = pallets.find(({ name }) => name.eq('System'));
|
||||
const sysp = meta.asLatest.pallets.find(({ name }) => name.eq('System'));
|
||||
|
||||
if (sysp) {
|
||||
const verc = sysp.constants.find(({ name }) => name.eq('Version'));
|
||||
@@ -163,10 +162,11 @@ export function generateCallTypes (meta: Metadata, dest: string, extraTypes: Ext
|
||||
});
|
||||
}
|
||||
|
||||
export function generateDefaultCalls (dest: string, data: HexString, extraTypes: ExtraTypes = {}, isStrict = false, customLookupDefinitions?: Definitions): void {
|
||||
const { metadata } = initMeta(data, extraTypes);
|
||||
export function generateDefaultRuntime (dest: string, data: HexString, extraTypes: ExtraTypes = {}, isStrict = false, customLookupDefinitions?: Definitions): void {
|
||||
const { metadata, registry } = initMeta(data, extraTypes);
|
||||
|
||||
generateCallTypes(
|
||||
registry,
|
||||
metadata,
|
||||
dest,
|
||||
extraTypes,
|
||||
|
||||
@@ -7,7 +7,7 @@ import kusama from '@polkadot/types-support/metadata/static-kusama';
|
||||
import polkadot from '@polkadot/types-support/metadata/static-polkadot';
|
||||
import substrate from '@polkadot/types-support/metadata/static-substrate';
|
||||
|
||||
import { generateDefaultCalls, generateDefaultConsts, generateDefaultErrors, generateDefaultEvents, generateDefaultInterface, generateDefaultLookup, generateDefaultQuery, generateDefaultRpc, generateDefaultTsDef, generateDefaultTx } from './generate';
|
||||
import { generateDefaultConsts, generateDefaultErrors, generateDefaultEvents, generateDefaultInterface, generateDefaultLookup, generateDefaultQuery, generateDefaultRpc, generateDefaultRuntime, generateDefaultTsDef, generateDefaultTx } from './generate';
|
||||
|
||||
const BASE = 'packages/api-augment/src';
|
||||
const METAS = Object.entries<HexString>({ kusama, polkadot, substrate });
|
||||
@@ -26,7 +26,7 @@ export function main (): void {
|
||||
generateDefaultErrors(`${BASE}/${name}/errors.ts`, staticMeta);
|
||||
generateDefaultEvents(`${BASE}/${name}/events.ts`, staticMeta);
|
||||
generateDefaultQuery(`${BASE}/${name}/query.ts`, staticMeta);
|
||||
generateDefaultRuntime(`${BASE}/${name}/runtime.ts`, staticMeta);
|
||||
generateDefaultTx(`${BASE}/${name}/tx.ts`, staticMeta);
|
||||
generateDefaultCalls(`${BASE}/${name}/runtime.ts`, staticMeta);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '9.13.2' };
|
||||
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '9.13.6' };
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.6",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@polkadot/types": "9.13.2",
|
||||
"@polkadot/types-codec": "9.13.2",
|
||||
"@polkadot/types": "9.13.6",
|
||||
"@polkadot/types-codec": "9.13.6",
|
||||
"@polkadot/util": "^10.3.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '9.13.2' };
|
||||
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '9.13.6' };
|
||||
|
||||
@@ -52,7 +52,7 @@ import type { ProxyAnnouncement, ProxyDefinition, ProxyType } from '@polkadot/ty
|
||||
import type { AccountStatus, AccountValidity } from '@polkadot/types/interfaces/purchase';
|
||||
import type { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery';
|
||||
import type { RpcMethods } from '@polkadot/types/interfaces/rpc';
|
||||
import type { AccountId, AccountId20, AccountId32, AccountId33, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, BlockNumberFor, BlockNumberOf, Call, CallHash, CallHashOf, ChangesTrieConfiguration, ChangesTrieSignal, CodecHash, Consensus, ConsensusEngineId, CrateVersion, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H32, H512, H64, Hash, Header, HeaderPartial, I32F32, Index, IndicesLookupSource, Justification, Justifications, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, MultiSigner, OpaqueCall, Origin, OriginCaller, PalletId, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, SignedBlockWithJustification, SignedBlockWithJustifications, Slot, SlotDuration, StorageData, StorageInfo, StorageProof, TransactionInfo, TransactionLongevity, TransactionPriority, TransactionStorageProof, TransactionTag, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier, WeightV1, WeightV2 } from '@polkadot/types/interfaces/runtime';
|
||||
import type { AccountId, AccountId20, AccountId32, AccountId33, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, BlockNumberFor, BlockNumberOf, Call, CallHash, CallHashOf, ChangesTrieConfiguration, ChangesTrieSignal, CodecHash, Consensus, ConsensusEngineId, CrateVersion, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H32, H512, H64, Hash, Header, HeaderPartial, I32F32, Index, IndicesLookupSource, Justification, Justifications, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, MultiSigner, OpaqueCall, Origin, OriginCaller, PalletId, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, SignedBlockWithJustification, SignedBlockWithJustifications, Slot, SlotDuration, StorageData, StorageInfo, StorageProof, TransactionInfo, TransactionLongevity, TransactionPriority, TransactionStorageProof, TransactionTag, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier, WeightV0, WeightV1, WeightV2 } from '@polkadot/types/interfaces/runtime';
|
||||
import type { Si0Field, Si0LookupTypeId, Si0Path, Si0Type, Si0TypeDef, Si0TypeDefArray, Si0TypeDefBitSequence, Si0TypeDefCompact, Si0TypeDefComposite, Si0TypeDefPhantom, Si0TypeDefPrimitive, Si0TypeDefSequence, Si0TypeDefTuple, Si0TypeDefVariant, Si0TypeParameter, Si0Variant, Si1Field, Si1LookupTypeId, Si1Path, Si1Type, Si1TypeDef, Si1TypeDefArray, Si1TypeDefBitSequence, Si1TypeDefCompact, Si1TypeDefComposite, Si1TypeDefPrimitive, Si1TypeDefSequence, Si1TypeDefTuple, Si1TypeDefVariant, Si1TypeParameter, Si1Variant, SiField, SiLookupTypeId, SiPath, SiType, SiTypeDef, SiTypeDefArray, SiTypeDefBitSequence, SiTypeDefCompact, SiTypeDefComposite, SiTypeDefPrimitive, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiTypeParameter, SiVariant } from '@polkadot/types/interfaces/scaleInfo';
|
||||
import type { Period, Priority, SchedulePeriod, SchedulePriority, Scheduled, ScheduledTo254, TaskAddress } from '@polkadot/types/interfaces/scheduler';
|
||||
import type { BeefyKey, FullIdentification, IdentificationTuple, Keys, MembershipProof, SessionIndex, SessionKeys1, SessionKeys10, SessionKeys10B, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6, SessionKeys6B, SessionKeys7, SessionKeys7B, SessionKeys8, SessionKeys8B, SessionKeys9, SessionKeys9B, ValidatorCount } from '@polkadot/types/interfaces/session';
|
||||
@@ -1153,6 +1153,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
WeightMultiplier: WeightMultiplier;
|
||||
WeightPerClass: WeightPerClass;
|
||||
WeightToFeeCoefficient: WeightToFeeCoefficient;
|
||||
WeightV0: WeightV0;
|
||||
WeightV1: WeightV1;
|
||||
WeightV2: WeightV2;
|
||||
WildFungibility: WildFungibility;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.6",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
@@ -28,9 +28,9 @@
|
||||
"@polkadot/x-bigint": "^10.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/types": "9.13.2",
|
||||
"@polkadot/types-augment": "9.13.2",
|
||||
"@polkadot/types-support": "9.13.2",
|
||||
"@polkadot/types": "9.13.6",
|
||||
"@polkadot/types-augment": "9.13.6",
|
||||
"@polkadot/types-support": "9.13.6",
|
||||
"@polkadot/util-crypto": "^10.3.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,17 +87,11 @@ export class Vec<T extends Codec> extends AbstractArray<T> {
|
||||
|
||||
this.#Type = definition || setDefinition(typeToConstructor<T>(registry, Type));
|
||||
|
||||
try {
|
||||
this.initialU8aLength = (
|
||||
isU8a(decodeFrom)
|
||||
? decodeU8aVec(registry, this, decodeFrom, startAt, this.#Type)
|
||||
: decodeVec(registry, this, decodeFrom, startAt, this.#Type)
|
||||
)[0];
|
||||
} catch (e) {
|
||||
console.error(decodeFrom, length, startAt);
|
||||
|
||||
throw e;
|
||||
}
|
||||
this.initialU8aLength = (
|
||||
isU8a(decodeFrom)
|
||||
? decodeU8aVec(registry, this, decodeFrom, startAt, this.#Type)
|
||||
: decodeVec(registry, this, decodeFrom, startAt, this.#Type)
|
||||
)[0];
|
||||
}
|
||||
|
||||
public static with<O extends Codec> (Type: CodecClass<O> | string): CodecClass<Vec<O>> {
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/types-codec', path: 'auto', type: 'auto', version: '9.13.2' };
|
||||
export const packageInfo = { name: '@polkadot/types-codec', path: 'auto', type: 'auto', version: '9.13.6' };
|
||||
|
||||
@@ -20,14 +20,14 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.6",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@polkadot/types-codec": "9.13.2",
|
||||
"@polkadot/types-codec": "9.13.6",
|
||||
"@polkadot/util": "^10.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/types": "9.13.2"
|
||||
"@polkadot/types": "9.13.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/types-create', path: 'auto', type: 'auto', version: '9.13.2' };
|
||||
export const packageInfo = { name: '@polkadot/types-create', path: 'auto', type: 'auto', version: '9.13.6' };
|
||||
|
||||
@@ -20,17 +20,17 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.6",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@polkadot/networks": "^10.3.1",
|
||||
"@polkadot/types": "9.13.2",
|
||||
"@polkadot/types-codec": "9.13.2",
|
||||
"@polkadot/types-create": "9.13.2",
|
||||
"@polkadot/types": "9.13.6",
|
||||
"@polkadot/types-codec": "9.13.6",
|
||||
"@polkadot/types-create": "9.13.6",
|
||||
"@polkadot/util": "^10.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/api": "9.13.2"
|
||||
"@polkadot/api": "9.13.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/types-known', path: 'auto', type: 'auto', version: '9.13.2' };
|
||||
export const packageInfo = { name: '@polkadot/types-known', path: 'auto', type: 'auto', version: '9.13.6' };
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.6",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
|
||||
@@ -2,5 +2,9 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import metadata from './v14/kusama-hex';
|
||||
import rpc from './v14/kusama-rpc';
|
||||
import version from './v14/kusama-ver';
|
||||
|
||||
export { rpc, version };
|
||||
|
||||
export default metadata;
|
||||
|
||||
@@ -2,5 +2,9 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import metadata from './v14/polkadot-hex';
|
||||
import rpc from './v14/polkadot-rpc';
|
||||
import version from './v14/polkadot-ver';
|
||||
|
||||
export { rpc, version };
|
||||
|
||||
export default metadata;
|
||||
|
||||
@@ -2,5 +2,9 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import metadata from './v14/substrate-hex';
|
||||
import rpc from './v14/substrate-rpc';
|
||||
import version from './v14/substrate-ver';
|
||||
|
||||
export { rpc, version };
|
||||
|
||||
export default metadata;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,123 @@
|
||||
// Copyright 2017-2023 @polkadot/types-support authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/* eslint-disable */
|
||||
|
||||
// cargo run --release -- purge-chain -y --chain kusama-dev && cargo run --release -- --chain kusama-dev --alice --force-authoring
|
||||
|
||||
export default {
|
||||
"methods": [
|
||||
"account_nextIndex",
|
||||
"author_hasKey",
|
||||
"author_hasSessionKeys",
|
||||
"author_insertKey",
|
||||
"author_pendingExtrinsics",
|
||||
"author_removeExtrinsic",
|
||||
"author_rotateKeys",
|
||||
"author_submitAndWatchExtrinsic",
|
||||
"author_submitExtrinsic",
|
||||
"author_unwatchExtrinsic",
|
||||
"babe_epochAuthorship",
|
||||
"beefy_getFinalizedHead",
|
||||
"beefy_subscribeJustifications",
|
||||
"beefy_unsubscribeJustifications",
|
||||
"chainHead_unstable_body",
|
||||
"chainHead_unstable_call",
|
||||
"chainHead_unstable_follow",
|
||||
"chainHead_unstable_genesisHash",
|
||||
"chainHead_unstable_header",
|
||||
"chainHead_unstable_stopBody",
|
||||
"chainHead_unstable_stopCall",
|
||||
"chainHead_unstable_stopStorage",
|
||||
"chainHead_unstable_storage",
|
||||
"chainHead_unstable_unfollow",
|
||||
"chainHead_unstable_unpin",
|
||||
"chain_getBlock",
|
||||
"chain_getBlockHash",
|
||||
"chain_getFinalisedHead",
|
||||
"chain_getFinalizedHead",
|
||||
"chain_getHead",
|
||||
"chain_getHeader",
|
||||
"chain_getRuntimeVersion",
|
||||
"chain_subscribeAllHeads",
|
||||
"chain_subscribeFinalisedHeads",
|
||||
"chain_subscribeFinalizedHeads",
|
||||
"chain_subscribeNewHead",
|
||||
"chain_subscribeNewHeads",
|
||||
"chain_subscribeRuntimeVersion",
|
||||
"chain_unsubscribeAllHeads",
|
||||
"chain_unsubscribeFinalisedHeads",
|
||||
"chain_unsubscribeFinalizedHeads",
|
||||
"chain_unsubscribeNewHead",
|
||||
"chain_unsubscribeNewHeads",
|
||||
"chain_unsubscribeRuntimeVersion",
|
||||
"childstate_getKeys",
|
||||
"childstate_getKeysPaged",
|
||||
"childstate_getKeysPagedAt",
|
||||
"childstate_getStorage",
|
||||
"childstate_getStorageEntries",
|
||||
"childstate_getStorageHash",
|
||||
"childstate_getStorageSize",
|
||||
"grandpa_proveFinality",
|
||||
"grandpa_roundState",
|
||||
"grandpa_subscribeJustifications",
|
||||
"grandpa_unsubscribeJustifications",
|
||||
"mmr_generateProof",
|
||||
"mmr_root",
|
||||
"mmr_verifyProof",
|
||||
"mmr_verifyProofStateless",
|
||||
"offchain_localStorageGet",
|
||||
"offchain_localStorageSet",
|
||||
"payment_queryFeeDetails",
|
||||
"payment_queryInfo",
|
||||
"state_call",
|
||||
"state_callAt",
|
||||
"state_getChildReadProof",
|
||||
"state_getKeys",
|
||||
"state_getKeysPaged",
|
||||
"state_getKeysPagedAt",
|
||||
"state_getMetadata",
|
||||
"state_getPairs",
|
||||
"state_getReadProof",
|
||||
"state_getRuntimeVersion",
|
||||
"state_getStorage",
|
||||
"state_getStorageAt",
|
||||
"state_getStorageHash",
|
||||
"state_getStorageHashAt",
|
||||
"state_getStorageSize",
|
||||
"state_getStorageSizeAt",
|
||||
"state_queryStorage",
|
||||
"state_queryStorageAt",
|
||||
"state_subscribeRuntimeVersion",
|
||||
"state_subscribeStorage",
|
||||
"state_traceBlock",
|
||||
"state_trieMigrationStatus",
|
||||
"state_unsubscribeRuntimeVersion",
|
||||
"state_unsubscribeStorage",
|
||||
"subscribe_newHead",
|
||||
"sync_state_genSyncSpec",
|
||||
"system_accountNextIndex",
|
||||
"system_addLogFilter",
|
||||
"system_addReservedPeer",
|
||||
"system_chain",
|
||||
"system_chainType",
|
||||
"system_dryRun",
|
||||
"system_dryRunAt",
|
||||
"system_health",
|
||||
"system_localListenAddresses",
|
||||
"system_localPeerId",
|
||||
"system_name",
|
||||
"system_nodeRoles",
|
||||
"system_peers",
|
||||
"system_properties",
|
||||
"system_removeReservedPeer",
|
||||
"system_reservedPeers",
|
||||
"system_resetLogFilter",
|
||||
"system_syncState",
|
||||
"system_unstable_networkState",
|
||||
"system_version",
|
||||
"transaction_unstable_submitAndWatch",
|
||||
"transaction_unstable_unwatch",
|
||||
"unsubscribe_newHead"
|
||||
]
|
||||
};
|
||||
@@ -0,0 +1,82 @@
|
||||
// Copyright 2017-2023 @polkadot/types-support authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/* eslint-disable */
|
||||
|
||||
// cargo run --release -- purge-chain -y --chain kusama-dev && cargo run --release -- --chain kusama-dev --alice --force-authoring
|
||||
|
||||
export default {
|
||||
"specName": "kusama",
|
||||
"implName": "parity-kusama",
|
||||
"authoringVersion": 2,
|
||||
"specVersion": 9370,
|
||||
"implVersion": 0,
|
||||
"apis": [
|
||||
[
|
||||
"0xdf6acb689907609b",
|
||||
4
|
||||
],
|
||||
[
|
||||
"0x37e397fc7c91f5e4",
|
||||
1
|
||||
],
|
||||
[
|
||||
"0x40fe3ad401f8959a",
|
||||
6
|
||||
],
|
||||
[
|
||||
"0xd2bc9897eed08f15",
|
||||
3
|
||||
],
|
||||
[
|
||||
"0xf78b278be53f454c",
|
||||
2
|
||||
],
|
||||
[
|
||||
"0xaf2c0297a23e6d3d",
|
||||
2
|
||||
],
|
||||
[
|
||||
"0x49eaaf1b548a0cb0",
|
||||
1
|
||||
],
|
||||
[
|
||||
"0x91d5df18b0d2cf58",
|
||||
1
|
||||
],
|
||||
[
|
||||
"0xed99c5acb25eedf5",
|
||||
3
|
||||
],
|
||||
[
|
||||
"0xcbca25e39f142387",
|
||||
2
|
||||
],
|
||||
[
|
||||
"0x687ad44ad37f03c2",
|
||||
1
|
||||
],
|
||||
[
|
||||
"0xab3c0572291feb8b",
|
||||
1
|
||||
],
|
||||
[
|
||||
"0xbc9d89904f5b923f",
|
||||
1
|
||||
],
|
||||
[
|
||||
"0x37c8bb1350a9a2a8",
|
||||
3
|
||||
],
|
||||
[
|
||||
"0xf3ff14d5ab527059",
|
||||
3
|
||||
],
|
||||
[
|
||||
"0x17a6bc0d0062aeb3",
|
||||
1
|
||||
]
|
||||
],
|
||||
"transactionVersion": 19,
|
||||
"stateVersion": 0
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,123 @@
|
||||
// Copyright 2017-2023 @polkadot/types-support authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/* eslint-disable */
|
||||
|
||||
// cargo run --release -- purge-chain -y --dev && cargo run --release -- --dev
|
||||
|
||||
export default {
|
||||
"methods": [
|
||||
"account_nextIndex",
|
||||
"author_hasKey",
|
||||
"author_hasSessionKeys",
|
||||
"author_insertKey",
|
||||
"author_pendingExtrinsics",
|
||||
"author_removeExtrinsic",
|
||||
"author_rotateKeys",
|
||||
"author_submitAndWatchExtrinsic",
|
||||
"author_submitExtrinsic",
|
||||
"author_unwatchExtrinsic",
|
||||
"babe_epochAuthorship",
|
||||
"beefy_getFinalizedHead",
|
||||
"beefy_subscribeJustifications",
|
||||
"beefy_unsubscribeJustifications",
|
||||
"chainHead_unstable_body",
|
||||
"chainHead_unstable_call",
|
||||
"chainHead_unstable_follow",
|
||||
"chainHead_unstable_genesisHash",
|
||||
"chainHead_unstable_header",
|
||||
"chainHead_unstable_stopBody",
|
||||
"chainHead_unstable_stopCall",
|
||||
"chainHead_unstable_stopStorage",
|
||||
"chainHead_unstable_storage",
|
||||
"chainHead_unstable_unfollow",
|
||||
"chainHead_unstable_unpin",
|
||||
"chain_getBlock",
|
||||
"chain_getBlockHash",
|
||||
"chain_getFinalisedHead",
|
||||
"chain_getFinalizedHead",
|
||||
"chain_getHead",
|
||||
"chain_getHeader",
|
||||
"chain_getRuntimeVersion",
|
||||
"chain_subscribeAllHeads",
|
||||
"chain_subscribeFinalisedHeads",
|
||||
"chain_subscribeFinalizedHeads",
|
||||
"chain_subscribeNewHead",
|
||||
"chain_subscribeNewHeads",
|
||||
"chain_subscribeRuntimeVersion",
|
||||
"chain_unsubscribeAllHeads",
|
||||
"chain_unsubscribeFinalisedHeads",
|
||||
"chain_unsubscribeFinalizedHeads",
|
||||
"chain_unsubscribeNewHead",
|
||||
"chain_unsubscribeNewHeads",
|
||||
"chain_unsubscribeRuntimeVersion",
|
||||
"childstate_getKeys",
|
||||
"childstate_getKeysPaged",
|
||||
"childstate_getKeysPagedAt",
|
||||
"childstate_getStorage",
|
||||
"childstate_getStorageEntries",
|
||||
"childstate_getStorageHash",
|
||||
"childstate_getStorageSize",
|
||||
"grandpa_proveFinality",
|
||||
"grandpa_roundState",
|
||||
"grandpa_subscribeJustifications",
|
||||
"grandpa_unsubscribeJustifications",
|
||||
"mmr_generateProof",
|
||||
"mmr_root",
|
||||
"mmr_verifyProof",
|
||||
"mmr_verifyProofStateless",
|
||||
"offchain_localStorageGet",
|
||||
"offchain_localStorageSet",
|
||||
"payment_queryFeeDetails",
|
||||
"payment_queryInfo",
|
||||
"state_call",
|
||||
"state_callAt",
|
||||
"state_getChildReadProof",
|
||||
"state_getKeys",
|
||||
"state_getKeysPaged",
|
||||
"state_getKeysPagedAt",
|
||||
"state_getMetadata",
|
||||
"state_getPairs",
|
||||
"state_getReadProof",
|
||||
"state_getRuntimeVersion",
|
||||
"state_getStorage",
|
||||
"state_getStorageAt",
|
||||
"state_getStorageHash",
|
||||
"state_getStorageHashAt",
|
||||
"state_getStorageSize",
|
||||
"state_getStorageSizeAt",
|
||||
"state_queryStorage",
|
||||
"state_queryStorageAt",
|
||||
"state_subscribeRuntimeVersion",
|
||||
"state_subscribeStorage",
|
||||
"state_traceBlock",
|
||||
"state_trieMigrationStatus",
|
||||
"state_unsubscribeRuntimeVersion",
|
||||
"state_unsubscribeStorage",
|
||||
"subscribe_newHead",
|
||||
"sync_state_genSyncSpec",
|
||||
"system_accountNextIndex",
|
||||
"system_addLogFilter",
|
||||
"system_addReservedPeer",
|
||||
"system_chain",
|
||||
"system_chainType",
|
||||
"system_dryRun",
|
||||
"system_dryRunAt",
|
||||
"system_health",
|
||||
"system_localListenAddresses",
|
||||
"system_localPeerId",
|
||||
"system_name",
|
||||
"system_nodeRoles",
|
||||
"system_peers",
|
||||
"system_properties",
|
||||
"system_removeReservedPeer",
|
||||
"system_reservedPeers",
|
||||
"system_resetLogFilter",
|
||||
"system_syncState",
|
||||
"system_unstable_networkState",
|
||||
"system_version",
|
||||
"transaction_unstable_submitAndWatch",
|
||||
"transaction_unstable_unwatch",
|
||||
"unsubscribe_newHead"
|
||||
]
|
||||
};
|
||||
@@ -0,0 +1,82 @@
|
||||
// Copyright 2017-2023 @polkadot/types-support authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/* eslint-disable */
|
||||
|
||||
// cargo run --release -- purge-chain -y --dev && cargo run --release -- --dev
|
||||
|
||||
export default {
|
||||
"specName": "polkadot",
|
||||
"implName": "parity-polkadot",
|
||||
"authoringVersion": 0,
|
||||
"specVersion": 9370,
|
||||
"implVersion": 0,
|
||||
"apis": [
|
||||
[
|
||||
"0xdf6acb689907609b",
|
||||
4
|
||||
],
|
||||
[
|
||||
"0x37e397fc7c91f5e4",
|
||||
1
|
||||
],
|
||||
[
|
||||
"0x40fe3ad401f8959a",
|
||||
6
|
||||
],
|
||||
[
|
||||
"0x17a6bc0d0062aeb3",
|
||||
1
|
||||
],
|
||||
[
|
||||
"0xd2bc9897eed08f15",
|
||||
3
|
||||
],
|
||||
[
|
||||
"0xf78b278be53f454c",
|
||||
2
|
||||
],
|
||||
[
|
||||
"0xaf2c0297a23e6d3d",
|
||||
2
|
||||
],
|
||||
[
|
||||
"0x49eaaf1b548a0cb0",
|
||||
1
|
||||
],
|
||||
[
|
||||
"0x91d5df18b0d2cf58",
|
||||
1
|
||||
],
|
||||
[
|
||||
"0xed99c5acb25eedf5",
|
||||
3
|
||||
],
|
||||
[
|
||||
"0xcbca25e39f142387",
|
||||
2
|
||||
],
|
||||
[
|
||||
"0x687ad44ad37f03c2",
|
||||
1
|
||||
],
|
||||
[
|
||||
"0xab3c0572291feb8b",
|
||||
1
|
||||
],
|
||||
[
|
||||
"0xbc9d89904f5b923f",
|
||||
1
|
||||
],
|
||||
[
|
||||
"0x37c8bb1350a9a2a8",
|
||||
3
|
||||
],
|
||||
[
|
||||
"0xf3ff14d5ab527059",
|
||||
3
|
||||
]
|
||||
],
|
||||
"transactionVersion": 20,
|
||||
"stateVersion": 0
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,124 @@
|
||||
// Copyright 2017-2023 @polkadot/types-support authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/* eslint-disable */
|
||||
|
||||
// cargo run --release -- purge-chain -y --dev && cargo run --release -- --dev
|
||||
|
||||
export default {
|
||||
"methods": [
|
||||
"account_nextIndex",
|
||||
"author_hasKey",
|
||||
"author_hasSessionKeys",
|
||||
"author_insertKey",
|
||||
"author_pendingExtrinsics",
|
||||
"author_removeExtrinsic",
|
||||
"author_rotateKeys",
|
||||
"author_submitAndWatchExtrinsic",
|
||||
"author_submitExtrinsic",
|
||||
"author_unwatchExtrinsic",
|
||||
"babe_epochAuthorship",
|
||||
"chainHead_unstable_body",
|
||||
"chainHead_unstable_call",
|
||||
"chainHead_unstable_follow",
|
||||
"chainHead_unstable_genesisHash",
|
||||
"chainHead_unstable_header",
|
||||
"chainHead_unstable_stopBody",
|
||||
"chainHead_unstable_stopCall",
|
||||
"chainHead_unstable_stopStorage",
|
||||
"chainHead_unstable_storage",
|
||||
"chainHead_unstable_unfollow",
|
||||
"chainHead_unstable_unpin",
|
||||
"chainSpec_unstable_chainName",
|
||||
"chainSpec_unstable_genesisHash",
|
||||
"chainSpec_unstable_properties",
|
||||
"chain_getBlock",
|
||||
"chain_getBlockHash",
|
||||
"chain_getFinalisedHead",
|
||||
"chain_getFinalizedHead",
|
||||
"chain_getHead",
|
||||
"chain_getHeader",
|
||||
"chain_getRuntimeVersion",
|
||||
"chain_subscribeAllHeads",
|
||||
"chain_subscribeFinalisedHeads",
|
||||
"chain_subscribeFinalizedHeads",
|
||||
"chain_subscribeNewHead",
|
||||
"chain_subscribeNewHeads",
|
||||
"chain_subscribeRuntimeVersion",
|
||||
"chain_unsubscribeAllHeads",
|
||||
"chain_unsubscribeFinalisedHeads",
|
||||
"chain_unsubscribeFinalizedHeads",
|
||||
"chain_unsubscribeNewHead",
|
||||
"chain_unsubscribeNewHeads",
|
||||
"chain_unsubscribeRuntimeVersion",
|
||||
"childstate_getKeys",
|
||||
"childstate_getKeysPaged",
|
||||
"childstate_getKeysPagedAt",
|
||||
"childstate_getStorage",
|
||||
"childstate_getStorageEntries",
|
||||
"childstate_getStorageHash",
|
||||
"childstate_getStorageSize",
|
||||
"dev_getBlockStats",
|
||||
"grandpa_proveFinality",
|
||||
"grandpa_roundState",
|
||||
"grandpa_subscribeJustifications",
|
||||
"grandpa_unsubscribeJustifications",
|
||||
"mmr_generateProof",
|
||||
"mmr_root",
|
||||
"mmr_verifyProof",
|
||||
"mmr_verifyProofStateless",
|
||||
"offchain_localStorageGet",
|
||||
"offchain_localStorageSet",
|
||||
"payment_queryFeeDetails",
|
||||
"payment_queryInfo",
|
||||
"state_call",
|
||||
"state_callAt",
|
||||
"state_getChildReadProof",
|
||||
"state_getKeys",
|
||||
"state_getKeysPaged",
|
||||
"state_getKeysPagedAt",
|
||||
"state_getMetadata",
|
||||
"state_getPairs",
|
||||
"state_getReadProof",
|
||||
"state_getRuntimeVersion",
|
||||
"state_getStorage",
|
||||
"state_getStorageAt",
|
||||
"state_getStorageHash",
|
||||
"state_getStorageHashAt",
|
||||
"state_getStorageSize",
|
||||
"state_getStorageSizeAt",
|
||||
"state_queryStorage",
|
||||
"state_queryStorageAt",
|
||||
"state_subscribeRuntimeVersion",
|
||||
"state_subscribeStorage",
|
||||
"state_traceBlock",
|
||||
"state_trieMigrationStatus",
|
||||
"state_unsubscribeRuntimeVersion",
|
||||
"state_unsubscribeStorage",
|
||||
"subscribe_newHead",
|
||||
"sync_state_genSyncSpec",
|
||||
"system_accountNextIndex",
|
||||
"system_addLogFilter",
|
||||
"system_addReservedPeer",
|
||||
"system_chain",
|
||||
"system_chainType",
|
||||
"system_dryRun",
|
||||
"system_dryRunAt",
|
||||
"system_health",
|
||||
"system_localListenAddresses",
|
||||
"system_localPeerId",
|
||||
"system_name",
|
||||
"system_nodeRoles",
|
||||
"system_peers",
|
||||
"system_properties",
|
||||
"system_removeReservedPeer",
|
||||
"system_reservedPeers",
|
||||
"system_resetLogFilter",
|
||||
"system_syncState",
|
||||
"system_unstable_networkState",
|
||||
"system_version",
|
||||
"transaction_unstable_submitAndWatch",
|
||||
"transaction_unstable_unwatch",
|
||||
"unsubscribe_newHead"
|
||||
]
|
||||
};
|
||||
@@ -0,0 +1,78 @@
|
||||
// Copyright 2017-2023 @polkadot/types-support authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/* eslint-disable */
|
||||
|
||||
// cargo run --release -- purge-chain -y --dev && cargo run --release -- --dev
|
||||
|
||||
export default {
|
||||
"specName": "node",
|
||||
"implName": "substrate-node",
|
||||
"authoringVersion": 10,
|
||||
"specVersion": 268,
|
||||
"implVersion": 0,
|
||||
"apis": [
|
||||
[
|
||||
"0xdf6acb689907609b",
|
||||
4
|
||||
],
|
||||
[
|
||||
"0x37e397fc7c91f5e4",
|
||||
1
|
||||
],
|
||||
[
|
||||
"0x40fe3ad401f8959a",
|
||||
6
|
||||
],
|
||||
[
|
||||
"0xd2bc9897eed08f15",
|
||||
3
|
||||
],
|
||||
[
|
||||
"0xf78b278be53f454c",
|
||||
2
|
||||
],
|
||||
[
|
||||
"0xed99c5acb25eedf5",
|
||||
3
|
||||
],
|
||||
[
|
||||
"0x17a6bc0d0062aeb3",
|
||||
1
|
||||
],
|
||||
[
|
||||
"0xcbca25e39f142387",
|
||||
2
|
||||
],
|
||||
[
|
||||
"0x687ad44ad37f03c2",
|
||||
1
|
||||
],
|
||||
[
|
||||
"0xbc9d89904f5b923f",
|
||||
1
|
||||
],
|
||||
[
|
||||
"0x68b66ba122c93fa7",
|
||||
2
|
||||
],
|
||||
[
|
||||
"0x37c8bb1350a9a2a8",
|
||||
3
|
||||
],
|
||||
[
|
||||
"0xf3ff14d5ab527059",
|
||||
3
|
||||
],
|
||||
[
|
||||
"0x91d5df18b0d2cf58",
|
||||
1
|
||||
],
|
||||
[
|
||||
"0xab3c0572291feb8b",
|
||||
1
|
||||
]
|
||||
],
|
||||
"transactionVersion": 2,
|
||||
"stateVersion": 1
|
||||
};
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/types-support', path: 'auto', type: 'auto', version: '9.13.2' };
|
||||
export const packageInfo = { name: '@polkadot/types-support', path: 'auto', type: 'auto', version: '9.13.6' };
|
||||
|
||||
@@ -20,20 +20,20 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.6",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@polkadot/keyring": "^10.3.1",
|
||||
"@polkadot/types-augment": "9.13.2",
|
||||
"@polkadot/types-codec": "9.13.2",
|
||||
"@polkadot/types-create": "9.13.2",
|
||||
"@polkadot/types-augment": "9.13.6",
|
||||
"@polkadot/types-codec": "9.13.6",
|
||||
"@polkadot/types-create": "9.13.6",
|
||||
"@polkadot/util": "^10.3.1",
|
||||
"@polkadot/util-crypto": "^10.3.1",
|
||||
"rxjs": "^7.8.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^10.3.1",
|
||||
"@polkadot/types-support": "9.13.2"
|
||||
"@polkadot/types-support": "9.13.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
import type { AnyString, Codec, CodecClass, IU8a, LookupString } from '@polkadot/types-codec/types';
|
||||
import type { CreateOptions, TypeDef } from '@polkadot/types-create/types';
|
||||
import type { ExtDef } from '../extrinsic/signedExtensions/types';
|
||||
import type { ChainProperties, DispatchErrorModule, DispatchErrorModuleU8, DispatchErrorModuleU8a, EventMetadataLatest, Hash, MetadataLatest, SiField, SiLookupTypeId, SiVariant, WeightV2 } from '../interfaces/types';
|
||||
import type { ChainProperties, DispatchErrorModule, DispatchErrorModuleU8, DispatchErrorModuleU8a, EventMetadataLatest, Hash, MetadataLatest, SiField, SiLookupTypeId, SiVariant, WeightV1, WeightV2 } from '../interfaces/types';
|
||||
import type { CallFunction, CodecHasher, Definitions, DetectCodec, RegisteredTypes, Registry, RegistryError, RegistryTypes } from '../types';
|
||||
|
||||
import { DoNotConstruct, Json, Raw } from '@polkadot/types-codec';
|
||||
import { constructTypeClass, createClassUnsafe, createTypeUnsafe } from '@polkadot/types-create';
|
||||
import { assertReturn, BN_ZERO, formatBalance, isFunction, isNumber, isString, isU8a, lazyMethod, logger, objectSpread, stringCamelCase, stringify } from '@polkadot/util';
|
||||
import { assertReturn, BN_ZERO, formatBalance, isBn, isFunction, isNumber, isString, isU8a, lazyMethod, logger, objectSpread, stringCamelCase, stringify } from '@polkadot/util';
|
||||
import { blake2AsU8a } from '@polkadot/util-crypto';
|
||||
|
||||
import { expandExtensionTypes, fallbackExtensions, findUnknownExtensions } from '../extrinsic/signedExtensions';
|
||||
@@ -540,20 +540,29 @@ export class TypeRegistry implements Registry {
|
||||
// attach the lookup before we register any types
|
||||
this.setLookup(lookup);
|
||||
|
||||
// default to V1 - this includes 1.5 (with single field)
|
||||
let weightType = 'WeightV1';
|
||||
const Clazz = this.get<WeightV2>('SpWeightsWeightV2Weight');
|
||||
// we detect based on runtime configuration
|
||||
let Weight: string | null = null;
|
||||
|
||||
// detection for WeightV2 type
|
||||
if (Clazz) {
|
||||
const weight = new Clazz(this);
|
||||
if (this.hasType('SpWeightsWeightV2Weight')) {
|
||||
// detection for WeightV2 type based on latest naming
|
||||
const weightv2 = this.createType<WeightV2>('SpWeightsWeightV2Weight');
|
||||
|
||||
if (weight.refTime && weight.proofSize) {
|
||||
weightType = 'SpWeightsWeightV2Weight';
|
||||
}
|
||||
Weight = weightv2.refTime && weightv2.proofSize
|
||||
// with both refTime & proofSize we use as-is (WeightV2)
|
||||
? 'SpWeightsWeightV2Weight'
|
||||
// fallback to WeightV1 (WeightV1.5 is a struct, single field)
|
||||
: 'WeightV1';
|
||||
} else if (!isBn(this.createType<WeightV1>('Weight'))) {
|
||||
// where we have an already-supplied BN override, we don't clobber
|
||||
// it with our detected value (This protects against pre-defines
|
||||
// where Weight may be aliassed to WeightV0, e.g. in early Kusama chains)
|
||||
Weight = 'WeightV1';
|
||||
}
|
||||
|
||||
this.register({ Weight: weightType });
|
||||
if (Weight) {
|
||||
// we have detected a version, adjust the definition
|
||||
this.register({ Weight });
|
||||
}
|
||||
};
|
||||
|
||||
// sets the metadata
|
||||
|
||||
@@ -306,8 +306,8 @@ export const rpc: DefinitionsRpc = objectSpread({}, netRpc, web3Rpc, {
|
||||
description: 'Returns the number of transactions sent from given address at given time (block number).',
|
||||
params: [
|
||||
{
|
||||
name: 'hash',
|
||||
type: 'H256'
|
||||
name: 'address',
|
||||
type: 'H160'
|
||||
},
|
||||
{
|
||||
isHistoric: true,
|
||||
|
||||
@@ -212,6 +212,7 @@ export default {
|
||||
},
|
||||
ValidatorId: 'AccountId',
|
||||
ValidatorIdOf: 'ValidatorId',
|
||||
WeightV0: 'u32',
|
||||
WeightV1: 'u64',
|
||||
WeightV2: {
|
||||
refTime: 'Compact<u64>',
|
||||
|
||||
@@ -394,6 +394,9 @@ export interface Weight extends WeightV2 {}
|
||||
/** @name WeightMultiplier */
|
||||
export interface WeightMultiplier extends Fixed64 {}
|
||||
|
||||
/** @name WeightV0 */
|
||||
export interface WeightV0 extends u32 {}
|
||||
|
||||
/** @name WeightV1 */
|
||||
export interface WeightV1 extends u64 {}
|
||||
|
||||
|
||||
@@ -47,12 +47,13 @@ const PATHS_ALIAS = splitNamespace([
|
||||
'sp_core::crypto::AccountId32',
|
||||
'sp_runtime::generic::era::Era',
|
||||
'sp_runtime::multiaddress::MultiAddress',
|
||||
// weights 2 (1.5+) is a structure, potentially can be flatenned
|
||||
'frame_support::weights::weight_v2::Weight',
|
||||
'sp_weights::weight_v2::Weight',
|
||||
// ethereum overrides (Frontier, Moonbeam, Polkadot claims)
|
||||
'account::AccountId20',
|
||||
'polkadot_runtime_common::claims::EthereumAddress',
|
||||
// weights 2 is a structure, however for 1.5. with a single field it
|
||||
// should be flatenned (can appear in Compact<Weight> extrinsics)
|
||||
'frame_support::weights::weight_v2::Weight',
|
||||
'sp_weights::weight_v2::Weight',
|
||||
// wildcard matching in place...
|
||||
// these have a specific encoding or logic, use a wildcard for {pallet, darwinia}_democracy
|
||||
'*_democracy::vote::Vote',
|
||||
@@ -153,9 +154,12 @@ function matchParts (first: string[], second: (string | Text)[]): boolean {
|
||||
|
||||
/** @internal check if the path matches the PATHS_ALIAS (with wildcards) */
|
||||
function getAliasPath ({ def, path }: SiType): string | null {
|
||||
// specific logic for weights - we only override when non-complex struct
|
||||
if (path.join('::') === 'sp_weights::weight_v2::Weight' && def.isComposite && def.asComposite.fields.length !== 1) {
|
||||
return null;
|
||||
// specific logic for weights - we override when non-complex struct
|
||||
// (as applied in Weight 1.5 where we also have `Compact<{ refTime: u64 }>)
|
||||
if (['frame_support::weights::weight_v2::Weight', 'sp_weights::weight_v2::Weight'].includes(path.join('::'))) {
|
||||
return !def.isComposite || def.asComposite.fields.length === 1
|
||||
? 'WeightV1'
|
||||
: null;
|
||||
}
|
||||
|
||||
// TODO We need to handle ink! Balance in some way
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/types', path: 'auto', type: 'auto', version: '9.13.2' };
|
||||
export const packageInfo = { name: '@polkadot/types', path: 'auto', type: 'auto', version: '9.13.6' };
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
// Copyright 2017-2023 @polkadot/typegen authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import fs from 'fs';
|
||||
|
||||
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 CMD = {
|
||||
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`,
|
||||
substrate: `${PREAMBLE}// cargo run --release -- purge-chain -y --dev && cargo run --release -- --dev\n\nexport default`
|
||||
}
|
||||
|
||||
let requestId = 0;
|
||||
|
||||
async function get (method) {
|
||||
const res = await fetch('http://127.0.0.1:9933', {
|
||||
body: JSON.stringify({
|
||||
id: ++requestId,
|
||||
jsonrpc: '2.0',
|
||||
method,
|
||||
params: []
|
||||
}),
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
method: 'post'
|
||||
});
|
||||
const body = await res.json();
|
||||
|
||||
return body.result;
|
||||
}
|
||||
|
||||
const [methods, metadata, version] = await Promise.all([
|
||||
get('rpc_methods'),
|
||||
get('state_getMetadata'),
|
||||
get('state_getRuntimeVersion')
|
||||
]);
|
||||
const chain = version.specName === 'node'
|
||||
? 'substrate'
|
||||
: version.specName;
|
||||
const path = `packages/types-support/src/metadata/v${META}/${chain}`;
|
||||
|
||||
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}-ver.ts`, `${CMD[chain]} ${JSON.stringify(version, null, 2)};\n`);
|
||||
|
||||
console.log(`Done. ${chain}/${version.specVersion}`);
|
||||
Reference in New Issue
Block a user