@usherlabs/cex-broker 0.2.52 → 0.3.1
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 +116 -8
- package/dist/commands/cli.js +1515 -467
- package/dist/index.js +1516 -468
- package/dist/index.js.map +31 -26
- package/dist/proto/node.descriptor.ts +3 -1
- package/dist/proto/node.proto +2 -0
- package/package.json +5 -28
- package/dist/commands/cex-canonical-orderbook-export.d.ts +0 -23
- package/dist/commands/cex-canonical-orderbook-export.js +0 -34275
- package/dist/commands/cex-canonical-orderbook-export.js.map +0 -266
- package/dist/commands/market-data-vendor-backfill.d.ts +0 -24
- package/dist/commands/market-data-vendor-backfill.js +0 -34930
- package/dist/commands/market-data-vendor-backfill.js.map +0 -268
- package/dist/handlers/execute-action/context.d.ts +0 -50
- package/dist/handlers/execute-action/deposit.d.ts +0 -2
- package/dist/handlers/execute-action/handler.d.ts +0 -19
- package/dist/handlers/execute-action/index.d.ts +0 -10
- package/dist/handlers/execute-action/internal-transfer.d.ts +0 -2
- package/dist/handlers/execute-action/order-book-call.d.ts +0 -3
- package/dist/handlers/execute-action/orders.d.ts +0 -2
- package/dist/handlers/execute-action/pass-through.d.ts +0 -2
- package/dist/handlers/execute-action/perp-config.d.ts +0 -2
- package/dist/handlers/execute-action/registry.d.ts +0 -5
- package/dist/handlers/execute-action/treasury-call.d.ts +0 -2
- package/dist/handlers/execute-action/withdraw.d.ts +0 -2
- package/dist/handlers/subscribe/broker-lifecycle.d.ts +0 -13
- package/dist/handlers/subscribe/handler.d.ts +0 -20
- package/dist/handlers/subscribe/index.d.ts +0 -2
- package/dist/handlers/types.d.ts +0 -23
- package/dist/helpers/account-balance-archive-poller.d.ts +0 -19
- package/dist/helpers/auth.d.ts +0 -5
- package/dist/helpers/balance-update-archive-consumer.d.ts +0 -16
- package/dist/helpers/binance-user-data-normalization.d.ts +0 -3
- package/dist/helpers/binance-user-data-stream.d.ts +0 -58
- package/dist/helpers/broker-execution-archive/capture.d.ts +0 -41
- package/dist/helpers/broker-execution-archive/index.d.ts +0 -7
- package/dist/helpers/broker-execution-archive/journal-export.d.ts +0 -20
- package/dist/helpers/broker-execution-archive/loss-journal.d.ts +0 -36
- package/dist/helpers/broker-execution-archive/redact.d.ts +0 -7
- package/dist/helpers/broker-execution-archive/rows.d.ts +0 -134
- package/dist/helpers/broker-execution-archive/types.d.ts +0 -26
- package/dist/helpers/broker-execution-archive/withdrawal-observation-tracker.d.ts +0 -23
- package/dist/helpers/broker-execution-archive/writer.d.ts +0 -105
- package/dist/helpers/broker.d.ts +0 -38
- package/dist/helpers/canonical-orderbook-export/exact-selection.d.ts +0 -21
- package/dist/helpers/canonical-orderbook-export/exporter.d.ts +0 -26
- package/dist/helpers/canonical-orderbook-export/parquet-projection.d.ts +0 -19
- package/dist/helpers/constants.d.ts +0 -36
- package/dist/helpers/deposit-archive-poller.d.ts +0 -66
- package/dist/helpers/deposit.d.ts +0 -5
- package/dist/helpers/exchange-credentials.d.ts +0 -10
- package/dist/helpers/fill-archive-poller.d.ts +0 -42
- package/dist/helpers/grpc/broker.d.ts +0 -5
- package/dist/helpers/grpc/callbacks.d.ts +0 -9
- package/dist/helpers/grpc/payload.d.ts +0 -9
- package/dist/helpers/grpc/status.d.ts +0 -8
- package/dist/helpers/index.d.ts +0 -44
- package/dist/helpers/logger.d.ts +0 -13
- package/dist/helpers/market-data-archive/canonical-orderbook.d.ts +0 -20
- package/dist/helpers/market-data-archive/capture-context.d.ts +0 -53
- package/dist/helpers/market-data-archive/capture-contract.d.ts +0 -30
- package/dist/helpers/market-data-archive/capture.d.ts +0 -22
- package/dist/helpers/market-data-archive/index.d.ts +0 -13
- package/dist/helpers/market-data-archive/legacy-migration.d.ts +0 -37
- package/dist/helpers/market-data-archive/ohlcv-bar-tracker.d.ts +0 -11
- package/dist/helpers/market-data-archive/ohlcv-bootstrap.d.ts +0 -1
- package/dist/helpers/market-data-archive/ohlcv-history.d.ts +0 -8
- package/dist/helpers/market-data-archive/orderbook-depth.d.ts +0 -5
- package/dist/helpers/market-data-archive/orderbook-sampler.d.ts +0 -12
- package/dist/helpers/market-data-archive/parse-stream.d.ts +0 -26
- package/dist/helpers/market-data-archive/rows.d.ts +0 -14
- package/dist/helpers/market-data-archive/types.d.ts +0 -83
- package/dist/helpers/market-data-preparation/conformance-fixtures.d.ts +0 -128
- package/dist/helpers/market-data-preparation/contracts.d.ts +0 -2970
- package/dist/helpers/market-data-preparation/file-job.d.ts +0 -38
- package/dist/helpers/market-data-preparation/required-clock-qualification.d.ts +0 -43
- package/dist/helpers/market-data-preparation/source-tape-dependencies.d.ts +0 -19
- package/dist/helpers/market-data-preparation/source-tape-operation.d.ts +0 -109
- package/dist/helpers/market-data-source-forensics.d.ts +0 -400
- package/dist/helpers/market-data-vendor-backfill/archive-reader.d.ts +0 -26
- package/dist/helpers/market-data-vendor-backfill/batching.d.ts +0 -10
- package/dist/helpers/market-data-vendor-backfill/conformance-fixtures.d.ts +0 -78
- package/dist/helpers/market-data-vendor-backfill/contracts.d.ts +0 -358
- package/dist/helpers/market-data-vendor-backfill/core.d.ts +0 -101
- package/dist/helpers/market-data-vendor-backfill/cryptohftdata.d.ts +0 -118
- package/dist/helpers/market-data-vendor-backfill/forwarder-client.d.ts +0 -25
- package/dist/helpers/market-data-vendor-backfill/identity.d.ts +0 -10
- package/dist/helpers/market-data-vendor-backfill/manifests.d.ts +0 -61
- package/dist/helpers/market-data-vendor-backfill/promotion.d.ts +0 -10
- package/dist/helpers/market-data-vendor-backfill/qualification.d.ts +0 -20
- package/dist/helpers/market-data-vendor-backfill/selection.d.ts +0 -30
- package/dist/helpers/market-data-vendor-backfill/semantic-verification.d.ts +0 -25
- package/dist/helpers/market-type.d.ts +0 -16
- package/dist/helpers/order-activity-tracker.d.ts +0 -22
- package/dist/helpers/order-book.d.ts +0 -79
- package/dist/helpers/order-telemetry.d.ts +0 -50
- package/dist/helpers/otel.d.ts +0 -83
- package/dist/helpers/passive-order.d.ts +0 -8
- package/dist/helpers/public-market-data-feed/identity.d.ts +0 -12
- package/dist/helpers/public-market-data-feed/index.d.ts +0 -5
- package/dist/helpers/public-market-data-feed/orderbook-coalescing-evidence.d.ts +0 -79
- package/dist/helpers/public-market-data-feed/orderbook-profile.d.ts +0 -54
- package/dist/helpers/public-market-data-feed/subscriber-buffer.d.ts +0 -31
- package/dist/helpers/public-market-data-feed/supervisor.d.ts +0 -82
- package/dist/helpers/shared/errors.d.ts +0 -14
- package/dist/helpers/shared/guards.d.ts +0 -2
- package/dist/helpers/source-tape-sandbox.d.ts +0 -82
- package/dist/helpers/source-tape.d.ts +0 -165
- package/dist/helpers/stream-health-publisher.d.ts +0 -41
- package/dist/helpers/trace-context.d.ts +0 -8
- package/dist/helpers/transfer-network.d.ts +0 -12
- package/dist/helpers/travel-rule-deposit-reconciler.d.ts +0 -159
- package/dist/helpers/travel-rule.d.ts +0 -75
- package/dist/helpers/treasury-discovery.d.ts +0 -17
- package/dist/helpers/user-asset-archive-poller.d.ts +0 -19
- package/dist/helpers/user-data-stream-supervisor.d.ts +0 -27
- package/dist/helpers/verity.d.ts +0 -5
- package/dist/index.d.ts +0 -56
- package/dist/market-data-preparation/fixtures/conformance-v3.json +0 -621
- package/dist/market-data-preparation/policies/capability-policy.json +0 -39
- package/dist/market-data-preparation/policies/resource-policy.json +0 -16
- package/dist/market-data-preparation/policies/source-tape-capability-v1.json +0 -35
- package/dist/market-data-preparation/schema-manifest.json +0 -66
- package/dist/market-data-preparation/schemas/archive-selection-v1.schema.json +0 -224
- package/dist/market-data-preparation/schemas/backfill-request-v1.schema.json +0 -166
- package/dist/market-data-preparation/schemas/backfill-result-v2.schema.json +0 -212
- package/dist/market-data-preparation/schemas/canonical-orderbook-export-request-v1.schema.json +0 -61
- package/dist/market-data-preparation/schemas/canonical-orderbook-export-result-v2.schema.json +0 -252
- package/dist/market-data-preparation/schemas/order-book-depth-summary-parquet-projection-v1.schema.json +0 -256
- package/dist/market-data-preparation/schemas/order-book-levels-parquet-projection-v1.schema.json +0 -220
- package/dist/market-data-preparation/schemas/preparation-product-pin-v2.schema.json +0 -176
- package/dist/market-data-preparation/schemas/promotion-receipt-v1.schema.json +0 -175
- package/dist/market-data-preparation/schemas/required-clock-v1.schema.json +0 -47
- package/dist/market-data-preparation/schemas/source-forensics-ledger-v1.schema.json +0 -463
- package/dist/market-data-preparation/schemas/source-qualification-record-v1.schema.json +0 -394
- package/dist/market-data-preparation.d.ts +0 -11
- package/dist/market-data-preparation.js +0 -37488
- package/dist/market-data-preparation.js.map +0 -277
- package/dist/market-data-vendor-backfill.d.ts +0 -21
- package/dist/market-data-vendor-backfill.js +0 -22463
- package/dist/market-data-vendor-backfill.js.map +0 -199
- package/dist/proto/node.descriptor.d.ts +0 -127
- package/dist/proto-loader-options.d.ts +0 -7
- package/dist/proto-package-definition.d.ts +0 -2
- package/dist/schemas/action-payloads.d.ts +0 -88
- package/dist/server.d.ts +0 -10
- package/dist/types.d.ts +0 -100
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
export declare const CONFORMANCE_FIXTURES: Readonly<{
|
|
2
|
-
fixture_id: "market-data-vendor-backfill-conformance/v2";
|
|
3
|
-
documents: {
|
|
4
|
-
required_clock: import("./contracts").RequiredClockWire;
|
|
5
|
-
archive_selection: import("./contracts").ArchiveSelectionWire;
|
|
6
|
-
request: {
|
|
7
|
-
idempotency_key: string;
|
|
8
|
-
schema_id: string;
|
|
9
|
-
request_id: string;
|
|
10
|
-
attempt_id: string;
|
|
11
|
-
scope: {
|
|
12
|
-
exchange: string;
|
|
13
|
-
trading_pair: string;
|
|
14
|
-
market_type: "spot";
|
|
15
|
-
feed: "ORDERBOOK";
|
|
16
|
-
};
|
|
17
|
-
window: {
|
|
18
|
-
start_at: string;
|
|
19
|
-
end_at: string;
|
|
20
|
-
};
|
|
21
|
-
depth: number;
|
|
22
|
-
construction_mode: "sampled_top_n_snapshot";
|
|
23
|
-
source_policy: "authoritative_window";
|
|
24
|
-
target: {
|
|
25
|
-
environment: string;
|
|
26
|
-
cluster: string;
|
|
27
|
-
};
|
|
28
|
-
coverage_policy: {
|
|
29
|
-
policy_id: "prior-asof-strict/v1";
|
|
30
|
-
max_asof_lag_ms: number;
|
|
31
|
-
future_rows: "reject";
|
|
32
|
-
missing_required_event: "fail";
|
|
33
|
-
};
|
|
34
|
-
required_clock: {
|
|
35
|
-
schema_id: string;
|
|
36
|
-
clock_id: string;
|
|
37
|
-
file_name: string;
|
|
38
|
-
clock_sha256: string;
|
|
39
|
-
event_count: number;
|
|
40
|
-
};
|
|
41
|
-
initial_selection: import("./contracts").ArchiveSelectionWire;
|
|
42
|
-
expected_canonical_schema: {
|
|
43
|
-
schema_id: string;
|
|
44
|
-
schema_sha256: string;
|
|
45
|
-
};
|
|
46
|
-
product_pins: {
|
|
47
|
-
capability_policy: {
|
|
48
|
-
policy_id: "market-data-vendor-backfill-capabilities/v3";
|
|
49
|
-
policy_sha256: string;
|
|
50
|
-
};
|
|
51
|
-
resource_policy: {
|
|
52
|
-
policy_id: "market-data-vendor-backfill-resources/v2";
|
|
53
|
-
policy_sha256: string;
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
production_authorization_id: string;
|
|
57
|
-
};
|
|
58
|
-
promotion_receipt: import("./contracts").PromotionReceiptWire;
|
|
59
|
-
};
|
|
60
|
-
identities: {
|
|
61
|
-
idempotency_key: string;
|
|
62
|
-
clock_sha256: string;
|
|
63
|
-
initial_selection_sha256: string;
|
|
64
|
-
selection_sha256: string;
|
|
65
|
-
promotion_identity_sha256: string;
|
|
66
|
-
receipt_id: string;
|
|
67
|
-
capability_policy_sha256: string;
|
|
68
|
-
resource_policy_sha256: string;
|
|
69
|
-
};
|
|
70
|
-
jcs_edge_vector: {
|
|
71
|
-
literals: (boolean | null)[];
|
|
72
|
-
numbers: number[];
|
|
73
|
-
string: string;
|
|
74
|
-
};
|
|
75
|
-
hashes: {
|
|
76
|
-
jcs_edge_vector_sha256: string;
|
|
77
|
-
};
|
|
78
|
-
}>;
|
|
@@ -1,358 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const BACKFILL_REQUEST_SCHEMA_ID: string;
|
|
3
|
-
export declare const REQUIRED_CLOCK_SCHEMA_ID: string;
|
|
4
|
-
export declare const ARCHIVE_SELECTION_SCHEMA_ID: string;
|
|
5
|
-
export declare const PROMOTION_RECEIPT_SCHEMA_ID: string;
|
|
6
|
-
export type FixedUtcTimestamp = string;
|
|
7
|
-
export type Sha256Hex = string;
|
|
8
|
-
export type LowercaseUuid = string;
|
|
9
|
-
export type CanonicalScopeWire = {
|
|
10
|
-
exchange: string;
|
|
11
|
-
trading_pair: string;
|
|
12
|
-
market_type: "spot" | "swap" | "future";
|
|
13
|
-
feed: "ORDERBOOK";
|
|
14
|
-
};
|
|
15
|
-
export type CoveragePolicyWire = {
|
|
16
|
-
policy_id: "prior-asof-strict/v1";
|
|
17
|
-
max_asof_lag_ms: number;
|
|
18
|
-
future_rows: "reject";
|
|
19
|
-
missing_required_event: "fail";
|
|
20
|
-
};
|
|
21
|
-
export type RequiredClockWire = {
|
|
22
|
-
schema_id: typeof REQUIRED_CLOCK_SCHEMA_ID;
|
|
23
|
-
clock_id: LowercaseUuid;
|
|
24
|
-
clock_sha256: Sha256Hex;
|
|
25
|
-
created_at: FixedUtcTimestamp;
|
|
26
|
-
targets: Array<{
|
|
27
|
-
target_id: LowercaseUuid;
|
|
28
|
-
target_at: FixedUtcTimestamp;
|
|
29
|
-
}>;
|
|
30
|
-
};
|
|
31
|
-
export type ArchiveSelectionWire = {
|
|
32
|
-
schema_id: typeof ARCHIVE_SELECTION_SCHEMA_ID;
|
|
33
|
-
selection_sha256: Sha256Hex;
|
|
34
|
-
scope: CanonicalScopeWire;
|
|
35
|
-
required_clock: {
|
|
36
|
-
clock_id: LowercaseUuid;
|
|
37
|
-
clock_sha256: Sha256Hex;
|
|
38
|
-
event_count: number;
|
|
39
|
-
};
|
|
40
|
-
coverage_policy: CoveragePolicyWire;
|
|
41
|
-
source_policy: "authoritative_window" | "fill_gaps";
|
|
42
|
-
coverage_class: "complete" | "partial" | "missing";
|
|
43
|
-
requested_intervals: Array<{
|
|
44
|
-
start_at: FixedUtcTimestamp;
|
|
45
|
-
end_at: FixedUtcTimestamp;
|
|
46
|
-
}>;
|
|
47
|
-
selected_intervals: Array<{
|
|
48
|
-
start_at: FixedUtcTimestamp;
|
|
49
|
-
end_at: FixedUtcTimestamp;
|
|
50
|
-
capture_bundle_id: Sha256Hex;
|
|
51
|
-
capture_origin: "production_capture" | "vendor_historical_backfill";
|
|
52
|
-
}>;
|
|
53
|
-
precedence: Array<"archive" | "vendor">;
|
|
54
|
-
bundles: Array<{
|
|
55
|
-
capture_bundle_id: Sha256Hex;
|
|
56
|
-
capture_origin: "production_capture" | "vendor_historical_backfill";
|
|
57
|
-
interval: {
|
|
58
|
-
start_at: FixedUtcTimestamp;
|
|
59
|
-
end_at: FixedUtcTimestamp;
|
|
60
|
-
};
|
|
61
|
-
qualification: null | {
|
|
62
|
-
qualification_event_id: LowercaseUuid;
|
|
63
|
-
state: "qualified";
|
|
64
|
-
receipt_id: Sha256Hex;
|
|
65
|
-
promotion_identity_sha256: Sha256Hex;
|
|
66
|
-
};
|
|
67
|
-
}>;
|
|
68
|
-
support_anchors: Array<{
|
|
69
|
-
capture_bundle_id: Sha256Hex;
|
|
70
|
-
raw_capture_id: Sha256Hex;
|
|
71
|
-
snapshot_id: Sha256Hex;
|
|
72
|
-
source_time: FixedUtcTimestamp;
|
|
73
|
-
normalized_summary_checksum: Sha256Hex;
|
|
74
|
-
metadata_ref: {
|
|
75
|
-
capture_origin: "production_capture" | "vendor_historical_backfill";
|
|
76
|
-
qualification_event_id: LowercaseUuid | null;
|
|
77
|
-
receipt_id: Sha256Hex | null;
|
|
78
|
-
};
|
|
79
|
-
}>;
|
|
80
|
-
receipt_ids: Sha256Hex[];
|
|
81
|
-
qualification_event_ids: LowercaseUuid[];
|
|
82
|
-
resolved_at: FixedUtcTimestamp;
|
|
83
|
-
};
|
|
84
|
-
export type BackfillRequestWire = {
|
|
85
|
-
schema_id: typeof BACKFILL_REQUEST_SCHEMA_ID;
|
|
86
|
-
request_id: LowercaseUuid;
|
|
87
|
-
attempt_id: LowercaseUuid;
|
|
88
|
-
idempotency_key: Sha256Hex;
|
|
89
|
-
scope: CanonicalScopeWire;
|
|
90
|
-
window: {
|
|
91
|
-
start_at: FixedUtcTimestamp;
|
|
92
|
-
end_at: FixedUtcTimestamp;
|
|
93
|
-
};
|
|
94
|
-
depth: number;
|
|
95
|
-
construction_mode: "sampled_top_n_snapshot" | "exact_l2_reconstruction";
|
|
96
|
-
source_policy: "authoritative_window" | "fill_gaps";
|
|
97
|
-
target: {
|
|
98
|
-
environment: string;
|
|
99
|
-
cluster: string;
|
|
100
|
-
};
|
|
101
|
-
coverage_policy: CoveragePolicyWire;
|
|
102
|
-
required_clock: {
|
|
103
|
-
schema_id: typeof REQUIRED_CLOCK_SCHEMA_ID;
|
|
104
|
-
clock_id: LowercaseUuid;
|
|
105
|
-
file_name: string;
|
|
106
|
-
clock_sha256: Sha256Hex;
|
|
107
|
-
event_count: number;
|
|
108
|
-
};
|
|
109
|
-
initial_selection: ArchiveSelectionWire;
|
|
110
|
-
expected_canonical_schema: {
|
|
111
|
-
schema_id: string;
|
|
112
|
-
schema_sha256: Sha256Hex;
|
|
113
|
-
};
|
|
114
|
-
product_pins: {
|
|
115
|
-
capability_policy: {
|
|
116
|
-
policy_id: string;
|
|
117
|
-
policy_sha256: Sha256Hex;
|
|
118
|
-
};
|
|
119
|
-
resource_policy: {
|
|
120
|
-
policy_id: string;
|
|
121
|
-
policy_sha256: Sha256Hex;
|
|
122
|
-
};
|
|
123
|
-
};
|
|
124
|
-
production_authorization_id: LowercaseUuid;
|
|
125
|
-
};
|
|
126
|
-
export type PromotionReceiptWire = {
|
|
127
|
-
schema_id: typeof PROMOTION_RECEIPT_SCHEMA_ID;
|
|
128
|
-
receipt_id: Sha256Hex;
|
|
129
|
-
promotion_identity_sha256: Sha256Hex;
|
|
130
|
-
verified_at: FixedUtcTimestamp;
|
|
131
|
-
request_id: LowercaseUuid;
|
|
132
|
-
idempotency_key: Sha256Hex;
|
|
133
|
-
source: "external_backfill";
|
|
134
|
-
capture_origin: "vendor_historical_backfill";
|
|
135
|
-
source_mode: "vendor_historical_backfill_v1";
|
|
136
|
-
provider: string;
|
|
137
|
-
adapter_version: string;
|
|
138
|
-
effective_policies: {
|
|
139
|
-
capability_policy: {
|
|
140
|
-
policy_id: string;
|
|
141
|
-
policy_sha256: Sha256Hex;
|
|
142
|
-
};
|
|
143
|
-
resource_policy: {
|
|
144
|
-
policy_id: string;
|
|
145
|
-
policy_sha256: Sha256Hex;
|
|
146
|
-
};
|
|
147
|
-
adapter_policy: {
|
|
148
|
-
policy_id: string;
|
|
149
|
-
policy_sha256: Sha256Hex;
|
|
150
|
-
};
|
|
151
|
-
acquisition_policy: {
|
|
152
|
-
policy_id: string;
|
|
153
|
-
policy_sha256: Sha256Hex;
|
|
154
|
-
};
|
|
155
|
-
};
|
|
156
|
-
capture_bundle_id: Sha256Hex;
|
|
157
|
-
scope: CanonicalScopeWire;
|
|
158
|
-
window: {
|
|
159
|
-
start_at: FixedUtcTimestamp;
|
|
160
|
-
end_at: FixedUtcTimestamp;
|
|
161
|
-
};
|
|
162
|
-
depth: number;
|
|
163
|
-
construction_mode: "sampled_top_n_snapshot" | "exact_l2_reconstruction" | "policy_neutral_top_n_state_change_tape/v1";
|
|
164
|
-
canonical_schema: {
|
|
165
|
-
schema_id: string;
|
|
166
|
-
schema_sha256: Sha256Hex;
|
|
167
|
-
};
|
|
168
|
-
coverage_policy: CoveragePolicyWire;
|
|
169
|
-
selection_sha256: Sha256Hex;
|
|
170
|
-
vendor_semantic_digest: Sha256Hex;
|
|
171
|
-
canonical_semantic_digest: Sha256Hex;
|
|
172
|
-
prefix_digest: Sha256Hex;
|
|
173
|
-
suffix_digest: Sha256Hex;
|
|
174
|
-
seam_verified: true;
|
|
175
|
-
coverage_verified: true;
|
|
176
|
-
dataset_objects: Array<{
|
|
177
|
-
identity: string;
|
|
178
|
-
checksum: Sha256Hex;
|
|
179
|
-
bytes: number;
|
|
180
|
-
rows: number;
|
|
181
|
-
}>;
|
|
182
|
-
};
|
|
183
|
-
export declare const FINAL_BACKFILL_STATUSES: readonly ["request_invalid", "archive_preflight_failed", "already_covered", "promoted", "capability_unsupported", "credentials_missing", "vendor_fetch_failed", "archive_ingest_failed", "promotion_verification_failed"];
|
|
184
|
-
export type FinalBackfillStatus = (typeof FINAL_BACKFILL_STATUSES)[number];
|
|
185
|
-
export type BackfillOutcomeWire = {
|
|
186
|
-
status: FinalBackfillStatus;
|
|
187
|
-
reason_code: string;
|
|
188
|
-
reason_subcode: string | null;
|
|
189
|
-
request_id: LowercaseUuid | null;
|
|
190
|
-
idempotency_key: Sha256Hex | null;
|
|
191
|
-
target: {
|
|
192
|
-
environment: string;
|
|
193
|
-
cluster: string;
|
|
194
|
-
} | null;
|
|
195
|
-
selection: ArchiveSelectionWire | null;
|
|
196
|
-
receipt: PromotionReceiptWire | null;
|
|
197
|
-
diagnostics: Record<string, string | number | boolean>;
|
|
198
|
-
};
|
|
199
|
-
type Codec<T> = {
|
|
200
|
-
decode(value: unknown): T;
|
|
201
|
-
is(value: unknown): value is T;
|
|
202
|
-
};
|
|
203
|
-
export declare class BackfillRequestValidationError extends Error {
|
|
204
|
-
readonly reasonSubcode: string;
|
|
205
|
-
constructor(reasonSubcode: string, message: string);
|
|
206
|
-
}
|
|
207
|
-
export declare const requiredClockCodec: Codec<RequiredClockWire>;
|
|
208
|
-
export declare const archiveSelectionCodec: Codec<ArchiveSelectionWire>;
|
|
209
|
-
export declare function promotionIdentitySha256(receipt: Omit<PromotionReceiptWire, "receipt_id" | "promotion_identity_sha256"> & Partial<Pick<PromotionReceiptWire, "receipt_id" | "promotion_identity_sha256">>): string;
|
|
210
|
-
export declare const promotionReceiptCodec: Codec<PromotionReceiptWire>;
|
|
211
|
-
export declare const backfillRequestCodec: {
|
|
212
|
-
decode(value: unknown): {
|
|
213
|
-
wire: BackfillRequestWire;
|
|
214
|
-
};
|
|
215
|
-
is(value: unknown): value is BackfillRequestWire;
|
|
216
|
-
};
|
|
217
|
-
export declare function finalizeRequiredClock(clock: Omit<RequiredClockWire, "clock_sha256">): RequiredClockWire;
|
|
218
|
-
export declare function finalizeArchiveSelection(selection: Omit<ArchiveSelectionWire, "selection_sha256">): ArchiveSelectionWire;
|
|
219
|
-
export declare const BACKFILL_REQUEST_SCHEMA_VERSION: "market-data-vendor-backfill-request/v1";
|
|
220
|
-
export declare const BACKFILL_PROMOTION_SCHEMA_VERSION: "market-data-vendor-backfill-promotion-receipt/v1";
|
|
221
|
-
export declare const EXTERNAL_BACKFILL_SOURCE: "external_backfill";
|
|
222
|
-
export declare const HISTORICAL_VENDOR_SOURCE_MODE: "vendor_historical_backfill_v1";
|
|
223
|
-
export declare const VENDOR_DATASET_RAW_CAPTURE_SCOPE: "vendor_normalized_dataset_file";
|
|
224
|
-
export declare const backfillRequestSchema: z.ZodObject<{
|
|
225
|
-
schemaVersion: z.ZodLiteral<"market-data-vendor-backfill-request/v1">;
|
|
226
|
-
requestId: z.ZodString;
|
|
227
|
-
idempotencyKey: z.ZodString;
|
|
228
|
-
providerPolicy: z.ZodObject<{
|
|
229
|
-
provider: z.ZodLiteral<"cryptohftdata">;
|
|
230
|
-
allowedAdapterVersions: z.ZodArray<z.ZodString>;
|
|
231
|
-
}, z.core.$strict>;
|
|
232
|
-
scope: z.ZodObject<{
|
|
233
|
-
exchange: z.ZodString;
|
|
234
|
-
tradingPair: z.ZodString;
|
|
235
|
-
sourceSymbol: z.ZodString;
|
|
236
|
-
marketType: z.ZodEnum<{
|
|
237
|
-
spot: "spot";
|
|
238
|
-
swap: "swap";
|
|
239
|
-
future: "future";
|
|
240
|
-
}>;
|
|
241
|
-
feed: z.ZodLiteral<"ORDERBOOK">;
|
|
242
|
-
}, z.core.$strict>;
|
|
243
|
-
window: z.ZodObject<{
|
|
244
|
-
startTimeMs: z.ZodNumber;
|
|
245
|
-
endTimeMs: z.ZodNumber;
|
|
246
|
-
}, z.core.$strict>;
|
|
247
|
-
depth: z.ZodNumber;
|
|
248
|
-
constructionMode: z.ZodEnum<{
|
|
249
|
-
sampled_top_n_snapshot: "sampled_top_n_snapshot";
|
|
250
|
-
exact_l2_reconstruction: "exact_l2_reconstruction";
|
|
251
|
-
}>;
|
|
252
|
-
requiredClockTargetsMs: z.ZodArray<z.ZodNumber>;
|
|
253
|
-
maxPriorAsOfLagMs: z.ZodNumber;
|
|
254
|
-
sourcePolicy: z.ZodEnum<{
|
|
255
|
-
authoritative_window: "authoritative_window";
|
|
256
|
-
fill_gaps: "fill_gaps";
|
|
257
|
-
}>;
|
|
258
|
-
budgets: z.ZodObject<{
|
|
259
|
-
maxFiles: z.ZodNumber;
|
|
260
|
-
maxBytes: z.ZodNumber;
|
|
261
|
-
maxRows: z.ZodNumber;
|
|
262
|
-
maxDurationMs: z.ZodNumber;
|
|
263
|
-
maxBoundaryLookbackMs: z.ZodNumber;
|
|
264
|
-
}, z.core.$strict>;
|
|
265
|
-
expectedProduct: z.ZodObject<{
|
|
266
|
-
packageName: z.ZodLiteral<"@usherlabs/cex-broker">;
|
|
267
|
-
packageVersion: z.ZodOptional<z.ZodString>;
|
|
268
|
-
canonicalSchemaVersion: z.ZodString;
|
|
269
|
-
checksumAlgorithm: z.ZodLiteral<"sha256-canonical-json-v1">;
|
|
270
|
-
}, z.core.$strict>;
|
|
271
|
-
}, z.core.$strict>;
|
|
272
|
-
type ProvisionalBackfillDomainRequest = z.infer<typeof backfillRequestSchema>;
|
|
273
|
-
export type MarketDataVendorBackfillRequest = Omit<ProvisionalBackfillDomainRequest, "constructionMode"> & {
|
|
274
|
-
constructionMode: ProvisionalBackfillDomainRequest["constructionMode"] | "policy_neutral_top_n_state_change_tape/v1";
|
|
275
|
-
attemptId?: string;
|
|
276
|
-
target?: {
|
|
277
|
-
environment: string;
|
|
278
|
-
cluster: string;
|
|
279
|
-
};
|
|
280
|
-
coveragePolicy?: CoveragePolicyWire;
|
|
281
|
-
requiredClock?: RequiredClockWire;
|
|
282
|
-
initialSelection?: ArchiveSelectionWire;
|
|
283
|
-
expectedCanonicalSchema?: BackfillRequestWire["expected_canonical_schema"];
|
|
284
|
-
productPins?: BackfillRequestWire["product_pins"];
|
|
285
|
-
productionAuthorizationId?: string;
|
|
286
|
-
wire?: BackfillRequestWire;
|
|
287
|
-
};
|
|
288
|
-
export declare function decodeBackfillRunDocuments(input: {
|
|
289
|
-
request: unknown;
|
|
290
|
-
requiredClock: unknown;
|
|
291
|
-
}): MarketDataVendorBackfillRequest;
|
|
292
|
-
type IdempotencyBusinessFields = Omit<MarketDataVendorBackfillRequest, "requestId" | "idempotencyKey">;
|
|
293
|
-
export declare function backfillBusinessFields(request: Omit<MarketDataVendorBackfillRequest, "idempotencyKey"> & {
|
|
294
|
-
idempotencyKey?: string;
|
|
295
|
-
}): IdempotencyBusinessFields;
|
|
296
|
-
export declare function createBackfillIdempotencyKey(request: Omit<MarketDataVendorBackfillRequest, "idempotencyKey"> & {
|
|
297
|
-
idempotencyKey?: string;
|
|
298
|
-
}): string;
|
|
299
|
-
export declare function createBackfillIdempotencyKey(request: Omit<BackfillRequestWire, "idempotency_key"> & {
|
|
300
|
-
idempotency_key?: string;
|
|
301
|
-
}): string;
|
|
302
|
-
export declare function createBackfillIdempotencyKey(request: Record<string, unknown>): string;
|
|
303
|
-
export declare function parseBackfillRequest(value: unknown): MarketDataVendorBackfillRequest;
|
|
304
|
-
export declare const BACKFILL_STATUSES: readonly ["already_covered", "promoted", "capability_unsupported", "credentials_missing", "vendor_fetch_failed", "archive_ingest_failed", "promotion_verification_failed", "post_backfill_coverage_insufficient"];
|
|
305
|
-
export type BackfillStatus = (typeof BACKFILL_STATUSES)[number];
|
|
306
|
-
export type ProviderCapability = {
|
|
307
|
-
provider: "cryptohftdata";
|
|
308
|
-
adapterVersion: string;
|
|
309
|
-
providerExchangeId: string;
|
|
310
|
-
resolvedSymbol: string;
|
|
311
|
-
};
|
|
312
|
-
export type ProviderObjectEvidence = {
|
|
313
|
-
identity: string;
|
|
314
|
-
checksum: string;
|
|
315
|
-
bytes: number;
|
|
316
|
-
rows: number;
|
|
317
|
-
};
|
|
318
|
-
export type BackfillArchiveRow = {
|
|
319
|
-
table: "market_data.cex_order_book_levels" | "market_data.cex_order_book_depth_summary" | "market_data.cex_order_book_capture_promotions" | "market_data.cex_order_book_capture_qualifications" | "market_data.cex_order_book_archive_selections";
|
|
320
|
-
row: Record<string, unknown>;
|
|
321
|
-
};
|
|
322
|
-
export type ForwarderBatch = {
|
|
323
|
-
source: typeof EXTERNAL_BACKFILL_SOURCE;
|
|
324
|
-
deployment_id: string;
|
|
325
|
-
batch_id: string;
|
|
326
|
-
rows: BackfillArchiveRow[];
|
|
327
|
-
};
|
|
328
|
-
export type PromotionReceipt = {
|
|
329
|
-
schemaVersion: typeof BACKFILL_PROMOTION_SCHEMA_VERSION;
|
|
330
|
-
receiptId: string;
|
|
331
|
-
requestId: string;
|
|
332
|
-
idempotencyKey: string;
|
|
333
|
-
status: "passing";
|
|
334
|
-
source: typeof EXTERNAL_BACKFILL_SOURCE;
|
|
335
|
-
provider: "cryptohftdata";
|
|
336
|
-
adapterVersion: string;
|
|
337
|
-
captureBundleId: string;
|
|
338
|
-
exchange: string;
|
|
339
|
-
tradingPair: string;
|
|
340
|
-
marketType: "spot" | "swap" | "future";
|
|
341
|
-
feed: "ORDERBOOK";
|
|
342
|
-
startTimeMs: number;
|
|
343
|
-
endTimeMs: number;
|
|
344
|
-
depth: number;
|
|
345
|
-
constructionMode: "sampled_top_n_snapshot" | "exact_l2_reconstruction" | "policy_neutral_top_n_state_change_tape/v1";
|
|
346
|
-
canonicalSchemaVersion: string;
|
|
347
|
-
checksumAlgorithm: "sha256-canonical-json-v1";
|
|
348
|
-
vendorSemanticDigest: string;
|
|
349
|
-
canonicalSemanticDigest: string;
|
|
350
|
-
prefixDigest: string;
|
|
351
|
-
suffixDigest: string;
|
|
352
|
-
seamVerified: true;
|
|
353
|
-
coverageVerified: true;
|
|
354
|
-
datasetObjects: ProviderObjectEvidence[];
|
|
355
|
-
verificationTimeMs: number;
|
|
356
|
-
};
|
|
357
|
-
export declare const promotionReceiptSchema: z.ZodType<PromotionReceipt>;
|
|
358
|
-
export {};
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { type ArchiveSelectionWire, type BackfillArchiveRow, type FinalBackfillStatus, type ForwarderBatch, type MarketDataVendorBackfillRequest, type PromotionReceiptWire, type ProviderCapability, type ProviderObjectEvidence } from "./contracts";
|
|
2
|
-
export type ProviderDataset<Row = unknown> = {
|
|
3
|
-
objects: ProviderObjectEvidence[];
|
|
4
|
-
vendorSemanticDigest: string;
|
|
5
|
-
rows: Row[];
|
|
6
|
-
reconstructedBooks?: unknown[];
|
|
7
|
-
};
|
|
8
|
-
export type NormalizedBackfill = {
|
|
9
|
-
captureBundleId: string;
|
|
10
|
-
objects: ProviderObjectEvidence[];
|
|
11
|
-
rows: BackfillArchiveRow[];
|
|
12
|
-
vendorSemanticDigest: string;
|
|
13
|
-
canonicalSemanticDigest: string;
|
|
14
|
-
};
|
|
15
|
-
export type CandidateVerification = {
|
|
16
|
-
passed: boolean;
|
|
17
|
-
captureBundleId: string;
|
|
18
|
-
canonicalSemanticDigest: string;
|
|
19
|
-
prefixDigest: string;
|
|
20
|
-
suffixDigest: string;
|
|
21
|
-
seamVerified: boolean;
|
|
22
|
-
coverageVerified: boolean;
|
|
23
|
-
reasonCode?: string;
|
|
24
|
-
};
|
|
25
|
-
export type ArchiveClusterIdentity = {
|
|
26
|
-
environment: string;
|
|
27
|
-
cluster: string;
|
|
28
|
-
};
|
|
29
|
-
export type ProductionForwarderAuthorization = {
|
|
30
|
-
authorizationId: string;
|
|
31
|
-
scope: "production";
|
|
32
|
-
environment: string;
|
|
33
|
-
cluster: string;
|
|
34
|
-
expiresAt: string;
|
|
35
|
-
credentialValidated: true;
|
|
36
|
-
};
|
|
37
|
-
export type ArchivePreflightResolution = {
|
|
38
|
-
selection: ArchiveSelectionWire;
|
|
39
|
-
receipts: PromotionReceiptWire[];
|
|
40
|
-
readerIdentity: ArchiveClusterIdentity;
|
|
41
|
-
verificationBaseline?: {
|
|
42
|
-
prefixDigest: string;
|
|
43
|
-
suffixDigest: string;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
export type ForwarderPreflightResolution = {
|
|
47
|
-
forwarderIdentity: ArchiveClusterIdentity;
|
|
48
|
-
authorization: ProductionForwarderAuthorization;
|
|
49
|
-
};
|
|
50
|
-
/** @deprecated Use ArchivePreflightResolution and its exact selection. */
|
|
51
|
-
export type QualifiedCoverage = {
|
|
52
|
-
complete: boolean;
|
|
53
|
-
coverageDigest: string;
|
|
54
|
-
prefixDigest?: string;
|
|
55
|
-
suffixDigest?: string;
|
|
56
|
-
};
|
|
57
|
-
export type BackfillDomainOutcome = {
|
|
58
|
-
status: FinalBackfillStatus;
|
|
59
|
-
reasonCode: string;
|
|
60
|
-
reasonSubcode?: string;
|
|
61
|
-
requestId?: string;
|
|
62
|
-
idempotencyKey?: string;
|
|
63
|
-
target?: ArchiveClusterIdentity;
|
|
64
|
-
selection?: ArchiveSelectionWire;
|
|
65
|
-
receipt?: PromotionReceiptWire;
|
|
66
|
-
diagnostics?: Record<string, string | number | boolean>;
|
|
67
|
-
};
|
|
68
|
-
export type BackfillDependencies = {
|
|
69
|
-
archive: {
|
|
70
|
-
resolveSelection(request: MarketDataVendorBackfillRequest): Promise<ArchivePreflightResolution>;
|
|
71
|
-
verifyCandidate(request: MarketDataVendorBackfillRequest, normalized: NormalizedBackfill, captureBundleId: string, baseline: ArchivePreflightResolution): Promise<CandidateVerification>;
|
|
72
|
-
};
|
|
73
|
-
providers: {
|
|
74
|
-
capabilityFor(request: MarketDataVendorBackfillRequest): ProviderCapability | undefined;
|
|
75
|
-
acquire(request: MarketDataVendorBackfillRequest, capability: ProviderCapability, credential: unknown): Promise<ProviderDataset>;
|
|
76
|
-
normalize(request: MarketDataVendorBackfillRequest, capability: ProviderCapability, dataset: ProviderDataset, captureBundleId: string): Promise<NormalizedBackfill>;
|
|
77
|
-
};
|
|
78
|
-
credentials: {
|
|
79
|
-
resolve(provider: "cryptohftdata"): Promise<unknown | undefined>;
|
|
80
|
-
};
|
|
81
|
-
forwarder: {
|
|
82
|
-
preflight(input: {
|
|
83
|
-
authorizationId: string;
|
|
84
|
-
target: ArchiveClusterIdentity;
|
|
85
|
-
}): Promise<ForwarderPreflightResolution>;
|
|
86
|
-
submit(batch: ForwarderBatch): Promise<{
|
|
87
|
-
ok: boolean;
|
|
88
|
-
inserted: number;
|
|
89
|
-
}>;
|
|
90
|
-
};
|
|
91
|
-
clock: {
|
|
92
|
-
nowMs(): number;
|
|
93
|
-
};
|
|
94
|
-
retry?: {
|
|
95
|
-
maxAttempts: number;
|
|
96
|
-
wait?: (completedAttempt: number) => Promise<void>;
|
|
97
|
-
};
|
|
98
|
-
log?: (event: string, fields: Record<string, unknown>) => void;
|
|
99
|
-
};
|
|
100
|
-
export declare function createMarketDataVendorBackfillDependencies(dependencies: BackfillDependencies): BackfillDependencies;
|
|
101
|
-
export declare function runMarketDataVendorBackfill(input: unknown, dependencies: BackfillDependencies): Promise<BackfillDomainOutcome>;
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import type { ReconstructionObservationSink } from "../market-data-source-forensics";
|
|
2
|
-
import { type MarketDataVendorBackfillRequest, type ProviderCapability, type ProviderObjectEvidence } from "./contracts";
|
|
3
|
-
import type { NormalizedBackfill, ProviderDataset } from "./core";
|
|
4
|
-
export declare const CRYPTOHFTDATA_ADAPTER_VERSION: "cryptohftdata-orderbook/v2";
|
|
5
|
-
export declare const CRYPTOHFTDATA_API_URL: "https://api.cryptohftdata.com";
|
|
6
|
-
export declare const DIAGNOSTIC_LAG_THRESHOLDS_MS: readonly [1000, 2000, 5000, 10000, 30000, 60000];
|
|
7
|
-
export declare const SOURCE_TAPE_MAX_STATES_PER_YIELD: 4;
|
|
8
|
-
export declare const SOURCE_TAPE_MAX_BATCH_BYTES: 5242880;
|
|
9
|
-
export declare const SOURCE_TAPE_MAX_IN_FLIGHT: 1;
|
|
10
|
-
export declare const BACKFILL_CLOCK_DIAGNOSTIC_KEYS: readonly ["target_time_ms", "source_time_ms", "asof_lag_ms", "max_prior_asof_lag_ms", "missing_target_count", "covered_target_count", "first_missing_target_time_ms", "last_missing_target_time_ms", "max_observed_asof_lag_ms", "missing_target_dates_utc", "total_target_count", "unanchored_target_count", "future_state_target_count", ...("covered_target_count_lag_1000_ms" | "covered_target_count_lag_60000_ms" | "covered_target_count_lag_5000_ms" | "covered_target_count_lag_2000_ms" | "covered_target_count_lag_10000_ms" | "covered_target_count_lag_30000_ms")[]];
|
|
11
|
-
export declare const BACKFILL_SEQUENCE_DIAGNOSTIC_KEYS: readonly ["event_time_ms", "expected_previous_sequence", "observed_previous_sequence", "observed_final_sequence", "sequence_gap_count", "first_sequence_gap_event_time_ms", "last_sequence_gap_event_time_ms"];
|
|
12
|
-
export type CryptoHftDataCapabilityProfile = Readonly<{
|
|
13
|
-
profileId: string;
|
|
14
|
-
exchange: string;
|
|
15
|
-
tradingPair: string;
|
|
16
|
-
sourceSymbol: string;
|
|
17
|
-
marketType: "spot" | "swap" | "future";
|
|
18
|
-
providerExchangeId: string;
|
|
19
|
-
historyStartMs: number;
|
|
20
|
-
maxDepth: number;
|
|
21
|
-
eventTimeUnit: "milliseconds";
|
|
22
|
-
receivedTimeUnit: "nanoseconds";
|
|
23
|
-
snapshotGrouping: "event_time_last_update_id_object" | "event_time_final_update_id_object";
|
|
24
|
-
sequenceSemantics: "binance_u_U_pu" | "okx_seq_id_prev_seq_id";
|
|
25
|
-
constructionModes: readonly ["sampled_top_n_snapshot"];
|
|
26
|
-
sourcePolicies: readonly ("authoritative_window" | "fill_gaps")[];
|
|
27
|
-
}>;
|
|
28
|
-
export declare const CRYPTOHFTDATA_BINANCE_SPOT_BTCUSDT_PROFILE: CryptoHftDataCapabilityProfile;
|
|
29
|
-
export declare const CRYPTOHFTDATA_OKX_SPOT_ARBUSDT_PROFILE: CryptoHftDataCapabilityProfile;
|
|
30
|
-
export declare const CRYPTOHFTDATA_OKX_SPOT_ARBUSDC_PROFILE: CryptoHftDataCapabilityProfile;
|
|
31
|
-
export declare class CryptoHftDataError extends Error {
|
|
32
|
-
readonly reason: string;
|
|
33
|
-
readonly diagnostics: Readonly<Record<string, string | number | boolean>>;
|
|
34
|
-
constructor(reason: string, diagnostics?: Readonly<Record<string, string | number | boolean>>);
|
|
35
|
-
}
|
|
36
|
-
export type CryptoHftDataOrderBookRow = {
|
|
37
|
-
received_time: string | number | bigint;
|
|
38
|
-
event_time: string | number | bigint;
|
|
39
|
-
transaction_time?: string | number | bigint | null;
|
|
40
|
-
symbol: string;
|
|
41
|
-
event_type: "snapshot" | "update";
|
|
42
|
-
first_update_id?: string | number | bigint | null;
|
|
43
|
-
final_update_id?: string | number | bigint | null;
|
|
44
|
-
prev_final_update_id?: string | number | bigint | null;
|
|
45
|
-
last_update_id?: string | number | bigint | null;
|
|
46
|
-
side: "bid" | "ask";
|
|
47
|
-
price: string;
|
|
48
|
-
quantity: string;
|
|
49
|
-
order_count?: string | number | bigint | null;
|
|
50
|
-
dataset_object_identity: string;
|
|
51
|
-
dataset_object_checksum: string;
|
|
52
|
-
};
|
|
53
|
-
export type ReconstructedCryptoHftBook = {
|
|
54
|
-
targetTimeMs: number;
|
|
55
|
-
sourceTimeMs: number;
|
|
56
|
-
receivedTimeMs: number;
|
|
57
|
-
sequence: string;
|
|
58
|
-
bids: number[][];
|
|
59
|
-
asks: number[][];
|
|
60
|
-
datasetObjectIdentity: string;
|
|
61
|
-
datasetObjectChecksum: string;
|
|
62
|
-
};
|
|
63
|
-
export type PolicyNeutralCryptoHftBookState = ReconstructedCryptoHftBook & {
|
|
64
|
-
tapeState: "initialization" | "change";
|
|
65
|
-
};
|
|
66
|
-
export type PolicyNeutralTapeSink = {
|
|
67
|
-
writeBatch(states: readonly PolicyNeutralCryptoHftBookState[]): Promise<void>;
|
|
68
|
-
complete(input: {
|
|
69
|
-
expectedObjectIdentities: readonly string[];
|
|
70
|
-
observedObjects: readonly ProviderObjectEvidence[];
|
|
71
|
-
stateCount: number;
|
|
72
|
-
}): Promise<void>;
|
|
73
|
-
abort(input: {
|
|
74
|
-
reason: string;
|
|
75
|
-
retainedStateCount: number;
|
|
76
|
-
}): Promise<void>;
|
|
77
|
-
};
|
|
78
|
-
export declare function cryptoHftDataCapabilityFor(request: MarketDataVendorBackfillRequest, profiles?: readonly CryptoHftDataCapabilityProfile[]): ProviderCapability | undefined;
|
|
79
|
-
export declare function enumerateCryptoHftDataObjects(request: MarketDataVendorBackfillRequest, providerExchangeId: string, resolvedSymbol: string): string[];
|
|
80
|
-
export declare function enumerateCryptoHftDataWindowObjects(request: MarketDataVendorBackfillRequest, providerExchangeId: string, resolvedSymbol: string): string[];
|
|
81
|
-
export declare function providerAcquisitionRequest(request: MarketDataVendorBackfillRequest): MarketDataVendorBackfillRequest;
|
|
82
|
-
export declare function reconstructCryptoHftDataOrderBooks(request: MarketDataVendorBackfillRequest, inputRows: readonly CryptoHftDataOrderBookRow[], profile?: CryptoHftDataCapabilityProfile, observer?: ReconstructionObservationSink): ReconstructedCryptoHftBook[];
|
|
83
|
-
/**
|
|
84
|
-
* Qualification-only full-window policy-neutral source projection.
|
|
85
|
-
* It uses the production OKX grouping, validation, sequence and mutation path,
|
|
86
|
-
* but continues after the submitted clock is exhausted and emits no Maker
|
|
87
|
-
* policy decisions.
|
|
88
|
-
*/
|
|
89
|
-
export declare function reconstructCryptoHftDataPolicyNeutralTape(request: MarketDataVendorBackfillRequest, inputRows: readonly CryptoHftDataOrderBookRow[], profile: CryptoHftDataCapabilityProfile, observer?: ReconstructionObservationSink): PolicyNeutralCryptoHftBookState[];
|
|
90
|
-
export declare function decodeCryptoHftParquetZstd(bytes: Uint8Array): Promise<Record<string, unknown>[]>;
|
|
91
|
-
export type CryptoHftDataAdapterOptions = {
|
|
92
|
-
baseUrl?: string;
|
|
93
|
-
fetch?: typeof fetch;
|
|
94
|
-
nowMs?: () => number;
|
|
95
|
-
decode?: (bytes: Uint8Array) => Promise<Record<string, unknown>[]>;
|
|
96
|
-
profiles?: readonly CryptoHftDataCapabilityProfile[];
|
|
97
|
-
observer?: ReconstructionObservationSink;
|
|
98
|
-
policyNeutralTapeSink?: PolicyNeutralTapeSink;
|
|
99
|
-
};
|
|
100
|
-
export declare class CryptoHftDataAdapter {
|
|
101
|
-
private readonly baseUrl;
|
|
102
|
-
private readonly request;
|
|
103
|
-
private readonly nowMs;
|
|
104
|
-
private readonly decode;
|
|
105
|
-
private readonly profiles;
|
|
106
|
-
private readonly observer?;
|
|
107
|
-
private readonly collectPolicyNeutralTape;
|
|
108
|
-
private readonly policyNeutralTapeSink?;
|
|
109
|
-
constructor(options?: CryptoHftDataAdapterOptions);
|
|
110
|
-
private observe;
|
|
111
|
-
capabilityFor(request: MarketDataVendorBackfillRequest): ProviderCapability | undefined;
|
|
112
|
-
private findProfile;
|
|
113
|
-
private profileFor;
|
|
114
|
-
discoverSymbols(providerExchangeId: string): Promise<string[]>;
|
|
115
|
-
acquire(request: MarketDataVendorBackfillRequest, capability: ProviderCapability, credential: unknown): Promise<ProviderDataset<CryptoHftDataOrderBookRow>>;
|
|
116
|
-
private acquireInternal;
|
|
117
|
-
normalize(request: MarketDataVendorBackfillRequest, capability: ProviderCapability, dataset: ProviderDataset, captureBundleId: string): Promise<NormalizedBackfill>;
|
|
118
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ForwarderBatch } from "./contracts";
|
|
2
|
-
import type { ArchiveClusterIdentity, ProductionForwarderAuthorization } from "./core";
|
|
3
|
-
export type ArchiveForwarderClient = {
|
|
4
|
-
preflight(input: {
|
|
5
|
-
authorizationId: string;
|
|
6
|
-
target: ArchiveClusterIdentity;
|
|
7
|
-
}): Promise<{
|
|
8
|
-
forwarderIdentity: ArchiveClusterIdentity;
|
|
9
|
-
authorization: ProductionForwarderAuthorization;
|
|
10
|
-
}>;
|
|
11
|
-
submit(batch: ForwarderBatch): Promise<{
|
|
12
|
-
ok: boolean;
|
|
13
|
-
inserted: number;
|
|
14
|
-
}>;
|
|
15
|
-
};
|
|
16
|
-
export type ArchiveForwarderClientOptions = {
|
|
17
|
-
url: string;
|
|
18
|
-
authToken?: string;
|
|
19
|
-
fetch?: typeof globalThis.fetch;
|
|
20
|
-
};
|
|
21
|
-
export declare class ArchiveForwarderSubmissionError extends Error {
|
|
22
|
-
readonly reason: string;
|
|
23
|
-
constructor(reason: string, status?: number);
|
|
24
|
-
}
|
|
25
|
-
export declare function createArchiveForwarderClient(options: ArchiveForwarderClientOptions): ArchiveForwarderClient;
|