Move api-derive to correct location (#4343)

* Move api-derive to correct location

* Adjust (linting ok)

* No composite

* ApiDerive split

* Adjust

* Still WIP, getting closer

* It lints

* derive build issues sorted

* It builds :)

* Add system_health to mock

* api-augment usage

* Cleanups

* Adjust paths

* linting

* Some <'s

* Revert <>'s

* linting

* ordering

* Augmentation tweaks

* yarn.lock

* export
This commit is contained in:
Jaco
2021-12-18 09:18:55 +02:00
committed by GitHub
parent 7b8a6e89d9
commit 4913cf65fd
178 changed files with 720 additions and 685 deletions
+31
View File
@@ -0,0 +1,31 @@
// Copyright 2017-2021 @polkadot/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { QueryableConsts } from '@polkadot/api-augment/consts';
import type { QueryableStorage } from '@polkadot/api-augment/query';
import type { SubmittableExtrinsics } from '@polkadot/api-augment/tx';
import type { DecoratedRpc, QueryableStorageMulti } from '@polkadot/api-base/types';
import type { RpcInterface } from '@polkadot/rpc-core/types';
import type { Metadata } from '@polkadot/types';
import type { Hash, RuntimeVersion } from '@polkadot/types/interfaces';
import type { Registry, Signer } from '@polkadot/types/types';
declare module '@polkadot/api-base/types/api' {
// A smaller interface of ApiRx, used in derive and in SubmittableExtrinsic
export interface ApiInterfaceRx {
consts: QueryableConsts<'rxjs'>;
extrinsicType: number;
genesisHash?: Hash;
hasSubscriptions: boolean;
registry: Registry;
runtimeMetadata: Metadata;
runtimeVersion: RuntimeVersion;
query: QueryableStorage<'rxjs'>;
queryAt: (blockHash: Uint8Array | string, knownVersion?: RuntimeVersion) => Observable<QueryableStorage<'rxjs'>>;
queryMulti: QueryableStorageMulti<'rxjs'>;
rpc: DecoratedRpc<'rxjs', RpcInterface>;
tx: SubmittableExtrinsics<'rxjs'>;
signer?: Signer;
}
}
@@ -1,7 +1,7 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
declare module '@polkadot/api/types/consts' {
declare module '@polkadot/api-augment/consts' {
import type { ApiTypes, AugmentedConst, QueryableModuleConsts } from '@polkadot/api-base/types';
import type { U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types';
import type { Perbill, Percent, Permill } from '@polkadot/types/interfaces/runtime';
@@ -1,7 +1,7 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
declare module '@polkadot/api/types/errors' {
declare module '@polkadot/api-augment/errors' {
import type { ApiTypes, AugmentedError, ModuleErrors } from '@polkadot/api-base/types';
export interface AugmentedErrors<ApiType extends ApiTypes> {
@@ -1,7 +1,7 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
declare module '@polkadot/api/types/events' {
declare module '@polkadot/api-augment/events' {
import type { ApiTypes, AugmentedEvent, ModuleEvents } from '@polkadot/api-base/types';
import type { Bytes, Null, Option, Result, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types';
import type { AccountId32, H256 } from '@polkadot/types/interfaces/runtime';
+12
View File
@@ -0,0 +1,12 @@
// Copyright 2017-2021 @polkadot/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
import '@polkadot/types/augment';
import './consts';
import './errors';
import './events';
import './query';
import './tx';
// these are external to this module
import './api';
import './rpc';
@@ -1,7 +1,7 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
declare module '@polkadot/api/types/storage' {
declare module '@polkadot/api-augment/query' {
import type { ApiTypes, AugmentedQuery, QueryableModuleStorage, QueryableModuleStorageAt, QueryableStorageEntry } from '@polkadot/api-base/types';
import type { BTreeMap, Bytes, Data, Null, Option, U8aFixed, Vec, WrapperOpaque, bool, u128, u32, u64, u8 } from '@polkadot/types';
import type { AccountId32, Call, H256, Perbill, Percent } from '@polkadot/types/interfaces/runtime';
@@ -1,7 +1,7 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
declare module '@polkadot/api/types/submittable' {
declare module '@polkadot/api-augment/tx' {
import type { ApiTypes, AugmentedSubmittable, SubmittableExtrinsic, SubmittableExtrinsicFunction, SubmittableModuleExtrinsics } from '@polkadot/api-base/types';
import type { Bytes, Compact, Data, Option, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types';
import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';
+10 -8
View File
@@ -1,12 +1,14 @@
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
// Copyright 2017-2021 @polkadot/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
import '@polkadot/types/augment';
import './consts';
import './errors';
import './events';
import './query';
import './rpc';
import './tx';
// trigger in the same way as we do externally
import '@polkadot/api-augment/augment';
export { packageInfo } from './packageInfo';
// Important: we do the exports here via the full package name
export * from '@polkadot/api-augment/consts';
export * from '@polkadot/api-augment/errors';
export * from '@polkadot/api-augment/events';
export * from '@polkadot/api-augment/query';
export * from '@polkadot/api-augment/tx';
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
// Copyright 2017-2021 @polkadot/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { packageInfo as rpcInfo } from '@polkadot/rpc-core/packageInfo';
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
// Copyright 2017-2021 @polkadot/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
import './detectPackage';