Split rpc augmentation (#4349)
* Split rpc augmentation * CC * Split augmentation trigger * Exports
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
// Copyright 2017-2021 @polkadot/rpc-core authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import '@polkadot/rpc-augment/augment';
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2021 @polkadot/rpc-core authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { RpcInterface } from '@polkadot/rpc-core/types.jsonrpc';
|
||||
import type { RpcInterface } from './types';
|
||||
|
||||
import { createTestPairs } from '@polkadot/keyring/testingPairs';
|
||||
import { MockProvider } from '@polkadot/rpc-provider/mock';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2021 @polkadot/rpc-core authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { RpcInterface } from '@polkadot/rpc-core/types.jsonrpc';
|
||||
import type { RpcInterface } from './types';
|
||||
|
||||
import { MockProvider } from '@polkadot/rpc-provider/mock';
|
||||
import { TypeRegistry } from '@polkadot/types/create';
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
// Copyright 2017-2021 @polkadot/rpc-core authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { AugmentedRpc } from './types';
|
||||
|
||||
export interface RpcInterface {
|
||||
[section: string]: {
|
||||
[method: string]: AugmentedRpc<(...params: any[]) => any>;
|
||||
}
|
||||
}
|
||||
|
||||
export const __PHANTOM_RPC = 'phantom-rpc';
|
||||
@@ -1,18 +1,7 @@
|
||||
// Copyright 2017-2021 @polkadot/rpc-core authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { AnyFunction, Codec, DefinitionRpc } from '@polkadot/types/types';
|
||||
import './augment';
|
||||
|
||||
export * from '@polkadot/rpc-core/types.jsonrpc';
|
||||
|
||||
export interface RpcInterfaceMethod {
|
||||
<T extends Codec> (...params: unknown[]): Observable<T>;
|
||||
raw (...params: unknown[]): Observable<unknown>;
|
||||
meta: DefinitionRpc;
|
||||
}
|
||||
|
||||
export type AugmentedRpc<F extends AnyFunction> = F & {
|
||||
raw: <T> (...params: Parameters<F>) => Observable<T>;
|
||||
meta: DefinitionRpc;
|
||||
};
|
||||
export type { RpcInterface } from '@polkadot/rpc-augment/rpc';
|
||||
export type { AugmentedRpc, RpcInterfaceMethod } from '@polkadot/rpc-augment/types';
|
||||
|
||||
Reference in New Issue
Block a user