Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f5c25d75ff | ||
|
|
780cc62942 | ||
|
|
165568c905 | ||
|
|
976a48d8f9 | ||
|
|
35cbbbe0ed | ||
|
|
772769c981 | ||
|
|
1ba2bd1766 | ||
|
|
4afa345a7d | ||
|
|
5c03359f32 | ||
|
|
04120505f0 | ||
|
|
7bd9dd65f8 | ||
|
|
5f57ecb2e1 | ||
|
|
9123f1d805 | ||
|
|
7050c4a554 |
+2
-1
@@ -20,4 +20,5 @@
|
||||
4.0.2
|
||||
4.0.3
|
||||
|
||||
4.6.2
|
||||
4.6.2
|
||||
4.7.2
|
||||
@@ -1,5 +1,18 @@
|
||||
# CHANGELOG
|
||||
|
||||
## 4.7.2 Apr 26, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended for users of 4.7.1 using nvm
|
||||
|
||||
Changes:
|
||||
|
||||
- Update `.nvmrc` to reflect engines changes
|
||||
- Update `EthBlock`/`EthHeader` types (as per Rust origin)
|
||||
- Updated Xcm `OriginKind` enum
|
||||
- Add derives for `membership`
|
||||
- Cleanups on encodedLength calculations
|
||||
|
||||
|
||||
## 4.7.1 Apr 25, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended for users following Substrate master.
|
||||
|
||||
+1
-1
@@ -34,5 +34,5 @@
|
||||
"@types/jest": "^26.0.22",
|
||||
"copyfiles": "^2.4.1"
|
||||
},
|
||||
"version": "4.7.1"
|
||||
"version": "4.7.2"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/api-contract",
|
||||
"version": "4.7.1",
|
||||
"version": "4.7.2",
|
||||
"type": "module",
|
||||
"description": "Interfaces for interacting with contracts and contract ABIs",
|
||||
"main": "index.js",
|
||||
@@ -20,8 +20,8 @@
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.17",
|
||||
"@polkadot/api": "4.7.1",
|
||||
"@polkadot/types": "4.7.1",
|
||||
"@polkadot/api": "4.7.2",
|
||||
"@polkadot/types": "4.7.2",
|
||||
"@polkadot/util": "^6.3.1",
|
||||
"@polkadot/x-rxjs": "^6.3.1",
|
||||
"bn.js": "^4.11.9"
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-contract', version: '4.7.1' };
|
||||
export const packageInfo = { name: '@polkadot/api-contract', version: '4.7.2' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/api-derive",
|
||||
"version": "4.7.1",
|
||||
"version": "4.7.2",
|
||||
"type": "module",
|
||||
"description": "Common functions used across Polkadot, derived from RPC calls and storage queries.",
|
||||
"main": "index.js",
|
||||
@@ -20,9 +20,9 @@
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-derive#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.17",
|
||||
"@polkadot/api": "4.7.1",
|
||||
"@polkadot/rpc-core": "4.7.1",
|
||||
"@polkadot/types": "4.7.1",
|
||||
"@polkadot/api": "4.7.2",
|
||||
"@polkadot/rpc-core": "4.7.2",
|
||||
"@polkadot/types": "4.7.2",
|
||||
"@polkadot/util": "^6.3.1",
|
||||
"@polkadot/util-crypto": "^6.3.1",
|
||||
"@polkadot/x-rxjs": "^6.3.1",
|
||||
@@ -30,6 +30,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^6.3.1",
|
||||
"@polkadot/rpc-provider": "4.7.1"
|
||||
"@polkadot/rpc-provider": "4.7.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ import { catchError, map, switchMap } from '@polkadot/x-rxjs/operators';
|
||||
|
||||
import { memo } from '../util';
|
||||
|
||||
type Collective = 'council' | 'membership' | 'technicalCommittee';
|
||||
|
||||
type Result = [(Hash | Uint8Array | string)[], (Option<Proposal> | null)[], Option<Votes>[]];
|
||||
|
||||
function parse (api: ApiInterfaceRx, [hashes, proposals, votes]: Result): DeriveCollectiveProposal[] {
|
||||
@@ -29,7 +31,7 @@ function parse (api: ApiInterfaceRx, [hashes, proposals, votes]: Result): Derive
|
||||
.filter((proposal): proposal is DeriveCollectiveProposal => !!proposal);
|
||||
}
|
||||
|
||||
function _proposalsFrom (instanceId: string, api: ApiInterfaceRx, section: 'council' | 'technicalCommittee' = 'council'): (hashes: (Hash | Uint8Array | string)[]) => Observable<DeriveCollectiveProposal[]> {
|
||||
function _proposalsFrom (instanceId: string, api: ApiInterfaceRx, section: Collective): (hashes: (Hash | Uint8Array | string)[]) => Observable<DeriveCollectiveProposal[]> {
|
||||
return memo(instanceId, (hashes: (Hash | Uint8Array | string)[]): Observable<DeriveCollectiveProposal[]> =>
|
||||
(isFunction(api.query[section]?.proposals) && hashes.length
|
||||
? combineLatest<Result>([
|
||||
@@ -49,19 +51,19 @@ function _proposalsFrom (instanceId: string, api: ApiInterfaceRx, section: 'coun
|
||||
);
|
||||
}
|
||||
|
||||
export function proposals (instanceId: string, api: ApiInterfaceRx, section: 'council' | 'technicalCommittee' = 'council'): () => Observable<DeriveCollectiveProposal[]> {
|
||||
export function proposals (instanceId: string, api: ApiInterfaceRx, section: Collective): () => Observable<DeriveCollectiveProposal[]> {
|
||||
const proposalsFrom = _proposalsFrom(instanceId, api, section);
|
||||
|
||||
return memo(instanceId, (): Observable<DeriveCollectiveProposal[]> =>
|
||||
isFunction(api.query[section]?.proposals)
|
||||
? api.query[section].proposals().pipe(
|
||||
? api.query[section as 'council'].proposals().pipe(
|
||||
switchMap(proposalsFrom)
|
||||
)
|
||||
: of([] as DeriveCollectiveProposal[])
|
||||
);
|
||||
}
|
||||
|
||||
export function proposal (instanceId: string, api: ApiInterfaceRx, section: 'council' | 'technicalCommittee' = 'council'): (hash: Hash | Uint8Array | string) => Observable<DeriveCollectiveProposal | null> {
|
||||
export function proposal (instanceId: string, api: ApiInterfaceRx, section: Collective): (hash: Hash | Uint8Array | string) => Observable<DeriveCollectiveProposal | null> {
|
||||
const proposalsFrom = _proposalsFrom(instanceId, api, section);
|
||||
|
||||
return memo(instanceId, (hash: Hash | Uint8Array | string): Observable<DeriveCollectiveProposal | null> =>
|
||||
|
||||
@@ -10,9 +10,9 @@ import { proposal as collectiveProposal, proposals as collectiveProposals } from
|
||||
import { memo } from '../util';
|
||||
|
||||
export function proposal (instanceId: string, api: ApiInterfaceRx): (hash: Hash | Uint8Array | string) => Observable<DeriveCollectiveProposal | null> {
|
||||
return memo(instanceId, collectiveProposal(instanceId, api));
|
||||
return memo(instanceId, collectiveProposal(instanceId, api, 'council'));
|
||||
}
|
||||
|
||||
export function proposals (instanceId: string, api: ApiInterfaceRx): () => Observable<DeriveCollectiveProposal[]> {
|
||||
return memo(instanceId, collectiveProposals(instanceId, api));
|
||||
return memo(instanceId, collectiveProposals(instanceId, api, 'council'));
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import * as council from './council';
|
||||
import * as democracy from './democracy';
|
||||
import * as elections from './elections';
|
||||
import * as imOnline from './imOnline';
|
||||
import * as membership from './membership';
|
||||
import * as parachains from './parachains';
|
||||
import * as session from './session';
|
||||
import * as society from './society';
|
||||
@@ -27,7 +28,7 @@ import * as tx from './tx';
|
||||
export { packageInfo } from './packageInfo';
|
||||
export * from './type';
|
||||
|
||||
export const derive = { accounts, balances, bounties, chain, contracts, council, democracy, elections, imOnline, parachains, session, society, staking, technicalCommittee, treasury, tx };
|
||||
export const derive = { accounts, balances, bounties, chain, contracts, council, democracy, elections, imOnline, membership, parachains, session, society, staking, technicalCommittee, treasury, tx };
|
||||
|
||||
type DeriveSection<Section> = {
|
||||
[Method in keyof Section]: Section[Method] extends AnyFunction
|
||||
@@ -49,6 +50,7 @@ const deriveAvail: Record<string, string[]> = {
|
||||
democracy: ['democracy'],
|
||||
elections: ['electionsPhragmen', 'elections'],
|
||||
imOnline: ['imOnline'],
|
||||
membership: ['membership'],
|
||||
parachains: ['parachains', 'registrar'],
|
||||
session: ['session'],
|
||||
society: ['society'],
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export * from './proposals';
|
||||
@@ -0,0 +1,13 @@
|
||||
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ApiInterfaceRx } from '@polkadot/api/types';
|
||||
import type { Observable } from '@polkadot/x-rxjs';
|
||||
import type { DeriveCollectiveProposal } from '../types';
|
||||
|
||||
import { proposals as collectiveProposals } from '../collective';
|
||||
import { memo } from '../util';
|
||||
|
||||
export function proposals (instanceId: string, api: ApiInterfaceRx): () => Observable<DeriveCollectiveProposal[]> {
|
||||
return memo(instanceId, collectiveProposals(instanceId, api, 'membership'));
|
||||
}
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-derive', version: '4.7.1' };
|
||||
export const packageInfo = { name: '@polkadot/api-derive', version: '4.7.2' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/api",
|
||||
"version": "4.7.1",
|
||||
"version": "4.7.2",
|
||||
"type": "module",
|
||||
"description": "Promise and RxJS wrappers around the Polkadot JS RPC",
|
||||
"main": "index.js",
|
||||
@@ -20,13 +20,13 @@
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.17",
|
||||
"@polkadot/api-derive": "4.7.1",
|
||||
"@polkadot/api-derive": "4.7.2",
|
||||
"@polkadot/keyring": "^6.3.1",
|
||||
"@polkadot/metadata": "4.7.1",
|
||||
"@polkadot/rpc-core": "4.7.1",
|
||||
"@polkadot/rpc-provider": "4.7.1",
|
||||
"@polkadot/types": "4.7.1",
|
||||
"@polkadot/types-known": "4.7.1",
|
||||
"@polkadot/metadata": "4.7.2",
|
||||
"@polkadot/rpc-core": "4.7.2",
|
||||
"@polkadot/rpc-provider": "4.7.2",
|
||||
"@polkadot/types": "4.7.2",
|
||||
"@polkadot/types-known": "4.7.2",
|
||||
"@polkadot/util": "^6.3.1",
|
||||
"@polkadot/util-crypto": "^6.3.1",
|
||||
"@polkadot/x-rxjs": "^6.3.1",
|
||||
|
||||
@@ -31,7 +31,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
|
||||
|
||||
#registries: VersionedRegistry[] = [];
|
||||
|
||||
#updateSub?: Subscription;
|
||||
#updateSub?: Subscription | null = null;
|
||||
|
||||
constructor (options: ApiOptions, type: ApiTypes, decorateMethod: DecorateMethod<ApiType>) {
|
||||
super(options, type, decorateMethod);
|
||||
@@ -156,10 +156,10 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
|
||||
// on re-connection to the same chain, we don't want to re-do everything from chain again
|
||||
if (this._isReady) {
|
||||
return true;
|
||||
} else if (this.#updateSub) {
|
||||
this.#updateSub.unsubscribe();
|
||||
}
|
||||
|
||||
this._unsubscribeUpdates();
|
||||
|
||||
// only load from on-chain if we are not a clone (default path), alternatively
|
||||
// just use the values from the source instance provided
|
||||
[this._genesisHash, this._runtimeMetadata] = this._options.source?._isReady
|
||||
@@ -302,6 +302,25 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
|
||||
return true;
|
||||
}
|
||||
|
||||
private _unsubscribeHealth (): void {
|
||||
if (this.#healthTimer) {
|
||||
clearInterval(this.#healthTimer);
|
||||
this.#healthTimer = null;
|
||||
}
|
||||
}
|
||||
|
||||
private _unsubscribeUpdates (): void {
|
||||
if (this.#updateSub) {
|
||||
this.#updateSub.unsubscribe();
|
||||
this.#updateSub = null;
|
||||
}
|
||||
}
|
||||
|
||||
protected _unsubscribe (): void {
|
||||
this._unsubscribeHealth();
|
||||
this._unsubscribeUpdates();
|
||||
}
|
||||
|
||||
#onProviderConnect = async (): Promise<void> => {
|
||||
this.emit('connected');
|
||||
this._isConnected.next(true);
|
||||
@@ -337,10 +356,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
|
||||
this.emit('disconnected');
|
||||
this._isConnected.next(false);
|
||||
|
||||
if (this.#healthTimer) {
|
||||
clearInterval(this.#healthTimer);
|
||||
this.#healthTimer = null;
|
||||
}
|
||||
this._unsubscribeHealth();
|
||||
};
|
||||
|
||||
#onProviderError = (error: Error): void => {
|
||||
|
||||
@@ -50,6 +50,8 @@ export abstract class ApiBase<ApiType extends ApiTypes> extends Getters<ApiType>
|
||||
* @description Disconnect from the underlying provider, halting all network traffic
|
||||
*/
|
||||
public disconnect (): Promise<void> {
|
||||
this._unsubscribe();
|
||||
|
||||
return this._rpcCore.disconnect();
|
||||
}
|
||||
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api', version: '4.7.1' };
|
||||
export const packageInfo = { name: '@polkadot/api', version: '4.7.2' };
|
||||
|
||||
@@ -165,9 +165,7 @@ export class ApiRx extends ApiBase<'rxjs'> {
|
||||
this.#isReadyRx = from<Promise<ApiRx>>(
|
||||
// You can create an observable from an event, however my mind groks this form better
|
||||
new Promise((resolve): void => {
|
||||
super.on('ready', (): void => {
|
||||
resolve(this);
|
||||
});
|
||||
super.on('ready', () => resolve(this));
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/metadata",
|
||||
"version": "4.7.1",
|
||||
"version": "4.7.2",
|
||||
"type": "module",
|
||||
"description": "Helpers to extract information from runtime metadata",
|
||||
"main": "index.js",
|
||||
@@ -20,8 +20,8 @@
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/type-metadata#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.17",
|
||||
"@polkadot/types": "4.7.1",
|
||||
"@polkadot/types-known": "4.7.1",
|
||||
"@polkadot/types": "4.7.2",
|
||||
"@polkadot/types-known": "4.7.2",
|
||||
"@polkadot/util": "^6.3.1",
|
||||
"@polkadot/util-crypto": "^6.3.1",
|
||||
"bn.js": "^4.11.9"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import type { Registry } from '@polkadot/types/types';
|
||||
|
||||
import { isString, u8aConcat, u8aToU8a } from '@polkadot/util';
|
||||
import { isString, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
import { MetadataVersioned } from './MetadataVersioned';
|
||||
|
||||
@@ -11,7 +11,7 @@ import { MetadataVersioned } from './MetadataVersioned';
|
||||
const VERSION_IDX = 4;
|
||||
|
||||
// magic + lowest supported version
|
||||
const EMPTY_METADATA = u8aConcat(new Uint8Array([0x6d, 0x65, 0x74, 0x61, 9]));
|
||||
const EMPTY_METADATA = new Uint8Array([0x6d, 0x65, 0x74, 0x61, 9]);
|
||||
const EMPTY_U8A = new Uint8Array();
|
||||
|
||||
function sanitizeInput (_value: Uint8Array | string = EMPTY_U8A): Uint8Array {
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/metadata', version: '4.7.1' };
|
||||
export const packageInfo = { name: '@polkadot/metadata', version: '4.7.2' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/rpc-core",
|
||||
"version": "4.7.1",
|
||||
"version": "4.7.2",
|
||||
"type": "module",
|
||||
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
|
||||
"main": "index.js",
|
||||
@@ -20,9 +20,9 @@
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-core#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.17",
|
||||
"@polkadot/metadata": "4.7.1",
|
||||
"@polkadot/rpc-provider": "4.7.1",
|
||||
"@polkadot/types": "4.7.1",
|
||||
"@polkadot/metadata": "4.7.2",
|
||||
"@polkadot/rpc-provider": "4.7.2",
|
||||
"@polkadot/types": "4.7.2",
|
||||
"@polkadot/util": "^6.3.1",
|
||||
"@polkadot/x-rxjs": "^6.3.1"
|
||||
},
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/rpc-core', version: '4.7.1' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-core', version: '4.7.2' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/rpc-provider",
|
||||
"version": "4.7.1",
|
||||
"version": "4.7.2",
|
||||
"type": "module",
|
||||
"description": "Transport providers for the API",
|
||||
"main": "index.js",
|
||||
@@ -20,7 +20,7 @@
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.17",
|
||||
"@polkadot/types": "4.7.1",
|
||||
"@polkadot/types": "4.7.2",
|
||||
"@polkadot/util": "^6.3.1",
|
||||
"@polkadot/util-crypto": "^6.3.1",
|
||||
"@polkadot/x-fetch": "^6.3.1",
|
||||
@@ -31,7 +31,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^6.3.1",
|
||||
"@polkadot/metadata": "4.7.1",
|
||||
"@polkadot/metadata": "4.7.2",
|
||||
"mock-socket": "^9.0.3",
|
||||
"nock": "^13.0.11"
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/rpc-provider', version: '4.7.1' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-provider', version: '4.7.2' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/typegen",
|
||||
"version": "4.7.1",
|
||||
"version": "4.7.2",
|
||||
"type": "module",
|
||||
"description": "Type generation scripts",
|
||||
"main": "index.js",
|
||||
@@ -29,10 +29,10 @@
|
||||
"@babel/core": "^7.13.16",
|
||||
"@babel/register": "^7.13.16",
|
||||
"@babel/runtime": "^7.13.17",
|
||||
"@polkadot/api": "4.7.1",
|
||||
"@polkadot/metadata": "4.7.1",
|
||||
"@polkadot/rpc-provider": "4.7.1",
|
||||
"@polkadot/types": "4.7.1",
|
||||
"@polkadot/api": "4.7.2",
|
||||
"@polkadot/metadata": "4.7.2",
|
||||
"@polkadot/rpc-provider": "4.7.2",
|
||||
"@polkadot/types": "4.7.2",
|
||||
"@polkadot/util": "^6.3.1",
|
||||
"handlebars": "^4.7.7",
|
||||
"websocket": "^1.0.34",
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/typegen', version: '4.7.1' };
|
||||
export const packageInfo = { name: '@polkadot/typegen', version: '4.7.2' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/types-known",
|
||||
"version": "4.7.1",
|
||||
"version": "4.7.2",
|
||||
"type": "module",
|
||||
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
|
||||
"main": "index.js",
|
||||
@@ -21,7 +21,7 @@
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.17",
|
||||
"@polkadot/networks": "^6.3.1",
|
||||
"@polkadot/types": "4.7.1",
|
||||
"@polkadot/types": "4.7.2",
|
||||
"@polkadot/util": "^6.3.1",
|
||||
"bn.js": "^4.11.9"
|
||||
},
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/types-known', version: '4.7.1' };
|
||||
export const packageInfo = { name: '@polkadot/types-known', version: '4.7.2' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/types",
|
||||
"version": "4.7.1",
|
||||
"version": "4.7.2",
|
||||
"type": "module",
|
||||
"description": "Implementation of the Parity codec",
|
||||
"main": "index.js",
|
||||
@@ -20,7 +20,7 @@
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.17",
|
||||
"@polkadot/metadata": "4.7.1",
|
||||
"@polkadot/metadata": "4.7.2",
|
||||
"@polkadot/util": "^6.3.1",
|
||||
"@polkadot/util-crypto": "^6.3.1",
|
||||
"@polkadot/x-rxjs": "^6.3.1",
|
||||
|
||||
@@ -21,7 +21,7 @@ import type { FundIndex, FundInfo, LastContribution, TrieIndex } from '@polkadot
|
||||
import type { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy';
|
||||
import type { ApprovalFlag, DefunctVoter, Renouncing, SetIndex, Vote, VoteIndex, VoteThreshold, VoterInfo } from '@polkadot/types/interfaces/elections';
|
||||
import type { CreatedBlock, ImportedAux } from '@polkadot/types/interfaces/engine';
|
||||
import type { EthAccount, EthBlock, EthBloom, EthCallRequest, EthFilter, EthFilterAddress, EthFilterChanges, EthFilterTopic, EthFilterTopicEntry, EthFilterTopicInner, EthHeader, EthLog, EthReceipt, EthRichBlock, EthRichHeader, EthStorageProof, EthSubKind, EthSubParams, EthSubResult, EthSyncInfo, EthSyncStatus, EthTransaction, EthTransactionAction, EthTransactionCondition, EthTransactionRequest, EthTransactionStatus, EthWork, EthereumAccountId, EthereumLookupSource, EthereumSignature } from '@polkadot/types/interfaces/eth';
|
||||
import type { EthAccount, EthBlock, EthBloom, EthCallRequest, EthFilter, EthFilterAddress, EthFilterChanges, EthFilterTopic, EthFilterTopicEntry, EthFilterTopicInner, EthHeader, EthLog, EthReceipt, EthRichBlock, EthRichHeader, EthStorageProof, EthSubKind, EthSubParams, EthSubResult, EthSyncInfo, EthSyncStatus, EthTransaction, EthTransactionAction, EthTransactionCondition, EthTransactionRequest, EthTransactionSignature, EthTransactionStatus, EthWork, EthereumAccountId, EthereumLookupSource, EthereumSignature } from '@polkadot/types/interfaces/eth';
|
||||
import type { EvmAccount, EvmLog, EvmVicinity, ExitError, ExitFatal, ExitReason, ExitRevert, ExitSucceed } from '@polkadot/types/interfaces/evm';
|
||||
import type { AnySignature, EcdsaSignature, Ed25519Signature, Extrinsic, ExtrinsicEra, ExtrinsicPayload, ExtrinsicPayloadUnknown, ExtrinsicPayloadV4, ExtrinsicSignature, ExtrinsicSignatureV4, ExtrinsicUnknown, ExtrinsicV4, ImmortalEra, MortalEra, MultiSignature, Signature, SignerPayload, Sr25519Signature } from '@polkadot/types/interfaces/extrinsics';
|
||||
import type { AssetOptions, Owner, PermissionLatest, PermissionVersions, PermissionsV1 } from '@polkadot/types/interfaces/genericAsset';
|
||||
@@ -41,7 +41,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, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, CallHash, CallHashOf, ChangesTrieConfiguration, CodecHash, Consensus, ConsensusEngineId, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H512, H64, Hash, Header, 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, StorageData, StorageProof, TransactionPriority, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime';
|
||||
import type { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, CallHash, CallHashOf, ChangesTrieConfiguration, CodecHash, Consensus, ConsensusEngineId, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H32, H512, H64, Hash, Header, 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, StorageData, StorageProof, TransactionPriority, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime';
|
||||
import type { SiField, SiLookupTypeId, SiPath, SiType, SiTypeDef, SiTypeDefArray, SiTypeDefComposite, SiTypeDefPrimitive, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, 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';
|
||||
@@ -385,6 +385,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<EthTransactionAction>': Option<EthTransactionAction>;
|
||||
'Option<EthTransactionCondition>': Option<EthTransactionCondition>;
|
||||
'Option<EthTransactionRequest>': Option<EthTransactionRequest>;
|
||||
'Option<EthTransactionSignature>': Option<EthTransactionSignature>;
|
||||
'Option<EthTransactionStatus>': Option<EthTransactionStatus>;
|
||||
'Option<EthWork>': Option<EthWork>;
|
||||
'Option<Event>': Option<Event>;
|
||||
@@ -457,6 +458,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<H160>': Option<H160>;
|
||||
'Option<H2048>': Option<H2048>;
|
||||
'Option<H256>': Option<H256>;
|
||||
'Option<H32>': Option<H32>;
|
||||
'Option<H512>': Option<H512>;
|
||||
'Option<H64>': Option<H64>;
|
||||
'Option<Hash>': Option<Hash>;
|
||||
@@ -1177,6 +1179,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<EthTransactionAction>': Vec<EthTransactionAction>;
|
||||
'Vec<EthTransactionCondition>': Vec<EthTransactionCondition>;
|
||||
'Vec<EthTransactionRequest>': Vec<EthTransactionRequest>;
|
||||
'Vec<EthTransactionSignature>': Vec<EthTransactionSignature>;
|
||||
'Vec<EthTransactionStatus>': Vec<EthTransactionStatus>;
|
||||
'Vec<EthWork>': Vec<EthWork>;
|
||||
'Vec<Event>': Vec<Event>;
|
||||
@@ -1249,6 +1252,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<H160>': Vec<H160>;
|
||||
'Vec<H2048>': Vec<H2048>;
|
||||
'Vec<H256>': Vec<H256>;
|
||||
'Vec<H32>': Vec<H32>;
|
||||
'Vec<H512>': Vec<H512>;
|
||||
'Vec<H64>': Vec<H64>;
|
||||
'Vec<Hash>': Vec<Hash>;
|
||||
@@ -1969,6 +1973,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
EthTransactionAction: EthTransactionAction;
|
||||
EthTransactionCondition: EthTransactionCondition;
|
||||
EthTransactionRequest: EthTransactionRequest;
|
||||
EthTransactionSignature: EthTransactionSignature;
|
||||
EthTransactionStatus: EthTransactionStatus;
|
||||
EthWork: EthWork;
|
||||
Event: Event;
|
||||
@@ -2041,6 +2046,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
H160: H160;
|
||||
H2048: H2048;
|
||||
H256: H256;
|
||||
H32: H32;
|
||||
H512: H512;
|
||||
H64: H64;
|
||||
Hash: Hash;
|
||||
|
||||
@@ -30,9 +30,7 @@ export abstract class AbstractArray<T extends Codec> extends Array<T> implements
|
||||
* @description The length of the value when encoded as a Uint8Array
|
||||
*/
|
||||
public get encodedLength (): number {
|
||||
return this.reduce((total, raw): number => {
|
||||
return total + raw.encodedLength;
|
||||
}, compactToU8a(this.length).length);
|
||||
return this.reduce((total, entry) => total + entry.encodedLength, compactToU8a(this.length).length);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -74,11 +74,7 @@ export class Tuple extends AbstractArray<Codec> {
|
||||
* @description The length of the value when encoded as a Uint8Array
|
||||
*/
|
||||
public get encodedLength (): number {
|
||||
return this.reduce((length: number, entry: Codec): number => {
|
||||
length += entry.encodedLength;
|
||||
|
||||
return length;
|
||||
}, 0);
|
||||
return this.reduce((total, entry) => total + entry.encodedLength, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -63,7 +63,7 @@ export class VecFixed<T extends Codec> extends AbstractArray<T> {
|
||||
* @description The length of the value when encoded as a Uint8Array
|
||||
*/
|
||||
public get encodedLength (): number {
|
||||
return this.toU8a().length;
|
||||
return this.reduce((total, entry) => total + entry.encodedLength, 0);
|
||||
}
|
||||
|
||||
public toU8a (): Uint8Array {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { alias, removeColons } from './sanitize';
|
||||
|
||||
describe('sanitize', (): void => {
|
||||
describe('alias', (): void => {
|
||||
const exec = alias(['String'], 'Text');
|
||||
const exec = alias('String', 'Text');
|
||||
|
||||
it('replaces all occurrences for types', (): void => {
|
||||
expect(exec('(String,Address,MasterString,String)')).toEqual(
|
||||
@@ -27,7 +27,7 @@ describe('sanitize', (): void => {
|
||||
});
|
||||
|
||||
it('handles emdedded Vec/Tuples', (): void => {
|
||||
const ann = alias(['Announcement'], 'ProxyAnnouncement');
|
||||
const ann = alias('Announcement', 'ProxyAnnouncement');
|
||||
|
||||
expect(ann('(Vec<Announcement>,BalanceOf)')).toEqual(
|
||||
'(Vec<ProxyAnnouncement>,BalanceOf)'
|
||||
|
||||
@@ -12,8 +12,8 @@ const BOX_PRECEDING = ['<', '(', '[', '"', ',', ' ']; // start of vec, tuple, fi
|
||||
|
||||
const mappings: Mapper[] = [
|
||||
// alias <T::InherentOfflineReport as InherentOfflineReport>::Inherent -> InherentOfflineReport
|
||||
alias(['<T::InherentOfflineReport as InherentOfflineReport>::Inherent'], 'InherentOfflineReport', false),
|
||||
alias(['VecDeque<'], 'Vec<', false),
|
||||
alias('<T::InherentOfflineReport as InherentOfflineReport>::Inherent', 'InherentOfflineReport', false),
|
||||
alias('VecDeque<', 'Vec<', false),
|
||||
// <T::Balance as HasCompact>
|
||||
cleanupCompact(),
|
||||
// Change BoundedVec<Type, Size> to Vec<Type>
|
||||
@@ -27,16 +27,17 @@ const mappings: Mapper[] = [
|
||||
// remove generics, `MisbehaviorReport<Hash, BlockNumber>` -> `MisbehaviorReport`
|
||||
removeGenerics(),
|
||||
// alias String -> Text (compat with jsonrpc methods)
|
||||
alias(['String'], 'Text'),
|
||||
alias('String', 'Text'),
|
||||
// alias Vec<u8> -> Bytes
|
||||
alias(['Vec<u8>', '&\\[u8\\]'], 'Bytes'),
|
||||
alias('Vec<u8>', 'Bytes'),
|
||||
alias('&\\[u8\\]', 'Bytes'),
|
||||
// alias RawAddress -> Address
|
||||
alias(['RawAddress'], 'Address'),
|
||||
alias('RawAddress', 'Address'),
|
||||
// lookups, mapped to Address/AccountId as appropriate in runtime
|
||||
alias(['Lookup::Source'], 'LookupSource'),
|
||||
alias(['Lookup::Target'], 'LookupTarget'),
|
||||
alias('Lookup::Source', 'LookupSource'),
|
||||
alias('Lookup::Target', 'LookupTarget'),
|
||||
// HACK duplication between contracts & primitives, however contracts prefixed with exec
|
||||
alias(['exec::StorageKey'], 'ContractStorageKey'),
|
||||
alias('exec::StorageKey', 'ContractStorageKey'),
|
||||
// flattens tuples with one value, `(AccountId)` -> `AccountId`
|
||||
flattenSingleTuple(),
|
||||
// converts ::Type to Type, <T as Trait<I>>::Proposal -> Proposal
|
||||
@@ -62,17 +63,14 @@ export function findClosing (value: string, start: number): number {
|
||||
throw new Error(`Unable to find closing matching <> on '${value}' (start ${start})`);
|
||||
}
|
||||
|
||||
export function alias (src: string[], dest: string, withChecks = true): Mapper {
|
||||
export function alias (src: string, dest: string, withChecks = true): Mapper {
|
||||
return (value: string): string =>
|
||||
src.reduce((value, src): string =>
|
||||
value
|
||||
.replace(
|
||||
new RegExp(`(^${src}|${BOX_PRECEDING.map((box) => `\\${box}${src}`).join('|')})`, 'g'),
|
||||
(src): string =>
|
||||
withChecks && BOX_PRECEDING.includes(src[0])
|
||||
? `${src[0]}${dest}`
|
||||
: dest
|
||||
), value
|
||||
value.replace(
|
||||
new RegExp(`(^${src}|${BOX_PRECEDING.map((box) => `\\${box}${src}`).join('|')})`, 'g'),
|
||||
(src): string =>
|
||||
withChecks && BOX_PRECEDING.includes(src[0])
|
||||
? `${src[0]}${dest}`
|
||||
: dest
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,28 @@ const types: DefinitionsTypes = {
|
||||
storageProof: 'Vec<EthStorageProof>'
|
||||
},
|
||||
EthBlock: {
|
||||
header: 'EthHeader',
|
||||
transactions: 'Vec<EthTransaction>',
|
||||
ommers: 'Vec<EthHeader>'
|
||||
},
|
||||
EthHeader: {
|
||||
parentHash: 'H256',
|
||||
ommersHash: 'H256',
|
||||
beneficiary: 'H160',
|
||||
stateRoot: 'H256',
|
||||
transactionsRoot: 'H256',
|
||||
receiptsRoot: 'H256',
|
||||
logsBloom: 'EthBloom',
|
||||
difficulty: 'U256',
|
||||
number: 'U256',
|
||||
gasLimit: 'U256',
|
||||
gasUsed: 'U256',
|
||||
timestamp: 'u64',
|
||||
extraData: 'Bytes',
|
||||
mixMash: 'H256',
|
||||
nonce: 'H64'
|
||||
},
|
||||
EthRichBlock: {
|
||||
_alias: {
|
||||
blockHash: 'hash',
|
||||
blockSize: 'size'
|
||||
@@ -40,7 +62,7 @@ const types: DefinitionsTypes = {
|
||||
gasUsed: 'U256',
|
||||
gasLimit: 'U256',
|
||||
extraData: 'Bytes',
|
||||
logsBloom: 'H2048',
|
||||
logsBloom: 'EthBloom',
|
||||
timestamp: 'U256',
|
||||
difficulty: 'U256',
|
||||
totalDifficulty: 'Option<U256>',
|
||||
@@ -95,7 +117,7 @@ const types: DefinitionsTypes = {
|
||||
Null: 'Null'
|
||||
}
|
||||
},
|
||||
EthHeader: {
|
||||
EthRichHeader: {
|
||||
_alias: {
|
||||
blockHash: 'hash',
|
||||
blockSize: 'size'
|
||||
@@ -112,7 +134,7 @@ const types: DefinitionsTypes = {
|
||||
gasUsed: 'U256',
|
||||
gasLimit: 'U256',
|
||||
extraData: 'Bytes',
|
||||
logsBloom: 'H2048',
|
||||
logsBloom: 'EthBloom',
|
||||
timestamp: 'U256',
|
||||
difficulty: 'U256',
|
||||
sealFields: 'Vec<Bytes>',
|
||||
@@ -142,11 +164,9 @@ const types: DefinitionsTypes = {
|
||||
contractAddress: 'Option<H160>',
|
||||
logs: 'Vec<EthLog>',
|
||||
root: 'Option<H256>',
|
||||
logsBloom: 'H2048',
|
||||
logsBloom: 'EthBloom',
|
||||
statusCode: 'Option<U64>'
|
||||
},
|
||||
EthRichBlock: 'EthBlock',
|
||||
EthRichHeader: 'EthHeader',
|
||||
EthStorageProof: {
|
||||
key: 'U256',
|
||||
value: 'U256',
|
||||
@@ -189,35 +209,13 @@ const types: DefinitionsTypes = {
|
||||
action: 'EthTransactionAction',
|
||||
value: 'U256',
|
||||
input: 'Bytes',
|
||||
// TransactionSignature (embedded)
|
||||
signature: 'EthTransactionSignature'
|
||||
},
|
||||
EthTransactionSignature: {
|
||||
v: 'u64',
|
||||
r: 'H256',
|
||||
s: 'H256'
|
||||
},
|
||||
// as per the RPC definition
|
||||
// TODO: Check these, re-add
|
||||
// EthTransaction: {
|
||||
// // hash in Rust
|
||||
// transactionHash: 'H256',
|
||||
// nonce: 'U256',
|
||||
// blockHash: 'Option<H256>',
|
||||
// blockNumber: 'Option<U256>',
|
||||
// transactionIndex: 'Option<U256>',
|
||||
// from: 'H160',
|
||||
// to: 'Option<H160>',
|
||||
// value: 'U256',
|
||||
// gasPrice: 'U256',
|
||||
// gas: 'U256',
|
||||
// input: 'Bytes',
|
||||
// creates: 'Option<H160>',
|
||||
// raw: 'Bytes',
|
||||
// publicKey: 'Option<H512>',
|
||||
// chainId: 'Option<U64>',
|
||||
// standardV: 'U256',
|
||||
// v: 'U256',
|
||||
// r: 'U256',
|
||||
// s: 'U256'
|
||||
// },
|
||||
EthTransactionAction: {
|
||||
_enum: {
|
||||
Call: 'H160',
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* eslint-disable */
|
||||
|
||||
import type { Bytes, Enum, GenericEthereumAccountId, GenericEthereumLookupSource, Option, Struct, U256, U64, U8aFixed, Vec, bool, u32, u64 } from '@polkadot/types';
|
||||
import type { BlockNumber, H160, H2048, H256 } from '@polkadot/types/interfaces/runtime';
|
||||
import type { BlockNumber, H160, H2048, H256, H64 } from '@polkadot/types/interfaces/runtime';
|
||||
|
||||
/** @name EthAccount */
|
||||
export interface EthAccount extends Struct {
|
||||
@@ -17,26 +17,9 @@ export interface EthAccount extends Struct {
|
||||
|
||||
/** @name EthBlock */
|
||||
export interface EthBlock extends Struct {
|
||||
readonly blockHash: Option<H256>;
|
||||
readonly parentHash: H256;
|
||||
readonly sha3Uncles: H256;
|
||||
readonly author: H160;
|
||||
readonly miner: H160;
|
||||
readonly stateRoot: H256;
|
||||
readonly transactionsRoot: H256;
|
||||
readonly receiptsRoot: H256;
|
||||
readonly number: Option<U256>;
|
||||
readonly gasUsed: U256;
|
||||
readonly gasLimit: U256;
|
||||
readonly extraData: Bytes;
|
||||
readonly logsBloom: H2048;
|
||||
readonly timestamp: U256;
|
||||
readonly difficulty: U256;
|
||||
readonly totalDifficulty: Option<U256>;
|
||||
readonly sealFields: Vec<Bytes>;
|
||||
readonly uncles: Vec<H256>;
|
||||
readonly header: EthHeader;
|
||||
readonly transactions: Vec<EthTransaction>;
|
||||
readonly blockSize: Option<U256>;
|
||||
readonly ommers: Vec<EthHeader>;
|
||||
}
|
||||
|
||||
/** @name EthBloom */
|
||||
@@ -112,23 +95,21 @@ export interface EthFilterTopicInner extends Enum {
|
||||
|
||||
/** @name EthHeader */
|
||||
export interface EthHeader extends Struct {
|
||||
readonly blockHash: Option<H256>;
|
||||
readonly parentHash: H256;
|
||||
readonly sha3Uncles: H256;
|
||||
readonly author: H160;
|
||||
readonly miner: H160;
|
||||
readonly ommersHash: H256;
|
||||
readonly beneficiary: H160;
|
||||
readonly stateRoot: H256;
|
||||
readonly transactionsRoot: H256;
|
||||
readonly receiptsRoot: H256;
|
||||
readonly number: Option<U256>;
|
||||
readonly gasUsed: U256;
|
||||
readonly gasLimit: U256;
|
||||
readonly extraData: Bytes;
|
||||
readonly logsBloom: H2048;
|
||||
readonly timestamp: U256;
|
||||
readonly logsBloom: EthBloom;
|
||||
readonly difficulty: U256;
|
||||
readonly sealFields: Vec<Bytes>;
|
||||
readonly blockSize: Option<U256>;
|
||||
readonly number: U256;
|
||||
readonly gasLimit: U256;
|
||||
readonly gasUsed: U256;
|
||||
readonly timestamp: u64;
|
||||
readonly extraData: Bytes;
|
||||
readonly mixMash: H256;
|
||||
readonly nonce: H64;
|
||||
}
|
||||
|
||||
/** @name EthLog */
|
||||
@@ -158,15 +139,54 @@ export interface EthReceipt extends Struct {
|
||||
readonly contractAddress: Option<H160>;
|
||||
readonly logs: Vec<EthLog>;
|
||||
readonly root: Option<H256>;
|
||||
readonly logsBloom: H2048;
|
||||
readonly logsBloom: EthBloom;
|
||||
readonly statusCode: Option<U64>;
|
||||
}
|
||||
|
||||
/** @name EthRichBlock */
|
||||
export interface EthRichBlock extends EthBlock {}
|
||||
export interface EthRichBlock extends Struct {
|
||||
readonly blockHash: Option<H256>;
|
||||
readonly parentHash: H256;
|
||||
readonly sha3Uncles: H256;
|
||||
readonly author: H160;
|
||||
readonly miner: H160;
|
||||
readonly stateRoot: H256;
|
||||
readonly transactionsRoot: H256;
|
||||
readonly receiptsRoot: H256;
|
||||
readonly number: Option<U256>;
|
||||
readonly gasUsed: U256;
|
||||
readonly gasLimit: U256;
|
||||
readonly extraData: Bytes;
|
||||
readonly logsBloom: EthBloom;
|
||||
readonly timestamp: U256;
|
||||
readonly difficulty: U256;
|
||||
readonly totalDifficulty: Option<U256>;
|
||||
readonly sealFields: Vec<Bytes>;
|
||||
readonly uncles: Vec<H256>;
|
||||
readonly transactions: Vec<EthTransaction>;
|
||||
readonly blockSize: Option<U256>;
|
||||
}
|
||||
|
||||
/** @name EthRichHeader */
|
||||
export interface EthRichHeader extends EthHeader {}
|
||||
export interface EthRichHeader extends Struct {
|
||||
readonly blockHash: Option<H256>;
|
||||
readonly parentHash: H256;
|
||||
readonly sha3Uncles: H256;
|
||||
readonly author: H160;
|
||||
readonly miner: H160;
|
||||
readonly stateRoot: H256;
|
||||
readonly transactionsRoot: H256;
|
||||
readonly receiptsRoot: H256;
|
||||
readonly number: Option<U256>;
|
||||
readonly gasUsed: U256;
|
||||
readonly gasLimit: U256;
|
||||
readonly extraData: Bytes;
|
||||
readonly logsBloom: EthBloom;
|
||||
readonly timestamp: U256;
|
||||
readonly difficulty: U256;
|
||||
readonly sealFields: Vec<Bytes>;
|
||||
readonly blockSize: Option<U256>;
|
||||
}
|
||||
|
||||
/** @name EthStorageProof */
|
||||
export interface EthStorageProof extends Struct {
|
||||
@@ -226,9 +246,7 @@ export interface EthTransaction extends Struct {
|
||||
readonly action: EthTransactionAction;
|
||||
readonly value: U256;
|
||||
readonly input: Bytes;
|
||||
readonly v: u64;
|
||||
readonly r: H256;
|
||||
readonly s: H256;
|
||||
readonly signature: EthTransactionSignature;
|
||||
}
|
||||
|
||||
/** @name EthTransactionAction */
|
||||
@@ -257,6 +275,13 @@ export interface EthTransactionRequest extends Struct {
|
||||
readonly nonce: Option<U256>;
|
||||
}
|
||||
|
||||
/** @name EthTransactionSignature */
|
||||
export interface EthTransactionSignature extends Struct {
|
||||
readonly v: u64;
|
||||
readonly r: H256;
|
||||
readonly s: H256;
|
||||
}
|
||||
|
||||
/** @name EthTransactionStatus */
|
||||
export interface EthTransactionStatus extends Struct {
|
||||
readonly transactionHash: H256;
|
||||
|
||||
@@ -62,8 +62,9 @@ export default {
|
||||
normal: 'Weight',
|
||||
operational: 'Weight'
|
||||
},
|
||||
H32: '[u8; 4; H32]',
|
||||
H64: '[u8; 8; H64]',
|
||||
H128: '[u8; 16; H64]',
|
||||
H128: '[u8; 16; H128]',
|
||||
H160: '[u8; 20; H160]',
|
||||
H256: '[u8; 32; H256]',
|
||||
H512: '[u8; 64; H512]',
|
||||
|
||||
@@ -123,6 +123,9 @@ export interface H2048 extends U8aFixed {}
|
||||
/** @name H256 */
|
||||
export interface H256 extends U8aFixed {}
|
||||
|
||||
/** @name H32 */
|
||||
export interface H32 extends U8aFixed {}
|
||||
|
||||
/** @name H512 */
|
||||
export interface H512 extends U8aFixed {}
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ export default {
|
||||
...xmcOrder,
|
||||
DoubleEncodedCall: { encoded: 'Vec<u8>' },
|
||||
XcmOriginKind: {
|
||||
_enum: ['Native', 'SovereignAccount', 'Superuser']
|
||||
_enum: ['Native', 'SovereignAccount', 'Superuser', 'Xcm']
|
||||
},
|
||||
XcmResponse: {
|
||||
_enum: {
|
||||
@@ -212,7 +212,8 @@ export default {
|
||||
WeightNotComputable: 'Null',
|
||||
Barrier: 'Null',
|
||||
NotWithdrawable: 'Null',
|
||||
LocationCannotHold: 'Null'
|
||||
LocationCannotHold: 'Null',
|
||||
TooExpensive: 'Null'
|
||||
}
|
||||
},
|
||||
XcmOutcome: {
|
||||
|
||||
@@ -281,6 +281,7 @@ export interface XcmError extends Enum {
|
||||
readonly isBarrier: boolean;
|
||||
readonly isNotWithdrawable: boolean;
|
||||
readonly isLocationCannotHold: boolean;
|
||||
readonly isTooExpensive: boolean;
|
||||
}
|
||||
|
||||
/** @name XcmHrmpChannelAccepted */
|
||||
@@ -375,6 +376,7 @@ export interface XcmOriginKind extends Enum {
|
||||
readonly isNative: boolean;
|
||||
readonly isSovereignAccount: boolean;
|
||||
readonly isSuperuser: boolean;
|
||||
readonly isXcm: boolean;
|
||||
}
|
||||
|
||||
/** @name XcmOutcome */
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/types', version: '4.7.1' };
|
||||
export const packageInfo = { name: '@polkadot/types', version: '4.7.2' };
|
||||
|
||||
@@ -28,7 +28,7 @@ function decodeText (value?: null | Text | string | AnyU8a | { toString: () => s
|
||||
const [offset, length] = compactFromU8a(value);
|
||||
const total = offset + length.toNumber();
|
||||
|
||||
assert(length.lten(MAX_LENGTH), () => `Text length ${length.toString()} exceeds ${MAX_LENGTH}`);
|
||||
assert(length.lten(MAX_LENGTH), () => `Text: length ${length.toString()} exceeds ${MAX_LENGTH}`);
|
||||
assert(total <= value.length, () => `Text: required length less than remainder, expected at least ${total}, found ${value.length}`);
|
||||
|
||||
return u8aToString(value.subarray(offset, total));
|
||||
|
||||
@@ -1788,24 +1788,24 @@ __metadata:
|
||||
resolution: "@polkadot/api-contract@workspace:packages/api-contract"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.13.17
|
||||
"@polkadot/api": 4.7.1
|
||||
"@polkadot/types": 4.7.1
|
||||
"@polkadot/api": 4.7.2
|
||||
"@polkadot/types": 4.7.2
|
||||
"@polkadot/util": ^6.3.1
|
||||
"@polkadot/x-rxjs": ^6.3.1
|
||||
bn.js: ^4.11.9
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/api-derive@4.7.1, @polkadot/api-derive@workspace:packages/api-derive":
|
||||
"@polkadot/api-derive@4.7.2, @polkadot/api-derive@workspace:packages/api-derive":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/api-derive@workspace:packages/api-derive"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.13.17
|
||||
"@polkadot/api": 4.7.1
|
||||
"@polkadot/api": 4.7.2
|
||||
"@polkadot/keyring": ^6.3.1
|
||||
"@polkadot/rpc-core": 4.7.1
|
||||
"@polkadot/rpc-provider": 4.7.1
|
||||
"@polkadot/types": 4.7.1
|
||||
"@polkadot/rpc-core": 4.7.2
|
||||
"@polkadot/rpc-provider": 4.7.2
|
||||
"@polkadot/types": 4.7.2
|
||||
"@polkadot/util": ^6.3.1
|
||||
"@polkadot/util-crypto": ^6.3.1
|
||||
"@polkadot/x-rxjs": ^6.3.1
|
||||
@@ -1813,18 +1813,18 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/api@4.7.1, @polkadot/api@workspace:packages/api":
|
||||
"@polkadot/api@4.7.2, @polkadot/api@workspace:packages/api":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/api@workspace:packages/api"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.13.17
|
||||
"@polkadot/api-derive": 4.7.1
|
||||
"@polkadot/api-derive": 4.7.2
|
||||
"@polkadot/keyring": ^6.3.1
|
||||
"@polkadot/metadata": 4.7.1
|
||||
"@polkadot/rpc-core": 4.7.1
|
||||
"@polkadot/rpc-provider": 4.7.1
|
||||
"@polkadot/types": 4.7.1
|
||||
"@polkadot/types-known": 4.7.1
|
||||
"@polkadot/metadata": 4.7.2
|
||||
"@polkadot/rpc-core": 4.7.2
|
||||
"@polkadot/rpc-provider": 4.7.2
|
||||
"@polkadot/types": 4.7.2
|
||||
"@polkadot/types-known": 4.7.2
|
||||
"@polkadot/util": ^6.3.1
|
||||
"@polkadot/util-crypto": ^6.3.1
|
||||
"@polkadot/x-rxjs": ^6.3.1
|
||||
@@ -1933,14 +1933,14 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/metadata@4.7.1, @polkadot/metadata@workspace:packages/metadata":
|
||||
"@polkadot/metadata@4.7.2, @polkadot/metadata@workspace:packages/metadata":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/metadata@workspace:packages/metadata"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.13.17
|
||||
"@polkadot/keyring": ^6.3.1
|
||||
"@polkadot/types": 4.7.1
|
||||
"@polkadot/types-known": 4.7.1
|
||||
"@polkadot/types": 4.7.2
|
||||
"@polkadot/types-known": 4.7.2
|
||||
"@polkadot/util": ^6.3.1
|
||||
"@polkadot/util-crypto": ^6.3.1
|
||||
bn.js: ^4.11.9
|
||||
@@ -1956,28 +1956,28 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/rpc-core@4.7.1, @polkadot/rpc-core@workspace:packages/rpc-core":
|
||||
"@polkadot/rpc-core@4.7.2, @polkadot/rpc-core@workspace:packages/rpc-core":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/rpc-core@workspace:packages/rpc-core"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.13.17
|
||||
"@polkadot/keyring": ^6.3.1
|
||||
"@polkadot/metadata": 4.7.1
|
||||
"@polkadot/rpc-provider": 4.7.1
|
||||
"@polkadot/types": 4.7.1
|
||||
"@polkadot/metadata": 4.7.2
|
||||
"@polkadot/rpc-provider": 4.7.2
|
||||
"@polkadot/types": 4.7.2
|
||||
"@polkadot/util": ^6.3.1
|
||||
"@polkadot/x-rxjs": ^6.3.1
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/rpc-provider@4.7.1, @polkadot/rpc-provider@workspace:packages/rpc-provider":
|
||||
"@polkadot/rpc-provider@4.7.2, @polkadot/rpc-provider@workspace:packages/rpc-provider":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/rpc-provider@workspace:packages/rpc-provider"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.13.17
|
||||
"@polkadot/keyring": ^6.3.1
|
||||
"@polkadot/metadata": 4.7.1
|
||||
"@polkadot/types": 4.7.1
|
||||
"@polkadot/metadata": 4.7.2
|
||||
"@polkadot/types": 4.7.2
|
||||
"@polkadot/util": ^6.3.1
|
||||
"@polkadot/util-crypto": ^6.3.1
|
||||
"@polkadot/x-fetch": ^6.3.1
|
||||
@@ -2006,10 +2006,10 @@ __metadata:
|
||||
"@babel/core": ^7.13.16
|
||||
"@babel/register": ^7.13.16
|
||||
"@babel/runtime": ^7.13.17
|
||||
"@polkadot/api": 4.7.1
|
||||
"@polkadot/metadata": 4.7.1
|
||||
"@polkadot/rpc-provider": 4.7.1
|
||||
"@polkadot/types": 4.7.1
|
||||
"@polkadot/api": 4.7.2
|
||||
"@polkadot/metadata": 4.7.2
|
||||
"@polkadot/rpc-provider": 4.7.2
|
||||
"@polkadot/types": 4.7.2
|
||||
"@polkadot/util": ^6.3.1
|
||||
"@types/websocket": ^1.0.2
|
||||
"@types/yargs": ^16.0.1
|
||||
@@ -2025,26 +2025,26 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/types-known@4.7.1, @polkadot/types-known@workspace:packages/types-known":
|
||||
"@polkadot/types-known@4.7.2, @polkadot/types-known@workspace:packages/types-known":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/types-known@workspace:packages/types-known"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.13.17
|
||||
"@polkadot/networks": ^6.3.1
|
||||
"@polkadot/types": 4.7.1
|
||||
"@polkadot/types": 4.7.2
|
||||
"@polkadot/util": ^6.3.1
|
||||
"@types/bn.js": ^4.11.6
|
||||
bn.js: ^4.11.9
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/types@4.7.1, @polkadot/types@workspace:packages/types":
|
||||
"@polkadot/types@4.7.2, @polkadot/types@workspace:packages/types":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/types@workspace:packages/types"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.13.17
|
||||
"@polkadot/keyring": ^6.3.1
|
||||
"@polkadot/metadata": 4.7.1
|
||||
"@polkadot/metadata": 4.7.2
|
||||
"@polkadot/util": ^6.3.1
|
||||
"@polkadot/util-crypto": ^6.3.1
|
||||
"@polkadot/x-rxjs": ^6.3.1
|
||||
|
||||
Reference in New Issue
Block a user