diff --git a/packages/api-derive/src/util/cache.ts b/packages/api-derive/src/util/cache.ts index 12086886de..0f647985ee 100644 --- a/packages/api-derive/src/util/cache.ts +++ b/packages/api-derive/src/util/cache.ts @@ -3,8 +3,9 @@ // of the Apache-2.0 license. See the LICENSE file for details. import memoizee from 'memoizee'; -import { ApiInterface$Rx } from '@polkadot/api/types'; - +import { ApiInterface$Decorated } from '@polkadot/api/types'; +import { Codec } from '@polkadot/types/types'; +import { Observable } from 'rxjs'; /** * Create memoization for a 2-currified function. * @@ -20,7 +21,7 @@ import { ApiInterface$Rx } from '@polkadot/api/types'; * f(api)(1, 2); // Cache hit * ``` */ -export const cache = (fn: Function, map = new WeakMap()) => (api: ApiInterface$Rx) => { +export const cache = (fn: Function, map = new WeakMap()) => (api: ApiInterface$Decorated, Observable>) => { if (!map.has(api)) { const innerFn = fn(api); map.set(api, memoizee(innerFn)); diff --git a/packages/type-extrinsics/src/static.ts b/packages/type-extrinsics/src/static.ts index f21cd32404..e1dc049e86 100644 --- a/packages/type-extrinsics/src/static.ts +++ b/packages/type-extrinsics/src/static.ts @@ -4,9 +4,11 @@ import { Metadata } from '@polkadot/types/index'; import metadataRpc from '@polkadot/types/Metadata/v0/static'; +import { ModulesWithMethods } from '@polkadot/types/primitive/Method'; import fromMetadata from './fromMetadata'; -export default fromMetadata( +const staticMetadata: ModulesWithMethods = fromMetadata( new Metadata(metadataRpc).asV0 ); +export default staticMetadata;