@0xarchive/sdk 0.6.5 → 0.7.0
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 +24 -1
- package/dist/index.d.mts +40 -6
- package/dist/index.d.ts +40 -6
- package/dist/index.js +19 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1110,11 +1110,13 @@ var DataQualityResource = class {
|
|
|
1110
1110
|
/**
|
|
1111
1111
|
* Get data coverage for a specific symbol on an exchange
|
|
1112
1112
|
*
|
|
1113
|
-
* Includes gap detection
|
|
1113
|
+
* Includes gap detection, empirical data cadence, and hour-level historical coverage.
|
|
1114
|
+
* Supports optional time bounds for gap detection (default: last 30 days).
|
|
1114
1115
|
*
|
|
1115
1116
|
* @param exchange - Exchange name ('hyperliquid' or 'lighter')
|
|
1116
1117
|
* @param symbol - Symbol name (e.g., 'BTC', 'ETH')
|
|
1117
|
-
* @
|
|
1118
|
+
* @param options - Optional time bounds for gap detection window
|
|
1119
|
+
* @returns SymbolCoverageResponse with per-data-type coverage including gaps, cadence, and historical coverage
|
|
1118
1120
|
*
|
|
1119
1121
|
* @example
|
|
1120
1122
|
* ```typescript
|
|
@@ -1125,11 +1127,24 @@ var DataQualityResource = class {
|
|
|
1125
1127
|
* for (const gap of oi.gaps.slice(0, 3)) {
|
|
1126
1128
|
* console.log(` ${gap.durationMinutes} min gap at ${gap.start}`);
|
|
1127
1129
|
* }
|
|
1130
|
+
*
|
|
1131
|
+
* // Check cadence
|
|
1132
|
+
* if (btc.dataTypes.orderbook.cadence) {
|
|
1133
|
+
* console.log(`Cadence: ~${btc.dataTypes.orderbook.cadence.medianIntervalSeconds}s`);
|
|
1134
|
+
* }
|
|
1135
|
+
*
|
|
1136
|
+
* // Time-bounded (last 7 days)
|
|
1137
|
+
* const weekAgo = Date.now() - 7 * 24 * 60 * 60 * 1000;
|
|
1138
|
+
* const btc7d = await client.dataQuality.symbolCoverage('hyperliquid', 'BTC', {
|
|
1139
|
+
* from: weekAgo,
|
|
1140
|
+
* to: Date.now(),
|
|
1141
|
+
* });
|
|
1128
1142
|
* ```
|
|
1129
1143
|
*/
|
|
1130
|
-
async symbolCoverage(exchange, symbol) {
|
|
1144
|
+
async symbolCoverage(exchange, symbol, options) {
|
|
1131
1145
|
return this.http.get(
|
|
1132
|
-
`${this.basePath}/coverage/${exchange.toLowerCase()}/${symbol.toUpperCase()}
|
|
1146
|
+
`${this.basePath}/coverage/${exchange.toLowerCase()}/${symbol.toUpperCase()}`,
|
|
1147
|
+
options
|
|
1133
1148
|
);
|
|
1134
1149
|
}
|
|
1135
1150
|
// ===========================================================================
|