- Add Foundry project configuration (foundry.toml, foundry.lock) - Add Solidity contracts (TokenFactory138, BridgeVault138, ComplianceRegistry, etc.) - Add API definitions (OpenAPI, GraphQL, gRPC, AsyncAPI) - Add comprehensive test suite (unit, integration, fuzz, invariants) - Add API services (REST, GraphQL, orchestrator, packet service) - Add documentation (ISO20022 mapping, runbooks, adapter guides) - Add development tools (RBC tool, Swagger UI, mock server) - Update OpenZeppelin submodules to v5.0.0
334 lines
7.4 KiB
YAML
334 lines
7.4 KiB
YAML
asyncapi: '3.0.0'
|
|
info:
|
|
title: eMoney Token Factory Event Bus
|
|
version: '1.0.0'
|
|
description: |
|
|
Event-driven API for eMoney Token Factory system.
|
|
|
|
Events are published to Kafka/NATS topics for:
|
|
- Trigger lifecycle updates
|
|
- Lien operations
|
|
- Compliance changes
|
|
- Packet operations
|
|
- Bridge operations
|
|
- Policy updates
|
|
|
|
servers:
|
|
kafka:
|
|
host: kafka.emoney.example.com
|
|
protocol: kafka
|
|
description: Production Kafka cluster
|
|
security:
|
|
- $ref: '#/components/securitySchemes/mtls'
|
|
nats:
|
|
host: nats.emoney.example.com
|
|
protocol: nats
|
|
description: Production NATS cluster
|
|
security:
|
|
- $ref: '#/components/securitySchemes/jwt'
|
|
|
|
defaultContentType: application/json
|
|
|
|
channels:
|
|
triggers.created:
|
|
$ref: './channels/triggers-created.yaml'
|
|
triggers.state.updated:
|
|
$ref: './channels/triggers-state-updated.yaml'
|
|
liens.placed:
|
|
$ref: './channels/liens-placed.yaml'
|
|
liens.reduced:
|
|
$ref: './channels/liens-reduced.yaml'
|
|
liens.released:
|
|
$ref: './channels/liens-released.yaml'
|
|
packets.generated:
|
|
$ref: './channels/packets-generated.yaml'
|
|
packets.dispatched:
|
|
$ref: './channels/packets-dispatched.yaml'
|
|
packets.acknowledged:
|
|
$ref: './channels/packets-acknowledged.yaml'
|
|
bridge.locked:
|
|
$ref: './channels/bridge-locked.yaml'
|
|
bridge.unlocked:
|
|
$ref: './channels/bridge-unlocked.yaml'
|
|
compliance.updated:
|
|
$ref: './channels/compliance-updated.yaml'
|
|
policy.updated:
|
|
$ref: './channels/policy-updated.yaml'
|
|
|
|
components:
|
|
securitySchemes:
|
|
mtls:
|
|
type: mutualTLS
|
|
description: Mutual TLS for high-trust adapters
|
|
jwt:
|
|
type: httpApiKey
|
|
in: header
|
|
name: Authorization
|
|
description: JWT bearer token
|
|
scheme: bearer
|
|
bearerFormat: JWT
|
|
|
|
messages:
|
|
EventEnvelope:
|
|
$ref: '#/components/schemas/EventEnvelope'
|
|
TriggerCreated:
|
|
$ref: '#/components/schemas/TriggerCreated'
|
|
TriggerStateUpdated:
|
|
$ref: '#/components/schemas/TriggerStateUpdated'
|
|
LienPlaced:
|
|
$ref: '#/components/schemas/LienPlaced'
|
|
LienReduced:
|
|
$ref: '#/components/schemas/LienReduced'
|
|
LienReleased:
|
|
$ref: '#/components/schemas/LienReleased'
|
|
PacketGenerated:
|
|
$ref: '#/components/schemas/PacketGenerated'
|
|
PacketDispatched:
|
|
$ref: '#/components/schemas/PacketDispatched'
|
|
PacketAcknowledged:
|
|
$ref: '#/components/schemas/PacketAcknowledged'
|
|
BridgeLocked:
|
|
$ref: '#/components/schemas/BridgeLocked'
|
|
BridgeUnlocked:
|
|
$ref: '#/components/schemas/BridgeUnlocked'
|
|
ComplianceUpdated:
|
|
$ref: '#/components/schemas/ComplianceUpdated'
|
|
PolicyUpdated:
|
|
$ref: '#/components/schemas/PolicyUpdated'
|
|
|
|
schemas:
|
|
EventEnvelope:
|
|
type: object
|
|
required:
|
|
- eventId
|
|
- eventType
|
|
- occurredAt
|
|
- payload
|
|
properties:
|
|
eventId:
|
|
type: string
|
|
format: uuid
|
|
description: Unique event identifier
|
|
eventType:
|
|
type: string
|
|
description: Event type (e.g., triggers.created)
|
|
occurredAt:
|
|
type: string
|
|
format: date-time
|
|
description: Event timestamp
|
|
actorRef:
|
|
type: string
|
|
description: Actor that triggered the event
|
|
correlationId:
|
|
type: string
|
|
description: Correlation ID for tracing
|
|
payload:
|
|
type: object
|
|
description: Event payload (varies by event type)
|
|
signatures:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
signer:
|
|
type: string
|
|
signature:
|
|
type: string
|
|
description: Optional event signatures
|
|
|
|
TriggerCreated:
|
|
type: object
|
|
required:
|
|
- triggerId
|
|
- rail
|
|
- msgType
|
|
- instructionId
|
|
properties:
|
|
triggerId:
|
|
type: string
|
|
rail:
|
|
type: string
|
|
enum: ["FEDWIRE", "SWIFT", "SEPA", "RTGS"]
|
|
msgType:
|
|
type: string
|
|
instructionId:
|
|
type: string
|
|
state:
|
|
type: string
|
|
enum: ["CREATED"]
|
|
|
|
TriggerStateUpdated:
|
|
type: object
|
|
required:
|
|
- triggerId
|
|
- previousState
|
|
- newState
|
|
properties:
|
|
triggerId:
|
|
type: string
|
|
previousState:
|
|
type: string
|
|
newState:
|
|
type: string
|
|
railTxRef:
|
|
type: string
|
|
nullable: true
|
|
|
|
LienPlaced:
|
|
type: object
|
|
required:
|
|
- lienId
|
|
- debtor
|
|
- amount
|
|
properties:
|
|
lienId:
|
|
type: string
|
|
debtor:
|
|
type: string
|
|
amount:
|
|
type: string
|
|
expiry:
|
|
type: integer
|
|
priority:
|
|
type: integer
|
|
authority:
|
|
type: string
|
|
reasonCode:
|
|
type: string
|
|
|
|
LienReduced:
|
|
type: object
|
|
required:
|
|
- lienId
|
|
- reduceBy
|
|
- newAmount
|
|
properties:
|
|
lienId:
|
|
type: string
|
|
reduceBy:
|
|
type: string
|
|
newAmount:
|
|
type: string
|
|
|
|
LienReleased:
|
|
type: object
|
|
required:
|
|
- lienId
|
|
properties:
|
|
lienId:
|
|
type: string
|
|
|
|
PacketGenerated:
|
|
type: object
|
|
required:
|
|
- packetId
|
|
- triggerId
|
|
- channel
|
|
properties:
|
|
packetId:
|
|
type: string
|
|
triggerId:
|
|
type: string
|
|
channel:
|
|
type: string
|
|
enum: ["PDF", "AS4", "EMAIL", "PORTAL"]
|
|
payloadHash:
|
|
type: string
|
|
|
|
PacketDispatched:
|
|
type: object
|
|
required:
|
|
- packetId
|
|
- channel
|
|
properties:
|
|
packetId:
|
|
type: string
|
|
channel:
|
|
type: string
|
|
recipient:
|
|
type: string
|
|
|
|
PacketAcknowledged:
|
|
type: object
|
|
required:
|
|
- packetId
|
|
- status
|
|
properties:
|
|
packetId:
|
|
type: string
|
|
status:
|
|
type: string
|
|
enum: ["RECEIVED", "ACCEPTED", "REJECTED"]
|
|
ackId:
|
|
type: string
|
|
|
|
BridgeLocked:
|
|
type: object
|
|
required:
|
|
- lockId
|
|
- token
|
|
- amount
|
|
properties:
|
|
lockId:
|
|
type: string
|
|
token:
|
|
type: string
|
|
amount:
|
|
type: string
|
|
targetChain:
|
|
type: string
|
|
targetRecipient:
|
|
type: string
|
|
|
|
BridgeUnlocked:
|
|
type: object
|
|
required:
|
|
- lockId
|
|
- token
|
|
- amount
|
|
properties:
|
|
lockId:
|
|
type: string
|
|
token:
|
|
type: string
|
|
amount:
|
|
type: string
|
|
sourceChain:
|
|
type: string
|
|
sourceTx:
|
|
type: string
|
|
|
|
ComplianceUpdated:
|
|
type: object
|
|
required:
|
|
- refId
|
|
- allowed
|
|
- frozen
|
|
properties:
|
|
refId:
|
|
type: string
|
|
allowed:
|
|
type: boolean
|
|
frozen:
|
|
type: boolean
|
|
riskTier:
|
|
type: integer
|
|
jurisdictionHash:
|
|
type: string
|
|
|
|
PolicyUpdated:
|
|
type: object
|
|
required:
|
|
- token
|
|
properties:
|
|
token:
|
|
type: string
|
|
paused:
|
|
type: boolean
|
|
bridgeOnly:
|
|
type: boolean
|
|
lienMode:
|
|
type: string
|
|
enum: ["OFF", "HARD_FREEZE", "ENCUMBERED"]
|
|
|