Expose provider errors & .stats on API (#4878)

* Expose provider errors & .stats on API

* Expose WS errors
This commit is contained in:
Jaco
2022-05-31 10:24:17 +03:00
committed by GitHub
parent a7a5a409d8
commit e7beb2d46f
5 changed files with 25 additions and 2 deletions
+8
View File
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { RpcInterface } from '@polkadot/rpc-core/types';
import type { ProviderInterface } from '@polkadot/rpc-provider/types';
import type { Text } from '@polkadot/types';
import type { Hash, RuntimeVersion } from '@polkadot/types/interfaces';
import type { Metadata } from '@polkadot/types/metadata';
@@ -188,6 +189,13 @@ export abstract class Getters<ApiType extends ApiTypes> extends Init<ApiType> im
return assertResult(this._rx as Pick<ApiInterfaceRx, 'tx' | 'rpc' | 'query'>);
}
/**
* @description Returns the underlying provider stats
*/
public get stats (): ProviderInterface['stats'] | undefined {
return this._rpcCore.provider.stats;
}
/**
* @description The type of this API instance, either 'rxjs' or 'promise'
*/