UNPKG

@ledgerhq/live-common

Version:
22 lines 935 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getCryptoAssetsStore = exports.setCryptoAssetsStore = void 0; const LiveConfig_1 = require("@ledgerhq/live-config/LiveConfig"); const tokens_1 = require("@ledgerhq/cryptoassets/tokens"); let cryptoAssetsStore = undefined; function setCryptoAssetsStore(store) { cryptoAssetsStore = store; } exports.setCryptoAssetsStore = setCryptoAssetsStore; function getCryptoAssetsStore() { const featureEnabled = LiveConfig_1.LiveConfig.isConfigSet() && LiveConfig_1.LiveConfig.getValueByKey("feature_cal_lazy_loading"); if (!featureEnabled) { return tokens_1.legacyCryptoAssetsStore; } if (!cryptoAssetsStore) { throw new Error("CryptoAssetsStore is not set. Please call setCryptoAssetsStore first."); } return cryptoAssetsStore; } exports.getCryptoAssetsStore = getCryptoAssetsStore; //# sourceMappingURL=index.js.map