Files
api/packages/api-derive/test/helpers.ts
T
Jaco f603100b8b Add @polkadot/types-support (#3842)
* Add @polkadot/types-support

* jest config fix

* typegen lookups

* Build fixes

* Explicit kusama naming

* testMeta for v14 (local)

* CI test failure

* CI test failure v14

* Update with corrected data after test

* types-support json imports
2021-08-04 10:39:21 +02:00

20 lines
633 B
TypeScript

// Copyright 2017-2021 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ApiPromise, WsProvider } from '@polkadot/api';
import { Metadata, TypeRegistry } from '@polkadot/types';
import metaStatic from '@polkadot/types-support/metadata/static-substrate';
export function createApiWithAugmentations (): ApiPromise {
const registry = new TypeRegistry();
const metadata = new Metadata(registry, metaStatic);
registry.setMetadata(metadata);
const api = new ApiPromise({ provider: new WsProvider('ws://', false), registry });
api.injectMetadata(metadata, true, registry);
return api;
}