UNPKG

349 BJavaScriptView Raw
1import { isReady, waitReady } from '@polkadot/wasm-crypto';
2export const cryptoIsReady = isReady;
3export function cryptoWaitReady() {
4 return waitReady()
5 .then(() => {
6 if (!isReady()) {
7 throw new Error('Unable to initialize @polkadot/util-crypto');
8 }
9 return true;
10 })
11 .catch(() => false);
12}