1 | // Copyright 2017-2022 @polkadot/util-crypto authors & contributors
|
2 | // SPDX-License-Identifier: Apache-2.0
|
3 | import { isReady, waitReady } from '@polkadot/wasm-crypto';
|
4 | export const cryptoIsReady = isReady;
|
5 | export function cryptoWaitReady() {
|
6 | return waitReady().then(() => {
|
7 | if (!isReady()) {
|
8 | throw new Error('Unable to initialize @polkadot/util-crypto');
|
9 | }
|
10 |
|
11 | return true;
|
12 | }).catch(() => false);
|
13 | } |
\ | No newline at end of file |