UNPKG

@paxoslabs/earn-sdk

Version:
32 lines (30 loc) 905 B
'use strict'; // src/api/vault-config.ts var configCache = null; function toChainId(value) { return typeof value === "number" ? value : Number(value); } async function fetchVaultConfigs() { if (configCache) { return configCache; } const response = await fetch("https://api.nucleusearn.io/prod/vault-config"); if (!response.ok) { throw new Error(`API request failed with status ${response.status}`); } const data = await response.json(); configCache = data; return configCache; } async function fetchVaultConfig(vaultKey) { const configs = await fetchVaultConfigs(); const vault = configs.vaults[vaultKey]; if (!vault) { throw new Error(`Vault config not found for key: ${vaultKey}`); } return vault; } exports.fetchVaultConfig = fetchVaultConfig; exports.toChainId = toChainId; //# sourceMappingURL=chunk-NEVIH2LY.js.map //# sourceMappingURL=chunk-NEVIH2LY.js.map