// Copyright 2017-2021 @polkadot/util-crypto authors & contributors // SPDX-License-Identifier: Apache-2.0 import { isReady, waitReady } from '@polkadot/wasm-crypto'; export function cryptoIsReady (): boolean { return isReady(); } export function cryptoWaitReady (): Promise { return waitReady() .then((): boolean => true) .catch((error): boolean => { console.error('Unable to initialize @polkadot/util-crypto', error); return false; }); }