Basic/configurable no-metadata state_call interfaces (#4987)

* Basic/configurable no-metadata state_call interfaces

* Decorate on a per-section/method basis

* Expose metadata

* Adjust

* s/calls/runtime/

* Adjust

* Adjust

* Adjust for AugmentedCall

* Adjust base type exports

* Basics for generation (not enabled)

* Non-exported basic generation test

* lint fixes

* yarn.lock

* Adjust with lookups

* Adjust

* Adjust

* api-base into tsconfig for typegen

* typegen with args

* manual test for args passing

* CHANGELOG

* Adjust with new call definitions

* Allow multiple historic versions

* Metadata_metadata
This commit is contained in:
Jaco
2022-06-29 13:12:21 +03:00
committed by GitHub
parent 0a9158befc
commit ac1837cdfe
37 changed files with 634 additions and 52 deletions
@@ -0,0 +1,47 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
import type { ApiTypes } from '@polkadot/api-base/types';
import type { AuthorityList, SetId } from '@polkadot/types/interfaces/grandpa';
import type { OpaqueMetadata } from '@polkadot/types/interfaces/metadata';
import type { AccountId, Index } from '@polkadot/types/interfaces/runtime';
import type { Observable } from '@polkadot/types/types';
declare module '@polkadot/api-base/types/calls' {
export interface AugmentedCalls<ApiType extends ApiTypes> {
accountNonceApi: {
/**
* The API to query account nonce (aka transaction index)
**/
accountNonce: AugmentedCall<ApiType, (accountId: AccountId | string | Uint8Array) => Observable<Index>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
grandpaApi: {
/**
* Get current GRANDPA authority set id.
**/
currentSetId: AugmentedCall<ApiType, () => Observable<SetId>>;
/**
* Get the current GRANDPA authorities and weights. This should not change except for when changes are scheduled and the corresponding delay has passed.
**/
grandpaAuthorities: AugmentedCall<ApiType, () => Observable<AuthorityList>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
metadata: {
/**
* Returns the metadata of a runtime
**/
metadata: AugmentedCall<ApiType, () => Observable<OpaqueMetadata>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
} // AugmentedCalls
} // declare module
@@ -0,0 +1,47 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
import type { ApiTypes } from '@polkadot/api-base/types';
import type { AuthorityList, SetId } from '@polkadot/types/interfaces/grandpa';
import type { OpaqueMetadata } from '@polkadot/types/interfaces/metadata';
import type { AccountId, Index } from '@polkadot/types/interfaces/runtime';
import type { Observable } from '@polkadot/types/types';
declare module '@polkadot/api-base/types/calls' {
export interface AugmentedCalls<ApiType extends ApiTypes> {
accountNonceApi: {
/**
* The API to query account nonce (aka transaction index)
**/
accountNonce: AugmentedCall<ApiType, (accountId: AccountId | string | Uint8Array) => Observable<Index>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
grandpaApi: {
/**
* Get current GRANDPA authority set id.
**/
currentSetId: AugmentedCall<ApiType, () => Observable<SetId>>;
/**
* Get the current GRANDPA authorities and weights. This should not change except for when changes are scheduled and the corresponding delay has passed.
**/
grandpaAuthorities: AugmentedCall<ApiType, () => Observable<AuthorityList>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
metadata: {
/**
* Returns the metadata of a runtime
**/
metadata: AugmentedCall<ApiType, () => Observable<OpaqueMetadata>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
} // AugmentedCalls
} // declare module
@@ -0,0 +1,47 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
import type { ApiTypes } from '@polkadot/api-base/types';
import type { AuthorityList, SetId } from '@polkadot/types/interfaces/grandpa';
import type { OpaqueMetadata } from '@polkadot/types/interfaces/metadata';
import type { AccountId, Index } from '@polkadot/types/interfaces/runtime';
import type { Observable } from '@polkadot/types/types';
declare module '@polkadot/api-base/types/calls' {
export interface AugmentedCalls<ApiType extends ApiTypes> {
accountNonceApi: {
/**
* The API to query account nonce (aka transaction index)
**/
accountNonce: AugmentedCall<ApiType, (accountId: AccountId | string | Uint8Array) => Observable<Index>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
grandpaApi: {
/**
* Get current GRANDPA authority set id.
**/
currentSetId: AugmentedCall<ApiType, () => Observable<SetId>>;
/**
* Get the current GRANDPA authorities and weights. This should not change except for when changes are scheduled and the corresponding delay has passed.
**/
grandpaAuthorities: AugmentedCall<ApiType, () => Observable<AuthorityList>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
metadata: {
/**
* Returns the metadata of a runtime
**/
metadata: AugmentedCall<ApiType, () => Observable<OpaqueMetadata>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
} // AugmentedCalls
} // declare module