Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf442a4bd4 | ||
|
|
40f432badb | ||
|
|
15a8681ba0 | ||
|
|
61ed6e97f4 | ||
|
|
eee4bf51d6 | ||
|
|
b9cbb9e2e8 |
@@ -1,5 +1,27 @@
|
||||
# CHANGELOG
|
||||
|
||||
## 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:
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
3351 Jaco Allow null as valid param to Int/UInt (#5458)
|
||||
3354 Jaco Adjust for aliasses for Weight 1.5 (#5465)
|
||||
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)
|
||||
|
||||
+4
-4
@@ -11,10 +11,10 @@
|
||||
},
|
||||
"sideEffects": false,
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.5",
|
||||
"versions": {
|
||||
"git": "9.13.2",
|
||||
"npm": "9.13.2"
|
||||
"git": "9.13.5",
|
||||
"npm": "9.13.5"
|
||||
},
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
@@ -39,7 +39,7 @@
|
||||
"@babel/core": "^7.20.12",
|
||||
"@babel/register": "^7.18.9",
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@polkadot/dev": "^0.68.2",
|
||||
"@polkadot/dev": "^0.68.3",
|
||||
"@polkadot/typegen": "workspace:packages/typegen",
|
||||
"@types/jest": "^29.4.0",
|
||||
"copyfiles": "^2.4.1"
|
||||
|
||||
@@ -20,15 +20,15 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.5",
|
||||
"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.5",
|
||||
"@polkadot/rpc-augment": "9.13.5",
|
||||
"@polkadot/types": "9.13.5",
|
||||
"@polkadot/types-augment": "9.13.5",
|
||||
"@polkadot/types-codec": "9.13.5",
|
||||
"@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.5' };
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.5",
|
||||
"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.5",
|
||||
"@polkadot/types": "9.13.5",
|
||||
"@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.5' };
|
||||
|
||||
@@ -20,20 +20,20 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.5",
|
||||
"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.5",
|
||||
"@polkadot/types": "9.13.5",
|
||||
"@polkadot/types-codec": "9.13.5",
|
||||
"@polkadot/types-create": "9.13.5",
|
||||
"@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.5",
|
||||
"@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.5' };
|
||||
|
||||
@@ -20,25 +20,25 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.5",
|
||||
"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.5",
|
||||
"@polkadot/api-augment": "9.13.5",
|
||||
"@polkadot/api-base": "9.13.5",
|
||||
"@polkadot/rpc-core": "9.13.5",
|
||||
"@polkadot/types": "9.13.5",
|
||||
"@polkadot/types-codec": "9.13.5",
|
||||
"@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.5",
|
||||
"@polkadot/api-augment": "9.13.5",
|
||||
"@polkadot/rpc-augment": "9.13.5",
|
||||
"@polkadot/rpc-provider": "9.13.5",
|
||||
"@polkadot/types-support": "9.13.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.5' };
|
||||
|
||||
+14
-14
@@ -20,29 +20,29 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.5",
|
||||
"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.5",
|
||||
"@polkadot/api-base": "9.13.5",
|
||||
"@polkadot/api-derive": "9.13.5",
|
||||
"@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.5",
|
||||
"@polkadot/rpc-core": "9.13.5",
|
||||
"@polkadot/rpc-provider": "9.13.5",
|
||||
"@polkadot/types": "9.13.5",
|
||||
"@polkadot/types-augment": "9.13.5",
|
||||
"@polkadot/types-codec": "9.13.5",
|
||||
"@polkadot/types-create": "9.13.5",
|
||||
"@polkadot/types-known": "9.13.5",
|
||||
"@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.5",
|
||||
"@polkadot/types-support": "9.13.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.5' };
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.5",
|
||||
"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.5",
|
||||
"@polkadot/types": "9.13.5",
|
||||
"@polkadot/types-codec": "9.13.5",
|
||||
"@polkadot/util": "^10.3.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.5' };
|
||||
|
||||
@@ -20,18 +20,18 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.5",
|
||||
"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.5",
|
||||
"@polkadot/rpc-provider": "9.13.5",
|
||||
"@polkadot/types": "9.13.5",
|
||||
"@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.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.5' };
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.5",
|
||||
"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.5",
|
||||
"@polkadot/types-support": "9.13.5",
|
||||
"@polkadot/util": "^10.3.1",
|
||||
"@polkadot/util-crypto": "^10.3.1",
|
||||
"@polkadot/x-fetch": "^10.3.1",
|
||||
|
||||
@@ -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.5' };
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.5",
|
||||
"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.5",
|
||||
"@polkadot/api-augment": "9.13.5",
|
||||
"@polkadot/rpc-augment": "9.13.5",
|
||||
"@polkadot/rpc-provider": "9.13.5",
|
||||
"@polkadot/types": "9.13.5",
|
||||
"@polkadot/types-augment": "9.13.5",
|
||||
"@polkadot/types-codec": "9.13.5",
|
||||
"@polkadot/types-create": "9.13.5",
|
||||
"@polkadot/types-support": "9.13.5",
|
||||
"@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.5' };
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.5",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@polkadot/types": "9.13.2",
|
||||
"@polkadot/types-codec": "9.13.2",
|
||||
"@polkadot/types": "9.13.5",
|
||||
"@polkadot/types-codec": "9.13.5",
|
||||
"@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.5' };
|
||||
|
||||
@@ -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.5",
|
||||
"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.5",
|
||||
"@polkadot/types-augment": "9.13.5",
|
||||
"@polkadot/types-support": "9.13.5",
|
||||
"@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.5' };
|
||||
|
||||
@@ -20,14 +20,14 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.5",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@polkadot/types-codec": "9.13.2",
|
||||
"@polkadot/types-codec": "9.13.5",
|
||||
"@polkadot/util": "^10.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/types": "9.13.2"
|
||||
"@polkadot/types": "9.13.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.5' };
|
||||
|
||||
@@ -20,17 +20,17 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.5",
|
||||
"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.5",
|
||||
"@polkadot/types-codec": "9.13.5",
|
||||
"@polkadot/types-create": "9.13.5",
|
||||
"@polkadot/util": "^10.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/api": "9.13.2"
|
||||
"@polkadot/api": "9.13.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.5' };
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.5",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
|
||||
@@ -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.5' };
|
||||
|
||||
@@ -20,20 +20,20 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "9.13.2",
|
||||
"version": "9.13.5",
|
||||
"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.5",
|
||||
"@polkadot/types-codec": "9.13.5",
|
||||
"@polkadot/types-create": "9.13.5",
|
||||
"@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.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,9 +47,8 @@ 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
|
||||
// weights 1.5+ is a structure 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',
|
||||
@@ -152,12 +151,7 @@ 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;
|
||||
}
|
||||
|
||||
function getAliasPath ({ path }: SiType): string | null {
|
||||
// TODO We need to handle ink! Balance in some way
|
||||
return path.length && PATHS_ALIAS.some((a) => matchParts(a, path))
|
||||
? path[path.length - 1].toString()
|
||||
|
||||
@@ -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.5' };
|
||||
|
||||
Reference in New Issue
Block a user