Files
common/packages/util-crypto/src/crypto.ts
T
Jaco 7090c3daec Re-use cleanups (#1219)
* Re-use cleanups

* linting

* Adjust

* Adjust

* ipfsCompat into if

* Adjust
2021-11-20 09:29:13 +02:00

17 lines
453 B
TypeScript

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