Compare commits

..
16 Commits
Author SHA1 Message Date
github-actions[bot] 55cb602a71 [CI Skip] release/stable 9.2.4
skip-checks: true
2022-08-27 15:27:25 +00:00
Jaco 904b2aafe7 9.2.4 (#5188) 2022-08-27 18:19:25 +03:00
github-actions[bot] 3dee6a9cb4 [CI Skip] bump/beta 9.2.4-6-x
skip-checks: true
2022-08-26 15:06:21 +00:00
Jaco bd113b124e Pin Github actions (#5187) 2022-08-26 17:58:23 +03:00
github-actions[bot] 580039a23c [CI Skip] bump/beta 9.2.4-5-x
skip-checks: true
2022-08-26 13:18:52 +00:00
Jaco 2472ef8c98 Bump TS (#5186)
* Bump TS

* Adjust types

* False positive
2022-08-26 16:10:26 +03:00
github-actions[bot] 020fb1cd09 [CI Skip] bump/beta 9.2.4-4-x
skip-checks: true
2022-08-26 12:01:51 +00:00
Jaco 3cbebb6d71 Typegen with embebbed Enum in Struct (#5185) 2022-08-26 14:52:04 +03:00
github-actions[bot] 138a64c5fb [CI Skip] bump/beta 9.2.4-3-x
skip-checks: true
2022-08-26 10:23:58 +00:00
Jaco efd76e3e20 Align nextTick in decorate with other usages (#5184) 2022-08-26 13:13:14 +03:00
github-actions[bot] 2b562c80b9 [CI Skip] bump/beta 9.2.4-2-x
skip-checks: true
2022-08-24 06:56:42 +00:00
Jaco f9ab3e7029 Remove drr Observable logging (#5179) 2022-08-24 09:46:05 +03:00
github-actions[bot] fdc30fd2c2 [CI Skip] bump/beta 9.2.4-1-x
skip-checks: true
2022-08-24 06:43:23 +00:00
Jaco d2b40660ad Bump common (#5180) 2022-08-24 09:33:48 +03:00
github-actions[bot] c545cffec0 [CI Skip] bump/beta 9.2.4-0-x
skip-checks: true
2022-08-21 06:33:40 +00:00
Jaco 479719fdcc Correct CHANGELOG (#5178) 2022-08-21 09:25:53 +03:00
48 changed files with 1039 additions and 890 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ jobs:
if: "! startsWith(github.event.head_commit.message, '[CI Skip]') && (!github.event.pull_request || github.event.pull_request.head.repo.full_name == github.repository)"
runs-on: ubuntu-latest
steps:
- uses: jacogr/action-approve@master
- uses: jacogr/action-approve@9d6ce78d26f23ad29d009d034822cf773f2cb50e
with:
authors: jacogr
labels: -auto
+1 -1
View File
@@ -8,7 +8,7 @@ jobs:
merge:
runs-on: ubuntu-latest
steps:
- uses: jacogr/action-merge@master
- uses: jacogr/action-merge@3b4b49af8a8644bf5cbb5409ee236abe04eeb1b0
with:
checks: build,lint,test
labels: -auto
+1 -1
View File
@@ -10,7 +10,7 @@ jobs:
env:
YARN_ENABLE_SCRIPTS: false
steps:
- uses: dessant/lock-threads@v2
- uses: dessant/lock-threads@f1a42f0f44eb83361d617a014663e1a76cf282d2
with:
github-token: ${{ secrets.GH_PAT_BOT }}
issue-lock-inactive-days: '7'
+2 -2
View File
@@ -11,8 +11,8 @@ jobs:
env:
YARN_ENABLE_SCRIPTS: false
steps:
- uses: actions/checkout@v2
- uses: denoland/setup-deno@v1
- uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e
- uses: denoland/setup-deno@004814556e37c54a2f6e31384c9e18e983317366
with:
deno-version: vx.x.x
- name: ${{ matrix.step }}
+1 -1
View File
@@ -19,7 +19,7 @@ jobs:
GH_RELEASE_GITHUB_API_TOKEN: ${{ secrets.GH_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT }}
+2 -2
View File
@@ -12,8 +12,8 @@ jobs:
env:
YARN_ENABLE_SCRIPTS: false
steps:
- uses: actions/checkout@v2
- uses: returntocorp/semgrep-action@v1
- uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e
- uses: returntocorp/semgrep-action@aeafd770072c4f48798b991e3449592bddc2c435
with:
auditOn: push
publishToken: ${{ secrets.SEMGREP_APP_TOKEN }}
+1 -1
View File
@@ -9,7 +9,7 @@ jobs:
env:
YARN_ENABLE_SCRIPTS: false
steps:
- uses: actions/stale@v3
- uses: actions/stale@98ed4cb500039dbcccf4bd9bedada4d0187f2757
with:
repo-token: ${{ secrets.GH_PAT_BOT }}
stale-issue-message: 'This issue has been open for 21 days with no activity and is not labelled as an enhancement. It will be closed in 7 days.'
+12
View File
@@ -1,7 +1,19 @@
# CHANGELOG
## 9.2.4 Aug 27, 2022
Changes:
- Remove extra error logging in internal rpc-core Observable
- Allow for embebbed `Enum` in `Struct` typegen (no `lookupName`)
## 9.2.3 Aug 21, 2022
Contributed:
- Update `@substrate/connect` to latest (Thanks to https://github.com/wirednkod)
Changes:
- Adjust `StakingLedger` with fallback for Kusama 1050 (2 different structures on-chain)
+1 -1
View File
@@ -1,4 +1,4 @@
3199 Jaco 9.2.3 (#5177)
3207 Jaco 9.2.4 (#5188)
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)
+7 -7
View File
@@ -11,10 +11,10 @@
},
"sideEffects": false,
"type": "module",
"version": "9.2.3",
"version": "9.2.4",
"versions": {
"git": "9.2.3",
"npm": "9.2.3"
"git": "9.2.4",
"npm": "9.2.4"
},
"workspaces": [
"packages/*"
@@ -35,15 +35,15 @@
"test:one": "NODE_OPTIONS=--experimental-vm-modules polkadot-dev-run-test --detectOpenHandles --forceExit"
},
"devDependencies": {
"@babel/core": "^7.18.10",
"@babel/core": "^7.18.13",
"@babel/register": "^7.18.9",
"@babel/runtime": "^7.18.9",
"@polkadot/dev": "^0.67.113",
"@polkadot/dev": "^0.67.118",
"@polkadot/typegen": "workspace:packages/typegen",
"@types/jest": "^28.1.7",
"@types/jest": "^28.1.8",
"copyfiles": "^2.4.1"
},
"resolutions": {
"typescript": "^4.7.4"
"typescript": "^4.8.2"
}
}
+8 -8
View File
@@ -20,18 +20,18 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "9.2.3",
"version": "9.2.4",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.9",
"@polkadot/api-base": "9.2.3",
"@polkadot/rpc-augment": "9.2.3",
"@polkadot/types": "9.2.3",
"@polkadot/types-augment": "9.2.3",
"@polkadot/types-codec": "9.2.3",
"@polkadot/util": "^10.1.5"
"@polkadot/api-base": "9.2.4",
"@polkadot/rpc-augment": "9.2.4",
"@polkadot/types": "9.2.4",
"@polkadot/types-augment": "9.2.4",
"@polkadot/types-codec": "9.2.4",
"@polkadot/util": "^10.1.6"
},
"devDependencies": {
"@polkadot/types-support": "9.2.3"
"@polkadot/types-support": "9.2.4"
}
}
+1 -1
View File
@@ -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.2.3' };
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '9.2.4' };
+4 -4
View File
@@ -20,13 +20,13 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "9.2.3",
"version": "9.2.4",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.9",
"@polkadot/rpc-core": "9.2.3",
"@polkadot/types": "9.2.3",
"@polkadot/util": "^10.1.5",
"@polkadot/rpc-core": "9.2.4",
"@polkadot/types": "9.2.4",
"@polkadot/util": "^10.1.6",
"rxjs": "^7.5.6"
}
}
+1 -1
View File
@@ -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.2.3' };
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '9.2.4' };
+9 -9
View File
@@ -20,20 +20,20 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "9.2.3",
"version": "9.2.4",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.9",
"@polkadot/api": "9.2.3",
"@polkadot/types": "9.2.3",
"@polkadot/types-codec": "9.2.3",
"@polkadot/types-create": "9.2.3",
"@polkadot/util": "^10.1.5",
"@polkadot/util-crypto": "^10.1.5",
"@polkadot/api": "9.2.4",
"@polkadot/types": "9.2.4",
"@polkadot/types-codec": "9.2.4",
"@polkadot/types-create": "9.2.4",
"@polkadot/util": "^10.1.6",
"@polkadot/util-crypto": "^10.1.6",
"rxjs": "^7.5.6"
},
"devDependencies": {
"@polkadot/api-augment": "9.2.3",
"@polkadot/keyring": "^10.1.5"
"@polkadot/api-augment": "9.2.4",
"@polkadot/keyring": "^10.1.6"
}
}
+1 -1
View File
@@ -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.2.3' };
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '9.2.4' };
+14 -14
View File
@@ -20,25 +20,25 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "9.2.3",
"version": "9.2.4",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.9",
"@polkadot/api": "9.2.3",
"@polkadot/api-augment": "9.2.3",
"@polkadot/api-base": "9.2.3",
"@polkadot/rpc-core": "9.2.3",
"@polkadot/types": "9.2.3",
"@polkadot/types-codec": "9.2.3",
"@polkadot/util": "^10.1.5",
"@polkadot/util-crypto": "^10.1.5",
"@polkadot/api": "9.2.4",
"@polkadot/api-augment": "9.2.4",
"@polkadot/api-base": "9.2.4",
"@polkadot/rpc-core": "9.2.4",
"@polkadot/types": "9.2.4",
"@polkadot/types-codec": "9.2.4",
"@polkadot/util": "^10.1.6",
"@polkadot/util-crypto": "^10.1.6",
"rxjs": "^7.5.6"
},
"devDependencies": {
"@polkadot/api": "9.2.3",
"@polkadot/api-augment": "9.2.3",
"@polkadot/rpc-augment": "9.2.3",
"@polkadot/rpc-provider": "9.2.3",
"@polkadot/types-support": "9.2.3"
"@polkadot/api": "9.2.4",
"@polkadot/api-augment": "9.2.4",
"@polkadot/rpc-augment": "9.2.4",
"@polkadot/rpc-provider": "9.2.4",
"@polkadot/types-support": "9.2.4"
}
}
+1 -1
View File
@@ -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.2.3' };
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '9.2.4' };
+8 -8
View File
@@ -99,14 +99,14 @@ export const query = firstMemo(
export function queryMulti (instanceId: string, api: DeriveApi): (accountIds: (Uint8Array | string)[], flags: StakingQueryFlags) => Observable<DeriveStakingQuery[]> {
return memo(instanceId, (accountIds: (Uint8Array | string)[], flags: StakingQueryFlags): Observable<DeriveStakingQuery[]> =>
accountIds.length
? api.derive.session.indexes().pipe(
switchMap(({ activeEra }): Observable<DeriveStakingQuery[]> => {
const stashIds = accountIds.map((accountId) => api.registry.createType('AccountId', accountId));
api.derive.session.indexes().pipe(
switchMap(({ activeEra }): Observable<DeriveStakingQuery[]> => {
const stashIds = accountIds.map((a) => api.registry.createType('AccountId', a));
return getBatch(api, activeEra, stashIds, flags);
})
)
: of([])
return stashIds.length
? getBatch(api, activeEra, stashIds, flags)
: of([]);
})
)
);
}
+17 -17
View File
@@ -20,29 +20,29 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "9.2.3",
"version": "9.2.4",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.9",
"@polkadot/api-augment": "9.2.3",
"@polkadot/api-base": "9.2.3",
"@polkadot/api-derive": "9.2.3",
"@polkadot/keyring": "^10.1.5",
"@polkadot/rpc-augment": "9.2.3",
"@polkadot/rpc-core": "9.2.3",
"@polkadot/rpc-provider": "9.2.3",
"@polkadot/types": "9.2.3",
"@polkadot/types-augment": "9.2.3",
"@polkadot/types-codec": "9.2.3",
"@polkadot/types-create": "9.2.3",
"@polkadot/types-known": "9.2.3",
"@polkadot/util": "^10.1.5",
"@polkadot/util-crypto": "^10.1.5",
"@polkadot/api-augment": "9.2.4",
"@polkadot/api-base": "9.2.4",
"@polkadot/api-derive": "9.2.4",
"@polkadot/keyring": "^10.1.6",
"@polkadot/rpc-augment": "9.2.4",
"@polkadot/rpc-core": "9.2.4",
"@polkadot/rpc-provider": "9.2.4",
"@polkadot/types": "9.2.4",
"@polkadot/types-augment": "9.2.4",
"@polkadot/types-codec": "9.2.4",
"@polkadot/types-create": "9.2.4",
"@polkadot/types-known": "9.2.4",
"@polkadot/util": "^10.1.6",
"@polkadot/util-crypto": "^10.1.6",
"eventemitter3": "^4.0.7",
"rxjs": "^7.5.6"
},
"devDependencies": {
"@polkadot/api-augment": "9.2.3",
"@polkadot/types-support": "9.2.3"
"@polkadot/api-augment": "9.2.4",
"@polkadot/types-support": "9.2.4"
}
}
+16 -7
View File
@@ -844,21 +844,29 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
let valueIdx = 0;
let valueObs: Observable<Codec[]>;
// if we don't have queue entries yet,
// or the current queue has fired (see from below),
// or the current queue has the max entries,
// then we create a new queue
if (queueIdx === -1 || !queue[queueIdx] || queue[queueIdx][1].length === PAGE_SIZE_Q) {
queueIdx++;
valueObs = from(
// Defer to the next tick - this aligns with nextTick in @polkadot/util,
// however since we return a value here, we don't re-use what is there
Promise
.resolve()
.then((): [StorageEntry, unknown[]][] => {
// we delay the execution until the next tick, this allows
// any queries made in this timeframe to be added to the same
// queue for a single query
new Promise<[StorageEntry, unknown[]][]>((resolve): void => {
nextTick((): void => {
// get all the calls in this instance, resolve with it
// and then clear the queue so we don't add more
// (anyhting after this will be added to a new queue)
const calls = queue[queueIdx][1];
delete queue[queueIdx];
return calls;
})
resolve(calls);
});
})
).pipe(
switchMap((calls) => query(calls))
);
@@ -872,6 +880,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
}
return valueObs.pipe(
// return the single value at this index
map((values) => values[valueIdx])
);
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '9.2.3' };
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '9.2.4' };
+5 -5
View File
@@ -20,13 +20,13 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "9.2.3",
"version": "9.2.4",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.9",
"@polkadot/rpc-core": "9.2.3",
"@polkadot/types": "9.2.3",
"@polkadot/types-codec": "9.2.3",
"@polkadot/util": "^10.1.5"
"@polkadot/rpc-core": "9.2.4",
"@polkadot/types": "9.2.4",
"@polkadot/types-codec": "9.2.4",
"@polkadot/util": "^10.1.6"
}
}
+1 -1
View File
@@ -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.2.3' };
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '9.2.4' };
+7 -7
View File
@@ -20,18 +20,18 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "9.2.3",
"version": "9.2.4",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.9",
"@polkadot/rpc-augment": "9.2.3",
"@polkadot/rpc-provider": "9.2.3",
"@polkadot/types": "9.2.3",
"@polkadot/util": "^10.1.5",
"@polkadot/rpc-augment": "9.2.4",
"@polkadot/rpc-provider": "9.2.4",
"@polkadot/types": "9.2.4",
"@polkadot/util": "^10.1.6",
"rxjs": "^7.5.6"
},
"devDependencies": {
"@polkadot/keyring": "^10.1.5",
"@polkadot/rpc-augment": "9.2.3"
"@polkadot/keyring": "^10.1.6",
"@polkadot/rpc-augment": "9.2.4"
}
}
+1 -1
View File
@@ -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.2.3' };
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '9.2.4' };
+22 -21
View File
@@ -5,7 +5,7 @@ import type { Observable } from 'rxjs';
import { catchError, distinctUntilChanged, publishReplay, refCount, tap } from 'rxjs';
import { logger, stringify } from '@polkadot/util';
import { stringify } from '@polkadot/util';
import { refCountDelay } from './refCountDelay';
@@ -17,18 +17,17 @@ interface Options {
skipTimeout?: boolean;
}
const l = logger('drr');
const CMP = (a: unknown, b: unknown): boolean =>
stringify({ t: a }) === stringify({ t: b });
const ERR = (error: Error): Observable<never> => {
l.error(error.message);
function CMP (a: unknown, b: unknown): boolean {
return stringify({ t: a }) === stringify({ t: b });
}
function ERR (error: Error): Observable<never> {
throw error;
};
}
const NOOP = (): void => undefined;
function NOOP (): void {
// empty
}
/**
* Shorthand for distinctUntilChanged(), publishReplay(1) and refCount().
@@ -36,14 +35,16 @@ const NOOP = (): void => undefined;
* @ignore
* @internal
*/
export const drr = ({ delay, skipChange = false, skipTimeout = false }: Options = {}): DrrResult => <T> (source$: Observable<T>): Observable<T> =>
source$.pipe(
catchError(ERR),
skipChange
? tap(NOOP)
: distinctUntilChanged<T>(CMP),
publishReplay(1),
skipTimeout
? refCount()
: refCountDelay(delay)
);
export function drr ({ delay, skipChange = false, skipTimeout = false }: Options = {}): DrrResult {
return <T> (source$: Observable<T>): Observable<T> =>
source$.pipe(
catchError(ERR),
skipChange
? tap(NOOP)
: distinctUntilChanged<T>(CMP),
publishReplay(1),
skipTimeout
? refCount()
: refCountDelay(delay)
);
}
+9 -9
View File
@@ -20,18 +20,18 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "9.2.3",
"version": "9.2.4",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.9",
"@polkadot/keyring": "^10.1.5",
"@polkadot/types": "9.2.3",
"@polkadot/types-support": "9.2.3",
"@polkadot/util": "^10.1.5",
"@polkadot/util-crypto": "^10.1.5",
"@polkadot/x-fetch": "^10.1.5",
"@polkadot/x-global": "^10.1.5",
"@polkadot/x-ws": "^10.1.5",
"@polkadot/keyring": "^10.1.6",
"@polkadot/types": "9.2.4",
"@polkadot/types-support": "9.2.4",
"@polkadot/util": "^10.1.6",
"@polkadot/util-crypto": "^10.1.6",
"@polkadot/x-fetch": "^10.1.6",
"@polkadot/x-global": "^10.1.6",
"@polkadot/x-ws": "^10.1.6",
"@substrate/connect": "0.7.11",
"eventemitter3": "^4.0.7",
"mock-socket": "^9.1.5",
+1 -1
View File
@@ -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.2.3' };
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '9.2.4' };
+14 -14
View File
@@ -20,7 +20,7 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "9.2.3",
"version": "9.2.4",
"main": "index.js",
"bin": {
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.cjs",
@@ -30,21 +30,21 @@
"polkadot-types-internal-metadata": "./scripts/polkadot-types-internal-metadata.cjs"
},
"dependencies": {
"@babel/core": "^7.18.10",
"@babel/core": "^7.18.13",
"@babel/register": "^7.18.9",
"@babel/runtime": "^7.18.9",
"@polkadot/api": "9.2.3",
"@polkadot/api-augment": "9.2.3",
"@polkadot/rpc-augment": "9.2.3",
"@polkadot/rpc-provider": "9.2.3",
"@polkadot/types": "9.2.3",
"@polkadot/types-augment": "9.2.3",
"@polkadot/types-codec": "9.2.3",
"@polkadot/types-create": "9.2.3",
"@polkadot/types-support": "9.2.3",
"@polkadot/util": "^10.1.5",
"@polkadot/util-crypto": "^10.1.5",
"@polkadot/x-ws": "^10.1.5",
"@polkadot/api": "9.2.4",
"@polkadot/api-augment": "9.2.4",
"@polkadot/rpc-augment": "9.2.4",
"@polkadot/rpc-provider": "9.2.4",
"@polkadot/types": "9.2.4",
"@polkadot/types-augment": "9.2.4",
"@polkadot/types-codec": "9.2.4",
"@polkadot/types-create": "9.2.4",
"@polkadot/types-support": "9.2.4",
"@polkadot/util": "^10.1.6",
"@polkadot/util-crypto": "^10.1.6",
"@polkadot/x-ws": "^10.1.6",
"handlebars": "^4.7.7",
"websocket": "^1.0.34",
"yargs": "^17.5.1"
+9 -6
View File
@@ -43,9 +43,10 @@ function tsExport (registry: Registry, definitions: Record<string, ModuleTypes>,
}
/** @internal */
function tsEnum (registry: Registry, definitions: Record<string, ModuleTypes>, { lookupIndex, name: enumName, sub }: TypeDef, imports: TypeImports): string {
function tsEnum (registry: Registry, definitions: Record<string, ModuleTypes>, { lookupIndex, name: enumName, sub }: TypeDef, imports: TypeImports, withShortcut = false): string {
setImports(definitions, imports, ['Enum']);
const indent = withShortcut ? ' ' : '';
const named = (sub as TypeDef[]).filter(({ name }) => !!name && !name.startsWith('__Unused'));
const keys = named.map((def): string => {
const { info, lookupName, name = '', type } = def;
@@ -53,7 +54,7 @@ function tsEnum (registry: Registry, definitions: Record<string, ModuleTypes>, {
const isComplex = [TypeDefInfo.Option, TypeDefInfo.Range, TypeDefInfo.RangeInclusive, TypeDefInfo.Result, TypeDefInfo.Struct, TypeDefInfo.Tuple, TypeDefInfo.Vec, TypeDefInfo.VecFixed].includes(info);
const asGetter = type === 'Null' || info === TypeDefInfo.DoNotConstruct
? ''
: createGetter(definitions, `as${getter}`, lookupName || (isComplex ? formatType(registry, definitions, info === TypeDefInfo.Struct ? def : type, imports, false) : type), imports);
: createGetter(definitions, `as${getter}`, lookupName || (isComplex ? formatType(registry, definitions, info === TypeDefInfo.Struct ? def : type, imports, withShortcut) : type), imports);
const isGetter = info === TypeDefInfo.DoNotConstruct
? ''
: createGetter(definitions, `is${getter}`, 'boolean', imports);
@@ -74,18 +75,18 @@ function tsEnum (registry: Registry, definitions: Record<string, ModuleTypes>, {
case TypeDefInfo.VecFixed:
case TypeDefInfo.WrapperKeepOpaque:
case TypeDefInfo.WrapperOpaque:
return `${isGetter}${asGetter}`;
return `${indent}${isGetter}${indent}${asGetter}`;
case TypeDefInfo.DoNotConstruct:
case TypeDefInfo.Null:
return `${isGetter}`;
return `${indent}${isGetter}`;
default:
throw new Error(`Enum: ${enumName || 'undefined'}: Unhandled type ${TypeDefInfo[info]}, ${stringify(def)}`);
}
});
return exportInterface(lookupIndex, enumName, 'Enum', `${keys.join('')} readonly type: ${named.map(({ name = '' }) => `'${stringPascalCase(name.replace(' ', '_'))}'`).join(' | ')};\n`);
return exportInterface(lookupIndex, enumName, 'Enum', `${keys.join('')} ${indent}readonly type: ${named.map(({ name = '' }) => `'${stringPascalCase(name.replace(' ', '_'))}'`).join(' | ')};\n`, withShortcut);
}
function tsInt (_: Registry, definitions: Record<string, ModuleTypes>, def: TypeDef, imports: TypeImports, type: 'Int' | 'UInt' = 'Int'): string {
@@ -176,7 +177,9 @@ function tsStruct (registry: Registry, definitions: Record<string, ModuleTypes>,
const keys = (sub as TypeDef[]).map((def): string => {
const fmtType = def.lookupName && def.name !== def.lookupName
? def.lookupName
: formatType(registry, definitions, def, imports, false);
: def.info === TypeDefInfo.Enum
? `${tsEnum(registry, definitions, def, imports, true)} & Enum`
: formatType(registry, definitions, def, imports, false);
return createGetter(definitions, def.name, fmtType, imports);
});
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '9.2.3' };
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '9.2.4' };
+5 -3
View File
@@ -105,11 +105,13 @@ Handlebars.registerHelper({
// helper to generate a `export interface <Name> extends <Base> {<Body>}
/** @internal */
export function exportInterface (lookupIndex = -1, name = '', base: string, body = ''): string {
export function exportInterface (lookupIndex = -1, name = '', base: string, body = '', withShortcut = false): string {
// * @description extends [[${base}]]
const doc = `/** @name ${name}${lookupIndex !== -1 ? ` (${lookupIndex})` : ''} */\n`;
const doc = withShortcut
? ''
: `/** @name ${name}${lookupIndex !== -1 ? ` (${lookupIndex})` : ''} */\n`;
return `${doc}export interface ${name} extends ${base} {${body.length ? '\n' : ''}${body}}`;
return `${doc}${withShortcut ? '' : `export interface ${name} extends ${base} `}{${body.length ? '\n' : ''}${body}${withShortcut ? ' ' : ''}}`;
}
function singleParamNotation (registry: Registry, wrapper: string, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean): string {
+4 -4
View File
@@ -20,12 +20,12 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "9.2.3",
"version": "9.2.4",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.9",
"@polkadot/types": "9.2.3",
"@polkadot/types-codec": "9.2.3",
"@polkadot/util": "^10.1.5"
"@polkadot/types": "9.2.4",
"@polkadot/types-codec": "9.2.4",
"@polkadot/util": "^10.1.6"
}
}
+1 -1
View File
@@ -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.2.3' };
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '9.2.4' };
+7 -7
View File
@@ -20,17 +20,17 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "9.2.3",
"version": "9.2.4",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.9",
"@polkadot/util": "^10.1.5",
"@polkadot/x-bigint": "^10.1.5"
"@polkadot/util": "^10.1.6",
"@polkadot/x-bigint": "^10.1.6"
},
"devDependencies": {
"@polkadot/types": "9.2.3",
"@polkadot/types-augment": "9.2.3",
"@polkadot/types-support": "9.2.3",
"@polkadot/util-crypto": "^10.1.5"
"@polkadot/types": "9.2.4",
"@polkadot/types-augment": "9.2.4",
"@polkadot/types-support": "9.2.4",
"@polkadot/util-crypto": "^10.1.6"
}
}
+2
View File
@@ -42,6 +42,8 @@ export function decodeVec<T extends Codec> (registry: Registry, result: T[], val
const count = result.length;
for (let i = 0; i < count; i++) {
// 26/08/2022 this is actually a false positive - after recent eslint upgdates
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const entry = value[i];
try {
+1 -1
View File
@@ -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.2.3' };
export const packageInfo = { name: '@polkadot/types-codec', path: 'auto', type: 'auto', version: '9.2.4' };
+4 -4
View File
@@ -20,14 +20,14 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "9.2.3",
"version": "9.2.4",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.9",
"@polkadot/types-codec": "9.2.3",
"@polkadot/util": "^10.1.5"
"@polkadot/types-codec": "9.2.4",
"@polkadot/util": "^10.1.6"
},
"devDependencies": {
"@polkadot/types": "9.2.3"
"@polkadot/types": "9.2.4"
}
}
+1 -1
View File
@@ -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.2.3' };
export const packageInfo = { name: '@polkadot/types-create', path: 'auto', type: 'auto', version: '9.2.4' };
@@ -8,11 +8,13 @@ import { isNumber, isUndefined, objectSpread, stringify } from '@polkadot/util';
import { TypeDefInfo } from '../types';
const stringIdentity = <T extends { toString: () => string }> (value: T): string => value.toString();
type ToString = { toString: () => string };
const stringIdentity = <T extends ToString> (value: T): string => value.toString();
const INFO_WRAP = ['BTreeMap', 'BTreeSet', 'Compact', 'HashMap', 'Option', 'Result', 'Vec'];
export function paramsNotation <T> (outer: string, inner?: T | T[], transform: (_: T) => string = stringIdentity): string {
export function paramsNotation <T extends ToString> (outer: string, inner?: T | T[], transform: (_: T) => string = stringIdentity): string {
return `${outer}${
inner
? `<${(Array.isArray(inner) ? inner : [inner]).map(transform).join(', ')}>`
+7 -7
View File
@@ -20,17 +20,17 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "9.2.3",
"version": "9.2.4",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.9",
"@polkadot/networks": "^10.1.5",
"@polkadot/types": "9.2.3",
"@polkadot/types-codec": "9.2.3",
"@polkadot/types-create": "9.2.3",
"@polkadot/util": "^10.1.5"
"@polkadot/networks": "^10.1.6",
"@polkadot/types": "9.2.4",
"@polkadot/types-codec": "9.2.4",
"@polkadot/types-create": "9.2.4",
"@polkadot/util": "^10.1.6"
},
"devDependencies": {
"@polkadot/api": "9.2.3"
"@polkadot/api": "9.2.4"
}
}
+1 -1
View File
@@ -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.2.3' };
export const packageInfo = { name: '@polkadot/types-known', path: 'auto', type: 'auto', version: '9.2.4' };
+2 -2
View File
@@ -20,10 +20,10 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "9.2.3",
"version": "9.2.4",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.9",
"@polkadot/util": "^10.1.5"
"@polkadot/util": "^10.1.6"
}
}
+1 -1
View File
@@ -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.2.3' };
export const packageInfo = { name: '@polkadot/types-support', path: 'auto', type: 'auto', version: '9.2.4' };
+9 -9
View File
@@ -20,20 +20,20 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "9.2.3",
"version": "9.2.4",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.9",
"@polkadot/keyring": "^10.1.5",
"@polkadot/types-augment": "9.2.3",
"@polkadot/types-codec": "9.2.3",
"@polkadot/types-create": "9.2.3",
"@polkadot/util": "^10.1.5",
"@polkadot/util-crypto": "^10.1.5",
"@polkadot/keyring": "^10.1.6",
"@polkadot/types-augment": "9.2.4",
"@polkadot/types-codec": "9.2.4",
"@polkadot/types-create": "9.2.4",
"@polkadot/util": "^10.1.6",
"@polkadot/util-crypto": "^10.1.6",
"rxjs": "^7.5.6"
},
"devDependencies": {
"@polkadot/keyring": "^10.1.5",
"@polkadot/types-support": "9.2.3"
"@polkadot/keyring": "^10.1.6",
"@polkadot/types-support": "9.2.4"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types', path: 'auto', type: 'auto', version: '9.2.3' };
export const packageInfo = { name: '@polkadot/types', path: 'auto', type: 'auto', version: '9.2.4' };
+809 -691
View File
File diff suppressed because it is too large Load Diff