Files
smom-dbis-138/packages/integration-foundation/src/entities/RegulatedEntity.ts
defiQUG d717b504a6
Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m12s
CI/CD Pipeline / Security Scanning (push) Successful in 2m21s
CI/CD Pipeline / Lint and Format (push) Failing after 36s
CI/CD Pipeline / Terraform Validation (push) Failing after 22s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 25s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (push) Failing after 23s
Validation / validate-genesis (push) Successful in 26s
Validation / validate-terraform (push) Failing after 21s
Validation / validate-kubernetes (push) Failing after 9s
Validation / validate-smart-contracts (push) Failing after 8s
Validation / validate-security (push) Failing after 1m15s
Validation / validate-documentation (push) Failing after 15s
OMNL reconcile anchor / Run omnl:reconcile and upload artifacts (push) Failing after 26s
Verify Deployment / Verify Deployment (push) Failing after 56s
feat(omnl): settlement terminal, compliance gates, and HYBX integration foundation
Add operator settlement terminal UI/API, swift-listener service, compliance
idempotency gates, GRU reserve dashboards, and @dbis/integration-foundation
for typed HYBX/ISO adapter contracts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 21:51:32 -07:00

72 lines
1.6 KiB
TypeScript

export type EntityType =
| 'central_bank'
| 'commercial_bank'
| 'emi'
| 'payment_institution'
| 'custodian'
| 'broker_dealer'
| 'other';
export type RegulatoryStatus = 'licensed' | 'pending' | 'suspended' | 'offboarded';
export type RiskTier = 'low' | 'medium' | 'high' | 'prohibited';
export type EntityCapability =
| 'payment_initiation'
| 'settlement'
| 'treasury'
| 'digital_asset'
| 'reporting'
| 'identity'
| 'reconciliation';
export type RegulatedEntity = {
entityId: string;
tenantId: string;
legalName: string;
jurisdiction: string;
lei?: string;
regulatoryStatus: RegulatoryStatus;
entityType: EntityType;
riskTier: RiskTier;
enabledCapabilities: EntityCapability[];
credentialRef?: string;
contractualDocRefs?: string[];
limits?: {
dailyAmountLimit?: string;
perTransactionLimit?: string;
currency?: string;
};
offboardedAt?: string;
metadata?: Record<string, string>;
};
export type RegulatedEntityRegistry = {
entities: RegulatedEntity[];
getEntity(entityId: string, tenantId: string): RegulatedEntity | undefined;
};
export function createInMemoryEntityRegistry(
entities: RegulatedEntity[]
): RegulatedEntityRegistry {
const index = new Map<string, RegulatedEntity>();
for (const e of entities) {
index.set(`${e.tenantId}:${e.entityId}`, e);
}
return {
entities,
getEntity(entityId, tenantId) {
return index.get(`${tenantId}:${entityId}`);
},
};
}
export function assertTenantIsolation(
actorTenantId: string,
resourceTenantId: string
): void {
if (actorTenantId !== resourceTenantId) {
throw new Error('Tenant isolation violation');
}
}