@usherlabs/cex-broker 0.2.45 → 0.2.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/commands/cli.js +16231 -15573
- package/dist/handlers/subscribe/handler.d.ts +2 -0
- package/dist/helpers/market-data-archive/capture-contract.d.ts +3 -2
- package/dist/helpers/market-data-archive/types.d.ts +8 -4
- package/dist/helpers/market-data-vendor-backfill/archive-reader.d.ts +26 -0
- package/dist/helpers/market-data-vendor-backfill/batching.d.ts +10 -0
- package/dist/helpers/market-data-vendor-backfill/conformance-fixtures.d.ts +80 -0
- package/dist/helpers/market-data-vendor-backfill/contracts.d.ts +393 -0
- package/dist/helpers/market-data-vendor-backfill/core.d.ts +100 -0
- package/dist/helpers/market-data-vendor-backfill/cryptohftdata.d.ts +77 -0
- package/dist/helpers/market-data-vendor-backfill/forwarder-client.d.ts +25 -0
- package/dist/helpers/market-data-vendor-backfill/identity.d.ts +10 -0
- package/dist/helpers/market-data-vendor-backfill/manifests.d.ts +1086 -0
- package/dist/helpers/market-data-vendor-backfill/promotion.d.ts +9 -0
- package/dist/helpers/market-data-vendor-backfill/qualification.d.ts +20 -0
- package/dist/helpers/market-data-vendor-backfill/selection.d.ts +30 -0
- package/dist/helpers/market-data-vendor-backfill/semantic-verification.d.ts +24 -0
- package/dist/helpers/public-market-data-feed/identity.d.ts +12 -0
- package/dist/helpers/public-market-data-feed/index.d.ts +5 -0
- package/dist/helpers/public-market-data-feed/orderbook-coalescing-evidence.d.ts +79 -0
- package/dist/helpers/public-market-data-feed/orderbook-profile.d.ts +54 -0
- package/dist/helpers/public-market-data-feed/subscriber-buffer.d.ts +31 -0
- package/dist/helpers/public-market-data-feed/supervisor.d.ts +82 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +16221 -15563
- package/dist/index.js.map +21 -18
- package/dist/market-data-vendor-backfill/fixtures/conformance-v1.json +448 -0
- package/dist/market-data-vendor-backfill/policies/capability-policy.json +28 -0
- package/dist/market-data-vendor-backfill/policies/resource-policy.json +16 -0
- package/dist/market-data-vendor-backfill/schema-manifest.json +31 -0
- package/dist/market-data-vendor-backfill/schemas/archive-selection.schema.json +224 -0
- package/dist/market-data-vendor-backfill/schemas/promotion-receipt.schema.json +171 -0
- package/dist/market-data-vendor-backfill/schemas/request.schema.json +166 -0
- package/dist/market-data-vendor-backfill/schemas/required-clock.schema.json +47 -0
- package/dist/market-data-vendor-backfill/schemas/result.schema.json +198 -0
- package/dist/market-data-vendor-backfill.d.ts +18 -0
- package/dist/market-data-vendor-backfill.js +18819 -0
- package/dist/market-data-vendor-backfill.js.map +206 -0
- package/dist/server.d.ts +2 -1
- package/package.json +24 -2
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.usher.so/market-data-vendor-backfill-result/v1",
|
|
4
|
+
"title": "Fiet TEE market data vendor backfill file-job result v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"schema_id",
|
|
9
|
+
"result_sha256",
|
|
10
|
+
"job_id",
|
|
11
|
+
"request_file_sha256",
|
|
12
|
+
"executable_sha256",
|
|
13
|
+
"schema_manifest_sha256",
|
|
14
|
+
"cex_package",
|
|
15
|
+
"capability_policy",
|
|
16
|
+
"resource_policy",
|
|
17
|
+
"build",
|
|
18
|
+
"started_at",
|
|
19
|
+
"completed_at",
|
|
20
|
+
"outcome"
|
|
21
|
+
],
|
|
22
|
+
"properties": {
|
|
23
|
+
"schema_id": {
|
|
24
|
+
"const": "https://schemas.usher.so/market-data-vendor-backfill-result/v1"
|
|
25
|
+
},
|
|
26
|
+
"result_sha256": { "$ref": "#/$defs/sha256" },
|
|
27
|
+
"job_id": { "$ref": "#/$defs/uuid" },
|
|
28
|
+
"request_file_sha256": {
|
|
29
|
+
"oneOf": [{ "type": "null" }, { "$ref": "#/$defs/sha256" }]
|
|
30
|
+
},
|
|
31
|
+
"executable_sha256": { "$ref": "#/$defs/sha256" },
|
|
32
|
+
"schema_manifest_sha256": { "$ref": "#/$defs/sha256" },
|
|
33
|
+
"cex_package": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"additionalProperties": false,
|
|
36
|
+
"required": ["name", "version", "package_sha256"],
|
|
37
|
+
"properties": {
|
|
38
|
+
"name": { "const": "@usherlabs/cex-broker" },
|
|
39
|
+
"version": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+(?:-[0-9A-Za-z.-]+)?$"
|
|
42
|
+
},
|
|
43
|
+
"package_sha256": { "$ref": "#/$defs/sha256" }
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"capability_policy": { "$ref": "#/$defs/policyPin" },
|
|
47
|
+
"resource_policy": { "$ref": "#/$defs/policyPin" },
|
|
48
|
+
"build": {
|
|
49
|
+
"type": "object",
|
|
50
|
+
"additionalProperties": false,
|
|
51
|
+
"required": ["fiet_tee_commit", "created_at"],
|
|
52
|
+
"properties": {
|
|
53
|
+
"fiet_tee_commit": { "type": "string", "pattern": "^[0-9a-f]{40}$" },
|
|
54
|
+
"created_at": { "$ref": "#/$defs/timestamp" }
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"started_at": { "$ref": "#/$defs/timestamp" },
|
|
58
|
+
"completed_at": { "$ref": "#/$defs/timestamp" },
|
|
59
|
+
"outcome": {
|
|
60
|
+
"type": "object",
|
|
61
|
+
"additionalProperties": false,
|
|
62
|
+
"required": [
|
|
63
|
+
"status",
|
|
64
|
+
"reason_code",
|
|
65
|
+
"reason_subcode",
|
|
66
|
+
"request_id",
|
|
67
|
+
"idempotency_key",
|
|
68
|
+
"target",
|
|
69
|
+
"selection",
|
|
70
|
+
"receipt",
|
|
71
|
+
"diagnostics"
|
|
72
|
+
],
|
|
73
|
+
"properties": {
|
|
74
|
+
"status": {
|
|
75
|
+
"enum": [
|
|
76
|
+
"request_invalid",
|
|
77
|
+
"archive_preflight_failed",
|
|
78
|
+
"already_covered",
|
|
79
|
+
"promoted",
|
|
80
|
+
"capability_unsupported",
|
|
81
|
+
"credentials_missing",
|
|
82
|
+
"vendor_fetch_failed",
|
|
83
|
+
"archive_ingest_failed",
|
|
84
|
+
"promotion_verification_failed"
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
"reason_code": {
|
|
88
|
+
"type": "string",
|
|
89
|
+
"pattern": "^[a-z][a-z0-9_]{0,127}$"
|
|
90
|
+
},
|
|
91
|
+
"reason_subcode": {
|
|
92
|
+
"oneOf": [
|
|
93
|
+
{ "type": "null" },
|
|
94
|
+
{ "type": "string", "pattern": "^[a-z][a-z0-9_]{0,127}$" }
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
"request_id": {
|
|
98
|
+
"oneOf": [{ "type": "null" }, { "$ref": "#/$defs/uuid" }]
|
|
99
|
+
},
|
|
100
|
+
"idempotency_key": {
|
|
101
|
+
"oneOf": [{ "type": "null" }, { "$ref": "#/$defs/sha256" }]
|
|
102
|
+
},
|
|
103
|
+
"target": {
|
|
104
|
+
"oneOf": [
|
|
105
|
+
{ "type": "null" },
|
|
106
|
+
{
|
|
107
|
+
"type": "object",
|
|
108
|
+
"additionalProperties": false,
|
|
109
|
+
"required": ["environment", "cluster"],
|
|
110
|
+
"properties": {
|
|
111
|
+
"environment": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
"pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
|
|
114
|
+
},
|
|
115
|
+
"cluster": {
|
|
116
|
+
"type": "string",
|
|
117
|
+
"pattern": "^[a-z0-9][a-z0-9_-]{0,127}$"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
},
|
|
123
|
+
"selection": {
|
|
124
|
+
"oneOf": [
|
|
125
|
+
{ "type": "null" },
|
|
126
|
+
{
|
|
127
|
+
"$ref": "https://schemas.usher.so/market-data-vendor-backfill-archive-selection/v1"
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
"receipt": {
|
|
132
|
+
"oneOf": [
|
|
133
|
+
{ "type": "null" },
|
|
134
|
+
{
|
|
135
|
+
"$ref": "https://schemas.usher.so/market-data-vendor-backfill-promotion-receipt/v1"
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
},
|
|
139
|
+
"diagnostics": {
|
|
140
|
+
"type": "object",
|
|
141
|
+
"maxProperties": 64,
|
|
142
|
+
"additionalProperties": {
|
|
143
|
+
"oneOf": [
|
|
144
|
+
{ "type": "string", "maxLength": 1024 },
|
|
145
|
+
{ "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
|
|
146
|
+
{ "type": "boolean" }
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
"allOf": [
|
|
154
|
+
{
|
|
155
|
+
"if": {
|
|
156
|
+
"properties": {
|
|
157
|
+
"outcome": {
|
|
158
|
+
"type": "object",
|
|
159
|
+
"properties": {
|
|
160
|
+
"status": { "const": "request_invalid" },
|
|
161
|
+
"reason_subcode": { "const": "request_file_unreadable" }
|
|
162
|
+
},
|
|
163
|
+
"required": ["status", "reason_subcode"]
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
"required": ["outcome"]
|
|
167
|
+
},
|
|
168
|
+
"then": {
|
|
169
|
+
"type": "object",
|
|
170
|
+
"properties": { "request_file_sha256": { "type": "null" } }
|
|
171
|
+
},
|
|
172
|
+
"else": {
|
|
173
|
+
"type": "object",
|
|
174
|
+
"properties": { "request_file_sha256": { "$ref": "#/$defs/sha256" } }
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
"$defs": {
|
|
179
|
+
"uuid": {
|
|
180
|
+
"type": "string",
|
|
181
|
+
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
|
|
182
|
+
},
|
|
183
|
+
"sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
|
|
184
|
+
"timestamp": {
|
|
185
|
+
"type": "string",
|
|
186
|
+
"pattern": "^[0-9]{4}-(0[1-9]|1[0-2])-([0-2][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]\\.[0-9]{3}Z$"
|
|
187
|
+
},
|
|
188
|
+
"policyPin": {
|
|
189
|
+
"type": "object",
|
|
190
|
+
"additionalProperties": false,
|
|
191
|
+
"required": ["policy_id", "policy_sha256"],
|
|
192
|
+
"properties": {
|
|
193
|
+
"policy_id": { "type": "string", "minLength": 1, "maxLength": 256 },
|
|
194
|
+
"policy_sha256": { "$ref": "#/$defs/sha256" }
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type { ArchiveQueryClient, ArchiveQueryValue, QualifiedArchiveReaderOptions, } from "./helpers/market-data-vendor-backfill/archive-reader";
|
|
2
|
+
export { createClickHouseArchiveQueryClient, QualifiedOrderBookArchiveReader, } from "./helpers/market-data-vendor-backfill/archive-reader";
|
|
3
|
+
export { BACKFILL_MAX_BATCH_BYTES, BACKFILL_MAX_BATCH_ROWS, buildForwarderBatches, } from "./helpers/market-data-vendor-backfill/batching";
|
|
4
|
+
export { CONFORMANCE_FIXTURES } from "./helpers/market-data-vendor-backfill/conformance-fixtures";
|
|
5
|
+
export type { ArchiveSelectionWire, BackfillArchiveRow, BackfillJobResultWire, BackfillRequestWire, CanonicalScopeWire, CoveragePolicyWire, FinalBackfillStatus, FixedUtcTimestamp, ForwarderBatch, LowercaseUuid, MarketDataVendorBackfillRequest, PromotionReceiptWire, ProviderCapability, ProviderObjectEvidence, RequiredClockWire, Sha256Hex, } from "./helpers/market-data-vendor-backfill/contracts";
|
|
6
|
+
export { ARCHIVE_SELECTION_SCHEMA_ID, archiveSelectionCodec, BACKFILL_REQUEST_SCHEMA_ID, BACKFILL_RESULT_SCHEMA_ID, backfillRequestCodec, backfillResultCodec, createBackfillIdempotencyKey, decodeBackfillRunDocuments, FINAL_BACKFILL_STATUSES, finalizeArchiveSelection, finalizeBackfillResult, finalizeRequiredClock, PROMOTION_RECEIPT_SCHEMA_ID, promotionIdentitySha256, promotionReceiptCodec, REQUIRED_CLOCK_SCHEMA_ID, requiredClockCodec, } from "./helpers/market-data-vendor-backfill/contracts";
|
|
7
|
+
export type { ArchiveClusterIdentity, ArchivePreflightResolution, BackfillDependencies, BackfillDomainOutcome, CandidateVerification, ForwarderPreflightResolution, NormalizedBackfill, ProductionForwarderAuthorization, ProviderDataset, } from "./helpers/market-data-vendor-backfill/core";
|
|
8
|
+
export { createMarketDataVendorBackfillDependencies, runMarketDataVendorBackfill, } from "./helpers/market-data-vendor-backfill/core";
|
|
9
|
+
export type { CryptoHftDataCapabilityProfile, CryptoHftDataOrderBookRow, ReconstructedCryptoHftBook, } from "./helpers/market-data-vendor-backfill/cryptohftdata";
|
|
10
|
+
export { CRYPTOHFTDATA_ADAPTER_VERSION, CRYPTOHFTDATA_API_URL, CRYPTOHFTDATA_BINANCE_SPOT_BTCUSDT_PROFILE, CRYPTOHFTDATA_OKX_SPOT_ARBUSDT_PROFILE, CryptoHftDataAdapter, CryptoHftDataError, cryptoHftDataCapabilityFor, decodeCryptoHftParquetZstd, enumerateCryptoHftDataObjects, reconstructCryptoHftDataOrderBooks, } from "./helpers/market-data-vendor-backfill/cryptohftdata";
|
|
11
|
+
export type { ArchiveForwarderClient, ArchiveForwarderClientOptions, } from "./helpers/market-data-vendor-backfill/forwarder-client";
|
|
12
|
+
export { ArchiveForwarderSubmissionError, createArchiveForwarderClient, } from "./helpers/market-data-vendor-backfill/forwarder-client";
|
|
13
|
+
export type { JsonPrimitive, JsonValue, } from "./helpers/market-data-vendor-backfill/identity";
|
|
14
|
+
export { assertDocumentSha256, documentSha256, jcsCanonicalize, jcsSha256, withoutOwnDigest, } from "./helpers/market-data-vendor-backfill/identity";
|
|
15
|
+
export type { PolicyPin } from "./helpers/market-data-vendor-backfill/manifests";
|
|
16
|
+
export { ACQUISITION_POLICY_ID, ADAPTER_POLICY_ID, assertPolicyDocumentIdentity, CAPABILITY_POLICY, CAPABILITY_POLICY_ID, EFFECTIVE_ACQUISITION_POLICY_PIN, EFFECTIVE_ADAPTER_POLICY_PIN, RESOURCE_POLICY, RESOURCE_POLICY_ID, SCHEMA_ARTIFACTS, SCHEMA_MANIFEST, } from "./helpers/market-data-vendor-backfill/manifests";
|
|
17
|
+
export type { ArchiveBundleEvidence, ArchiveQualificationEvidence, ArchiveSupportAnchorEvidence, } from "./helpers/market-data-vendor-backfill/selection";
|
|
18
|
+
export { archiveSelectionFromArchiveRow, archiveSelectionToArchiveRow, resolveArchiveSelection, } from "./helpers/market-data-vendor-backfill/selection";
|