Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m22s
CI/CD Pipeline / Security Scanning (push) Successful in 2m30s
CI/CD Pipeline / Lint and Format (push) Failing after 44s
CI/CD Pipeline / Terraform Validation (push) Failing after 27s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 31s
Deploy ChainID 138 / Deploy ChainID 138 (push) Failing after 56s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (push) Failing after 29s
Validation / validate-genesis (push) Successful in 34s
Validation / validate-terraform (push) Failing after 39s
Validation / validate-kubernetes (push) Failing after 14s
Validation / validate-smart-contracts (push) Failing after 20s
Validation / validate-security (push) Failing after 1m19s
Validation / validate-documentation (push) Failing after 27s
Verify Deployment / Verify Deployment (push) Failing after 1m13s
Co-authored-by: Cursor <cursoragent@cursor.com>
46 lines
1.7 KiB
JavaScript
46 lines
1.7 KiB
JavaScript
"use strict";
|
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.loadM2TokenRegistry = loadM2TokenRegistry;
|
|
exports.loadExchangeTokens = loadExchangeTokens;
|
|
exports.loadExchangeConfig = loadExchangeConfig;
|
|
exports.exchangePort = exchangePort;
|
|
exports.tokenAggUrl = tokenAggUrl;
|
|
exports.settlementUrl = settlementUrl;
|
|
const fs_1 = __importDefault(require("fs"));
|
|
const path_1 = __importDefault(require("path"));
|
|
const settlement_core_1 = require("@dbis/settlement-core");
|
|
let cached = null;
|
|
let cachedM2 = null;
|
|
function loadM2TokenRegistry() {
|
|
if (cachedM2)
|
|
return cachedM2;
|
|
const p = process.env.OMNL_M2_TOKEN_REGISTRY ||
|
|
path_1.default.resolve(__dirname, '../../../config/omnl-m2-token-registry.v1.json');
|
|
cachedM2 = JSON.parse(fs_1.default.readFileSync(p, 'utf8'));
|
|
return cachedM2;
|
|
}
|
|
function loadExchangeTokens() {
|
|
const cfg = loadExchangeConfig();
|
|
return (0, settlement_core_1.mergeExchangeTokensWithM2Registry)(cfg.tokens, loadM2TokenRegistry());
|
|
}
|
|
function loadExchangeConfig() {
|
|
if (cached)
|
|
return cached;
|
|
const p = process.env.DBIS_EXCHANGE_CONFIG ||
|
|
path_1.default.resolve(__dirname, '../../../config/dbis-exchange.v1.json');
|
|
cached = JSON.parse(fs_1.default.readFileSync(p, 'utf8'));
|
|
return cached;
|
|
}
|
|
function exchangePort() {
|
|
return parseInt(process.env.DBIS_EXCHANGE_PORT || '3012', 10);
|
|
}
|
|
function tokenAggUrl() {
|
|
return (process.env.TOKEN_AGGREGATION_URL || 'http://localhost:3000').replace(/\/$/, '');
|
|
}
|
|
function settlementUrl() {
|
|
return (process.env.SETTLEMENT_MIDDLEWARE_URL || 'http://localhost:3011').replace(/\/$/, '');
|
|
}
|