1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.cryptoWaitReady = exports.cryptoIsReady = void 0;
|
4 | const wasm_crypto_1 = require("@polkadot/wasm-crypto");
|
5 | exports.cryptoIsReady = wasm_crypto_1.isReady;
|
6 | function cryptoWaitReady() {
|
7 | return (0, wasm_crypto_1.waitReady)()
|
8 | .then(() => {
|
9 | if (!(0, wasm_crypto_1.isReady)()) {
|
10 | throw new Error('Unable to initialize @polkadot/util-crypto');
|
11 | }
|
12 | return true;
|
13 | })
|
14 | .catch(() => false);
|
15 | }
|
16 | exports.cryptoWaitReady = cryptoWaitReady;
|