Add firstMemo (dedupes) (#4321)

* Add firstMemo (dedupes)

* Adjust

* flatten

* Readability

* Readability
This commit is contained in:
Jaco
2021-12-12 08:47:58 +02:00
committed by GitHub
parent 4b0c6aa515
commit 59c2327768
14 changed files with 90 additions and 70 deletions
+6 -1
View File
@@ -1,6 +1,8 @@
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiInterfaceRx } from '@polkadot/api/types';
import { unwrapBlockNumber } from './util';
/**
@@ -15,4 +17,7 @@ import { unwrapBlockNumber } from './util';
* });
* ```
*/
export const bestNumber = unwrapBlockNumber((api) => api.derive.chain.subscribeNewHeads());
export const bestNumber = unwrapBlockNumber(
(api: ApiInterfaceRx) =>
api.derive.chain.subscribeNewHeads()
);
@@ -1,6 +1,8 @@
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiInterfaceRx } from '@polkadot/api/types';
import { unwrapBlockNumber } from './util';
/**
@@ -16,4 +18,7 @@ import { unwrapBlockNumber } from './util';
* });
* ```
*/
export const bestNumberFinalized = unwrapBlockNumber((api) => api.rpc.chain.subscribeFinalizedHeads());
export const bestNumberFinalized = unwrapBlockNumber(
(api: ApiInterfaceRx) =>
api.rpc.chain.subscribeFinalizedHeads()
);