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>
29 lines
1.2 KiB
JavaScript
29 lines
1.2 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.INSTRUMENT_ROUTING = void 0;
|
|
exports.resolveInstrumentGl = resolveInstrumentGl;
|
|
exports.isIbanValid = isIbanValid;
|
|
/** SWIFT / trade-finance instrument routing */
|
|
exports.INSTRUMENT_ROUTING = {
|
|
SBLC: { swift: ['MT103', 'MT202'], glDebit: '1410', glCredit: '2100' },
|
|
DLC: { swift: ['MT103', 'MT102'], glDebit: '1410', glCredit: '1000' },
|
|
BG: { swift: ['MT103'], glDebit: '1410', glCredit: '2100' },
|
|
LS: { swift: ['MT102', 'MT103'], glDebit: '1000', glCredit: '2200' },
|
|
};
|
|
function resolveInstrumentGl(instrument) {
|
|
const r = exports.INSTRUMENT_ROUTING[instrument];
|
|
return { debitGl: r.glDebit, creditGl: r.glCredit, swiftKinds: r.swift };
|
|
}
|
|
function isIbanValid(iban) {
|
|
const normalized = iban.replace(/\s/g, '').toUpperCase();
|
|
if (!/^[A-Z]{2}\d{2}[A-Z0-9]{11,30}$/.test(normalized))
|
|
return false;
|
|
const rearranged = normalized.slice(4) + normalized.slice(0, 4);
|
|
const numeric = rearranged.replace(/[A-Z]/g, (c) => String(c.charCodeAt(0) - 55));
|
|
let remainder = 0;
|
|
for (const ch of numeric) {
|
|
remainder = (remainder * 10 + parseInt(ch, 10)) % 97;
|
|
}
|
|
return remainder === 1;
|
|
}
|