@0xarchive/sdk 0.9.0 → 0.9.2
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 +137 -4
- package/dist/index.d.mts +214 -3
- package/dist/index.d.ts +214 -3
- package/dist/index.js +310 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +310 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -407,18 +407,26 @@ for (const bucket of volume.data) {
|
|
|
407
407
|
Check when each data type was last updated for a specific coin. Useful for verifying data recency before pulling it.
|
|
408
408
|
|
|
409
409
|
```typescript
|
|
410
|
+
// Hyperliquid
|
|
410
411
|
const freshness = await client.hyperliquid.freshness('BTC');
|
|
411
412
|
console.log(`Orderbook last updated: ${freshness.orderbook.lastUpdated}, lag: ${freshness.orderbook.lagMs}ms`);
|
|
412
413
|
console.log(`Trades last updated: ${freshness.trades.lastUpdated}, lag: ${freshness.trades.lagMs}ms`);
|
|
413
414
|
console.log(`Funding last updated: ${freshness.funding.lastUpdated}`);
|
|
414
415
|
console.log(`OI last updated: ${freshness.openInterest.lastUpdated}`);
|
|
416
|
+
|
|
417
|
+
// Lighter.xyz
|
|
418
|
+
const lighterFreshness = await client.lighter.freshness('BTC');
|
|
419
|
+
|
|
420
|
+
// HIP-3 (case-sensitive coins)
|
|
421
|
+
const hip3Freshness = await client.hyperliquid.hip3.freshness('km:US500');
|
|
415
422
|
```
|
|
416
423
|
|
|
417
|
-
### Summary
|
|
424
|
+
### Summary
|
|
418
425
|
|
|
419
426
|
Get a combined market snapshot in a single call -- mark/oracle price, funding rate, open interest, 24h volume, and 24h liquidation volumes.
|
|
420
427
|
|
|
421
428
|
```typescript
|
|
429
|
+
// Hyperliquid (includes volume + liquidation data)
|
|
422
430
|
const summary = await client.hyperliquid.summary('BTC');
|
|
423
431
|
console.log(`Mark price: ${summary.markPrice}`);
|
|
424
432
|
console.log(`Oracle price: ${summary.oraclePrice}`);
|
|
@@ -428,14 +436,21 @@ console.log(`24h volume: ${summary.volume24h}`);
|
|
|
428
436
|
console.log(`24h liquidation volume: $${summary.liquidationVolume24h}`);
|
|
429
437
|
console.log(` Long: $${summary.longLiquidationVolume24h}`);
|
|
430
438
|
console.log(` Short: $${summary.shortLiquidationVolume24h}`);
|
|
439
|
+
|
|
440
|
+
// Lighter.xyz (price, funding, OI — no volume/liquidation data)
|
|
441
|
+
const lighterSummary = await client.lighter.summary('BTC');
|
|
442
|
+
|
|
443
|
+
// HIP-3 (includes mid_price — case-sensitive coins)
|
|
444
|
+
const hip3Summary = await client.hyperliquid.hip3.summary('km:US500');
|
|
445
|
+
console.log(`Mid price: ${hip3Summary.midPrice}`);
|
|
431
446
|
```
|
|
432
447
|
|
|
433
|
-
### Price History
|
|
448
|
+
### Price History
|
|
434
449
|
|
|
435
|
-
Get mark, oracle, and mid price history over time. Supports aggregation intervals. Data projected from open interest records
|
|
450
|
+
Get mark, oracle, and mid price history over time. Supports aggregation intervals. Data projected from open interest records.
|
|
436
451
|
|
|
437
452
|
```typescript
|
|
438
|
-
//
|
|
453
|
+
// Hyperliquid — available from May 2023
|
|
439
454
|
const prices = await client.hyperliquid.priceHistory('BTC', {
|
|
440
455
|
start: Date.now() - 86400000,
|
|
441
456
|
end: Date.now(),
|
|
@@ -446,6 +461,20 @@ for (const snapshot of prices.data) {
|
|
|
446
461
|
console.log(`${snapshot.timestamp}: mark=${snapshot.markPrice}, oracle=${snapshot.oraclePrice}, mid=${snapshot.midPrice}`);
|
|
447
462
|
}
|
|
448
463
|
|
|
464
|
+
// Lighter.xyz
|
|
465
|
+
const lighterPrices = await client.lighter.priceHistory('BTC', {
|
|
466
|
+
start: Date.now() - 86400000,
|
|
467
|
+
end: Date.now(),
|
|
468
|
+
interval: '1h'
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
// HIP-3 (case-sensitive coins)
|
|
472
|
+
const hip3Prices = await client.hyperliquid.hip3.priceHistory('km:US500', {
|
|
473
|
+
start: Date.now() - 86400000,
|
|
474
|
+
end: Date.now(),
|
|
475
|
+
interval: '1d'
|
|
476
|
+
});
|
|
477
|
+
|
|
449
478
|
// Paginate for larger ranges
|
|
450
479
|
let result = await client.hyperliquid.priceHistory('BTC', {
|
|
451
480
|
start: Date.now() - 86400000 * 30,
|
|
@@ -607,6 +636,110 @@ const client = new OxArchive({
|
|
|
607
636
|
});
|
|
608
637
|
```
|
|
609
638
|
|
|
639
|
+
### Web3 Authentication
|
|
640
|
+
|
|
641
|
+
Get API keys programmatically using an Ethereum wallet — no browser or email required.
|
|
642
|
+
|
|
643
|
+
#### Free Tier (SIWE)
|
|
644
|
+
|
|
645
|
+
```typescript
|
|
646
|
+
import { createWalletClient, http } from 'viem';
|
|
647
|
+
import { privateKeyToAccount } from 'viem/accounts';
|
|
648
|
+
import { mainnet } from 'viem/chains';
|
|
649
|
+
|
|
650
|
+
const account = privateKeyToAccount('0xYOUR_PRIVATE_KEY');
|
|
651
|
+
const walletClient = createWalletClient({ account, chain: mainnet, transport: http() });
|
|
652
|
+
|
|
653
|
+
// 1. Get SIWE challenge
|
|
654
|
+
const challenge = await client.web3.challenge(account.address);
|
|
655
|
+
|
|
656
|
+
// 2. Sign with personal_sign (EIP-191)
|
|
657
|
+
const signature = await walletClient.signMessage({ message: challenge.message });
|
|
658
|
+
|
|
659
|
+
// 3. Submit → receive API key
|
|
660
|
+
const result = await client.web3.signup(challenge.message, signature);
|
|
661
|
+
console.log(result.apiKey); // "0xa_..."
|
|
662
|
+
```
|
|
663
|
+
|
|
664
|
+
#### Paid Tier (x402 USDC on Base)
|
|
665
|
+
|
|
666
|
+
```typescript
|
|
667
|
+
import { createWalletClient, http, encodePacked } from 'viem';
|
|
668
|
+
import { privateKeyToAccount } from 'viem/accounts';
|
|
669
|
+
import { base } from 'viem/chains';
|
|
670
|
+
import crypto from 'crypto';
|
|
671
|
+
|
|
672
|
+
const account = privateKeyToAccount('0xYOUR_PRIVATE_KEY');
|
|
673
|
+
const walletClient = createWalletClient({ account, chain: base, transport: http() });
|
|
674
|
+
|
|
675
|
+
const USDC_ADDRESS = '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913';
|
|
676
|
+
|
|
677
|
+
// 1. Get pricing
|
|
678
|
+
const quote = await client.web3.subscribeQuote('build');
|
|
679
|
+
// quote.amount = "49000000" ($49 USDC), quote.payTo = "0x..."
|
|
680
|
+
|
|
681
|
+
// 2. Build & sign EIP-3009 transferWithAuthorization
|
|
682
|
+
const nonce = `0x${crypto.randomBytes(32).toString('hex')}` as `0x${string}`;
|
|
683
|
+
const validAfter = 0n;
|
|
684
|
+
const validBefore = BigInt(Math.floor(Date.now() / 1000) + 3600);
|
|
685
|
+
|
|
686
|
+
const signature = await walletClient.signTypedData({
|
|
687
|
+
domain: {
|
|
688
|
+
name: 'USD Coin',
|
|
689
|
+
version: '2',
|
|
690
|
+
chainId: 8453,
|
|
691
|
+
verifyingContract: USDC_ADDRESS,
|
|
692
|
+
},
|
|
693
|
+
types: {
|
|
694
|
+
TransferWithAuthorization: [
|
|
695
|
+
{ name: 'from', type: 'address' },
|
|
696
|
+
{ name: 'to', type: 'address' },
|
|
697
|
+
{ name: 'value', type: 'uint256' },
|
|
698
|
+
{ name: 'validAfter', type: 'uint256' },
|
|
699
|
+
{ name: 'validBefore', type: 'uint256' },
|
|
700
|
+
{ name: 'nonce', type: 'bytes32' },
|
|
701
|
+
],
|
|
702
|
+
},
|
|
703
|
+
primaryType: 'TransferWithAuthorization',
|
|
704
|
+
message: {
|
|
705
|
+
from: account.address,
|
|
706
|
+
to: quote.payTo as `0x${string}`,
|
|
707
|
+
value: BigInt(quote.amount),
|
|
708
|
+
validAfter,
|
|
709
|
+
validBefore,
|
|
710
|
+
nonce,
|
|
711
|
+
},
|
|
712
|
+
});
|
|
713
|
+
|
|
714
|
+
// 3. Build x402 payment envelope and base64-encode
|
|
715
|
+
const paymentPayload = btoa(JSON.stringify({
|
|
716
|
+
x402Version: 2,
|
|
717
|
+
payload: {
|
|
718
|
+
signature,
|
|
719
|
+
authorization: {
|
|
720
|
+
from: account.address,
|
|
721
|
+
to: quote.payTo,
|
|
722
|
+
value: quote.amount,
|
|
723
|
+
validAfter: '0',
|
|
724
|
+
validBefore: validBefore.toString(),
|
|
725
|
+
nonce,
|
|
726
|
+
},
|
|
727
|
+
},
|
|
728
|
+
}));
|
|
729
|
+
|
|
730
|
+
// 4. Submit payment → receive API key + subscription
|
|
731
|
+
const sub = await client.web3.subscribe('build', paymentPayload);
|
|
732
|
+
console.log(sub.apiKey, sub.tier, sub.expiresAt);
|
|
733
|
+
```
|
|
734
|
+
|
|
735
|
+
#### Key Management
|
|
736
|
+
|
|
737
|
+
```typescript
|
|
738
|
+
// List and revoke keys (requires a fresh SIWE signature)
|
|
739
|
+
const keys = await client.web3.listKeys(challenge.message, signature);
|
|
740
|
+
await client.web3.revokeKey(challenge.message, signature, keys.keys[0].id);
|
|
741
|
+
```
|
|
742
|
+
|
|
610
743
|
### Legacy API (Deprecated)
|
|
611
744
|
|
|
612
745
|
The following legacy methods are deprecated and will be removed in v2.0. They default to Hyperliquid data:
|
package/dist/index.d.mts
CHANGED
|
@@ -363,6 +363,8 @@ interface Candle {
|
|
|
363
363
|
interface CandleHistoryParams extends CursorPaginationParams {
|
|
364
364
|
/** Candle interval (default: 1h) */
|
|
365
365
|
interval?: CandleInterval;
|
|
366
|
+
/** Maximum number of results to return (default: 100, max: 10000 for candles) */
|
|
367
|
+
limit?: number;
|
|
366
368
|
}
|
|
367
369
|
/** Pre-aggregated liquidation volume bucket */
|
|
368
370
|
interface LiquidationVolume {
|
|
@@ -734,6 +736,77 @@ interface WsEventHandlers {
|
|
|
734
736
|
onMessage?: (message: WsServerMessage) => void;
|
|
735
737
|
onStateChange?: (state: WsConnectionState) => void;
|
|
736
738
|
}
|
|
739
|
+
/** SIWE challenge message returned by the challenge endpoint */
|
|
740
|
+
interface SiweChallenge {
|
|
741
|
+
/** The SIWE message to sign with personal_sign (EIP-191) */
|
|
742
|
+
message: string;
|
|
743
|
+
/** Single-use nonce (expires after 10 minutes) */
|
|
744
|
+
nonce: string;
|
|
745
|
+
}
|
|
746
|
+
/** Result of creating a free-tier account via wallet signature */
|
|
747
|
+
interface Web3SignupResult {
|
|
748
|
+
/** The generated API key */
|
|
749
|
+
apiKey: string;
|
|
750
|
+
/** Account tier (e.g., 'free') */
|
|
751
|
+
tier: string;
|
|
752
|
+
/** The wallet address that owns this key */
|
|
753
|
+
walletAddress: string;
|
|
754
|
+
}
|
|
755
|
+
/** An API key record returned by the keys endpoint */
|
|
756
|
+
interface Web3ApiKey {
|
|
757
|
+
/** Unique key ID (UUID) */
|
|
758
|
+
id: string;
|
|
759
|
+
/** Key name */
|
|
760
|
+
name: string;
|
|
761
|
+
/** First characters of the key for identification */
|
|
762
|
+
keyPrefix: string;
|
|
763
|
+
/** Whether the key is currently active */
|
|
764
|
+
isActive: boolean;
|
|
765
|
+
/** Last usage timestamp (ISO 8601) */
|
|
766
|
+
lastUsedAt?: string;
|
|
767
|
+
/** Creation timestamp (ISO 8601) */
|
|
768
|
+
createdAt: string;
|
|
769
|
+
}
|
|
770
|
+
/** List of API keys for a wallet */
|
|
771
|
+
interface Web3KeysList {
|
|
772
|
+
/** All API keys belonging to this wallet */
|
|
773
|
+
keys: Web3ApiKey[];
|
|
774
|
+
/** The wallet address */
|
|
775
|
+
walletAddress: string;
|
|
776
|
+
}
|
|
777
|
+
/** Result of revoking an API key */
|
|
778
|
+
interface Web3RevokeResult {
|
|
779
|
+
/** Confirmation message */
|
|
780
|
+
message: string;
|
|
781
|
+
/** The wallet address that owned the key */
|
|
782
|
+
walletAddress: string;
|
|
783
|
+
}
|
|
784
|
+
/** x402 payment details returned by subscribe (402 response) */
|
|
785
|
+
interface Web3PaymentRequired {
|
|
786
|
+
/** Amount in smallest unit (e.g., "49000000" for $49 USDC) */
|
|
787
|
+
amount: string;
|
|
788
|
+
/** Payment asset (e.g., "USDC") */
|
|
789
|
+
asset: string;
|
|
790
|
+
/** Blockchain network (e.g., "base") */
|
|
791
|
+
network: string;
|
|
792
|
+
/** Address to send payment to */
|
|
793
|
+
payTo: string;
|
|
794
|
+
/** Token contract address */
|
|
795
|
+
assetAddress: string;
|
|
796
|
+
}
|
|
797
|
+
/** Result of a successful x402 subscription */
|
|
798
|
+
interface Web3SubscribeResult {
|
|
799
|
+
/** The generated API key */
|
|
800
|
+
apiKey: string;
|
|
801
|
+
/** Subscription tier */
|
|
802
|
+
tier: string;
|
|
803
|
+
/** Expiration timestamp (ISO 8601) */
|
|
804
|
+
expiresAt: string;
|
|
805
|
+
/** The wallet address that owns the subscription */
|
|
806
|
+
walletAddress: string;
|
|
807
|
+
/** On-chain transaction hash */
|
|
808
|
+
txHash?: string;
|
|
809
|
+
}
|
|
737
810
|
/**
|
|
738
811
|
* API error response
|
|
739
812
|
*/
|
|
@@ -1049,6 +1122,10 @@ declare class HttpClient {
|
|
|
1049
1122
|
constructor(options: HttpClientOptions);
|
|
1050
1123
|
/** Whether validation is enabled */
|
|
1051
1124
|
get validationEnabled(): boolean;
|
|
1125
|
+
/** Base URL for raw requests (used by web3 subscribe) */
|
|
1126
|
+
getBaseUrl(): string;
|
|
1127
|
+
/** Timeout in ms for raw requests (used by web3 subscribe) */
|
|
1128
|
+
getTimeout(): number;
|
|
1052
1129
|
/**
|
|
1053
1130
|
* Make a GET request to the API
|
|
1054
1131
|
*
|
|
@@ -1057,6 +1134,14 @@ declare class HttpClient {
|
|
|
1057
1134
|
* @param schema - Optional Zod schema for validation (used when validation is enabled)
|
|
1058
1135
|
*/
|
|
1059
1136
|
get<T>(path: string, params?: Record<string, unknown>, schema?: z.ZodType<T>): Promise<T>;
|
|
1137
|
+
/**
|
|
1138
|
+
* Make a POST request to the API
|
|
1139
|
+
*
|
|
1140
|
+
* @param path - API endpoint path
|
|
1141
|
+
* @param body - JSON request body
|
|
1142
|
+
* @param schema - Optional Zod schema for validation (used when validation is enabled)
|
|
1143
|
+
*/
|
|
1144
|
+
post<T>(path: string, body?: Record<string, unknown>, schema?: z.ZodType<T>): Promise<T>;
|
|
1060
1145
|
}
|
|
1061
1146
|
|
|
1062
1147
|
/**
|
|
@@ -1695,7 +1780,7 @@ declare class OpenInterestResource {
|
|
|
1695
1780
|
* start: Date.now() - 86400000,
|
|
1696
1781
|
* end: Date.now(),
|
|
1697
1782
|
* interval: '1h',
|
|
1698
|
-
* limit:
|
|
1783
|
+
* limit: 10000
|
|
1699
1784
|
* });
|
|
1700
1785
|
*
|
|
1701
1786
|
* // Get all pages
|
|
@@ -1706,7 +1791,7 @@ declare class OpenInterestResource {
|
|
|
1706
1791
|
* end: Date.now(),
|
|
1707
1792
|
* interval: '1h',
|
|
1708
1793
|
* cursor: result.nextCursor,
|
|
1709
|
-
* limit:
|
|
1794
|
+
* limit: 10000
|
|
1710
1795
|
* });
|
|
1711
1796
|
* allCandles.push(...result.data);
|
|
1712
1797
|
* }
|
|
@@ -1977,6 +2062,82 @@ declare class DataQualityResource {
|
|
|
1977
2062
|
sla(params?: SlaParams): Promise<SlaResponse>;
|
|
1978
2063
|
}
|
|
1979
2064
|
|
|
2065
|
+
/**
|
|
2066
|
+
* Wallet-based authentication: get API keys via SIWE signature.
|
|
2067
|
+
*
|
|
2068
|
+
* No API key is required for these endpoints. Use an Ethereum wallet to
|
|
2069
|
+
* create a free-tier account, list keys, or revoke keys — all programmatically.
|
|
2070
|
+
*
|
|
2071
|
+
* @example
|
|
2072
|
+
* ```typescript
|
|
2073
|
+
* const client = new OxArchive({ apiKey: 'placeholder' });
|
|
2074
|
+
*
|
|
2075
|
+
* // Step 1: Get a challenge
|
|
2076
|
+
* const challenge = await client.web3.challenge('0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18');
|
|
2077
|
+
*
|
|
2078
|
+
* // Step 2: Sign the message with your wallet, then submit
|
|
2079
|
+
* const result = await client.web3.signup(challenge.message, signature);
|
|
2080
|
+
* console.log(`API key: ${result.apiKey}`);
|
|
2081
|
+
* ```
|
|
2082
|
+
*/
|
|
2083
|
+
declare class Web3Resource {
|
|
2084
|
+
private http;
|
|
2085
|
+
constructor(http: HttpClient);
|
|
2086
|
+
/**
|
|
2087
|
+
* Get a SIWE challenge message to sign.
|
|
2088
|
+
*
|
|
2089
|
+
* @param address - Ethereum wallet address
|
|
2090
|
+
* @returns SIWE message and nonce. Sign the message with personal_sign (EIP-191).
|
|
2091
|
+
*/
|
|
2092
|
+
challenge(address: string): Promise<SiweChallenge>;
|
|
2093
|
+
/**
|
|
2094
|
+
* Create a free-tier account and get an API key.
|
|
2095
|
+
*
|
|
2096
|
+
* @param message - The SIWE message from {@link challenge}
|
|
2097
|
+
* @param signature - Hex-encoded signature from personal_sign
|
|
2098
|
+
* @returns API key, tier, and wallet address
|
|
2099
|
+
*/
|
|
2100
|
+
signup(message: string, signature: string): Promise<Web3SignupResult>;
|
|
2101
|
+
/**
|
|
2102
|
+
* List all API keys for the authenticated wallet.
|
|
2103
|
+
*
|
|
2104
|
+
* @param message - The SIWE message from {@link challenge}
|
|
2105
|
+
* @param signature - Hex-encoded signature from personal_sign
|
|
2106
|
+
* @returns List of API keys and wallet address
|
|
2107
|
+
*/
|
|
2108
|
+
listKeys(message: string, signature: string): Promise<Web3KeysList>;
|
|
2109
|
+
/**
|
|
2110
|
+
* Revoke a specific API key.
|
|
2111
|
+
*
|
|
2112
|
+
* @param message - The SIWE message from {@link challenge}
|
|
2113
|
+
* @param signature - Hex-encoded signature from personal_sign
|
|
2114
|
+
* @param keyId - UUID of the key to revoke
|
|
2115
|
+
* @returns Confirmation message and wallet address
|
|
2116
|
+
*/
|
|
2117
|
+
revokeKey(message: string, signature: string, keyId: string): Promise<Web3RevokeResult>;
|
|
2118
|
+
/**
|
|
2119
|
+
* Get pricing info for a paid subscription (x402 flow, step 1).
|
|
2120
|
+
*
|
|
2121
|
+
* Returns the payment details needed to sign a USDC transfer on Base.
|
|
2122
|
+
* After signing, pass the payment signature to {@link subscribe}.
|
|
2123
|
+
*
|
|
2124
|
+
* @param tier - Subscription tier: 'build' ($49/mo) or 'pro' ($199/mo)
|
|
2125
|
+
* @returns Payment details (amount, asset, network, pay-to address)
|
|
2126
|
+
*/
|
|
2127
|
+
subscribeQuote(tier: 'build' | 'pro'): Promise<Web3PaymentRequired>;
|
|
2128
|
+
/**
|
|
2129
|
+
* Complete a paid subscription with a signed x402 payment (step 2).
|
|
2130
|
+
*
|
|
2131
|
+
* Requires a payment signature from signing a USDC transfer (EIP-3009)
|
|
2132
|
+
* for the amount returned by {@link subscribeQuote}.
|
|
2133
|
+
*
|
|
2134
|
+
* @param tier - Subscription tier: 'build' or 'pro'
|
|
2135
|
+
* @param paymentSignature - Signed x402 payment (from EIP-3009 USDC transfer on Base)
|
|
2136
|
+
* @returns API key, tier, expiration, and wallet address
|
|
2137
|
+
*/
|
|
2138
|
+
subscribe(tier: 'build' | 'pro', paymentSignature: string): Promise<Web3SubscribeResult>;
|
|
2139
|
+
}
|
|
2140
|
+
|
|
1980
2141
|
/**
|
|
1981
2142
|
* Hyperliquid exchange client
|
|
1982
2143
|
*
|
|
@@ -2085,7 +2246,30 @@ declare class Hip3Client {
|
|
|
2085
2246
|
* OHLCV candle data
|
|
2086
2247
|
*/
|
|
2087
2248
|
readonly candles: CandlesResource;
|
|
2249
|
+
private http;
|
|
2088
2250
|
constructor(http: HttpClient);
|
|
2251
|
+
/**
|
|
2252
|
+
* Get per-coin data freshness across all data types
|
|
2253
|
+
*
|
|
2254
|
+
* @param coin - The coin symbol (case-sensitive, e.g., 'km:US500')
|
|
2255
|
+
* @returns Per-coin freshness with last_updated and lag_ms for each data type
|
|
2256
|
+
*/
|
|
2257
|
+
freshness(coin: string): Promise<CoinFreshness>;
|
|
2258
|
+
/**
|
|
2259
|
+
* Get combined market summary (price, funding, OI) in one call
|
|
2260
|
+
*
|
|
2261
|
+
* @param coin - The coin symbol (case-sensitive, e.g., 'km:US500')
|
|
2262
|
+
* @returns Combined market summary
|
|
2263
|
+
*/
|
|
2264
|
+
summary(coin: string): Promise<CoinSummary>;
|
|
2265
|
+
/**
|
|
2266
|
+
* Get mark/oracle/mid price history (projected from OI data)
|
|
2267
|
+
*
|
|
2268
|
+
* @param coin - The coin symbol (case-sensitive, e.g., 'km:US500')
|
|
2269
|
+
* @param params - Time range, cursor, and interval parameters
|
|
2270
|
+
* @returns CursorResponse with price snapshots
|
|
2271
|
+
*/
|
|
2272
|
+
priceHistory(coin: string, params: PriceHistoryParams): Promise<CursorResponse<PriceSnapshot[]>>;
|
|
2089
2273
|
}
|
|
2090
2274
|
/**
|
|
2091
2275
|
* Lighter.xyz exchange client
|
|
@@ -2126,7 +2310,30 @@ declare class LighterClient {
|
|
|
2126
2310
|
* OHLCV candle data
|
|
2127
2311
|
*/
|
|
2128
2312
|
readonly candles: CandlesResource;
|
|
2313
|
+
private http;
|
|
2129
2314
|
constructor(http: HttpClient);
|
|
2315
|
+
/**
|
|
2316
|
+
* Get per-coin data freshness across all data types
|
|
2317
|
+
*
|
|
2318
|
+
* @param coin - The coin symbol (e.g., 'BTC', 'ETH')
|
|
2319
|
+
* @returns Per-coin freshness with last_updated and lag_ms for each data type
|
|
2320
|
+
*/
|
|
2321
|
+
freshness(coin: string): Promise<CoinFreshness>;
|
|
2322
|
+
/**
|
|
2323
|
+
* Get combined market summary (price, funding, OI) in one call
|
|
2324
|
+
*
|
|
2325
|
+
* @param coin - The coin symbol (e.g., 'BTC', 'ETH')
|
|
2326
|
+
* @returns Combined market summary
|
|
2327
|
+
*/
|
|
2328
|
+
summary(coin: string): Promise<CoinSummary>;
|
|
2329
|
+
/**
|
|
2330
|
+
* Get mark/oracle price history (projected from OI data)
|
|
2331
|
+
*
|
|
2332
|
+
* @param coin - The coin symbol (e.g., 'BTC', 'ETH')
|
|
2333
|
+
* @param params - Time range, cursor, and interval parameters
|
|
2334
|
+
* @returns CursorResponse with price snapshots
|
|
2335
|
+
*/
|
|
2336
|
+
priceHistory(coin: string, params: PriceHistoryParams): Promise<CursorResponse<PriceSnapshot[]>>;
|
|
2130
2337
|
}
|
|
2131
2338
|
|
|
2132
2339
|
/**
|
|
@@ -2180,6 +2387,10 @@ declare class OxArchive {
|
|
|
2180
2387
|
* Data quality metrics: status, coverage, incidents, latency, SLA
|
|
2181
2388
|
*/
|
|
2182
2389
|
readonly dataQuality: DataQualityResource;
|
|
2390
|
+
/**
|
|
2391
|
+
* Wallet-based auth: get API keys via SIWE signature
|
|
2392
|
+
*/
|
|
2393
|
+
readonly web3: Web3Resource;
|
|
2183
2394
|
/**
|
|
2184
2395
|
* @deprecated Use client.hyperliquid.orderbook instead
|
|
2185
2396
|
*/
|
|
@@ -5032,4 +5243,4 @@ type ValidatedCandle = z.infer<typeof CandleSchema>;
|
|
|
5032
5243
|
type ValidatedLiquidation = z.infer<typeof LiquidationSchema>;
|
|
5033
5244
|
type ValidatedWsServerMessage = z.infer<typeof WsServerMessageSchema>;
|
|
5034
5245
|
|
|
5035
|
-
export { type ApiError, type ApiMeta, ApiMetaSchema, type ApiResponse, ApiResponseSchema, type Candle, CandleArrayResponseSchema, type CandleHistoryParams, type CandleInterval, CandleIntervalSchema, CandleSchema, type ClientOptions, type CoinFreshness, CoinFreshnessResponseSchema, CoinFreshnessSchema, type CoinSummary, CoinSummaryResponseSchema, CoinSummarySchema, type CompletenessMetrics, type CoverageGap, type CoverageResponse, type CursorResponse, type DataCadence, type DataFreshness, type DataTypeCoverage, type DataTypeFreshnessInfo, DataTypeFreshnessInfoSchema, type DataTypeStatus, type ExchangeCoverage, type ExchangeLatency, type ExchangeStatus, type FundingHistoryParams, type FundingRate, FundingRateArrayResponseSchema, FundingRateResponseSchema, FundingRateSchema, type GetOrderBookParams, type GetTradesCursorParams, Hip3Client, type Hip3Instrument, HyperliquidClient, type Incident, type IncidentSeverityValue, type IncidentStatusValue, type IncidentsResponse, type Instrument, InstrumentArrayResponseSchema, InstrumentResponseSchema, InstrumentSchema, type InstrumentType, InstrumentTypeSchema, type LatencyResponse, LighterClient, type LighterGranularity, type LighterInstrument, type Liquidation, LiquidationArrayResponseSchema, type LiquidationHistoryParams, LiquidationSchema, LiquidationSideSchema, type LiquidationVolume, LiquidationVolumeArrayResponseSchema, type LiquidationVolumeParams, LiquidationVolumeSchema, type LiquidationsByUserParams, type ListIncidentsParams, type OiFundingInterval, type OpenInterest, OpenInterestArrayResponseSchema, type OpenInterestHistoryParams, OpenInterestResponseSchema, OpenInterestSchema, type OrderBook, OrderBookArrayResponseSchema, type OrderBookHistoryParams, OrderBookReconstructor, OrderBookResponseSchema, OrderBookSchema, type OrderbookDelta, OxArchive, OxArchiveError, OxArchiveWs, type Pagination, type PriceHistoryParams, type PriceLevel, PriceLevelSchema, type PriceSnapshot, PriceSnapshotArrayResponseSchema, PriceSnapshotSchema, type ReconstructOptions, type ReconstructedOrderBook, type RestApiLatency, type SlaActual, type SlaParams, type SlaResponse, type SlaTargets, type StatusResponse, type SymbolCoverageOptions, type SymbolCoverageResponse, type SymbolDataTypeCoverage, type SystemStatusValue, type TickData, type TickHistoryParams, type Timestamp, type TimestampedRecord, TimestampedRecordSchema, type Trade, TradeArrayResponseSchema, type TradeDirection, TradeDirectionSchema, TradeSchema, type TradeSide, TradeSideSchema, type ValidatedApiMeta, type ValidatedCandle, type ValidatedFundingRate, type ValidatedInstrument, type ValidatedLiquidation, type ValidatedOpenInterest, type ValidatedOrderBook, type ValidatedPriceLevel, type ValidatedTrade, type ValidatedWsServerMessage, type WebSocketLatency, type WsChannel, WsChannelSchema, type WsClientMessage, type WsConnectionState, WsConnectionStateSchema, type WsData, WsDataSchema, type WsError, WsErrorSchema, type WsEventHandlers, type WsGapDetected, type WsHistoricalBatch, WsHistoricalBatchSchema, type WsHistoricalData, WsHistoricalDataSchema, type WsHistoricalTickData, type WsOptions, type WsPing, type WsPong, WsPongSchema, type WsReplay, type WsReplayCompleted, WsReplayCompletedSchema, type WsReplayPause, type WsReplayPaused, WsReplayPausedSchema, type WsReplayResume, type WsReplayResumed, WsReplayResumedSchema, type WsReplaySeek, type WsReplaySnapshot, WsReplaySnapshotSchema, type WsReplayStarted, WsReplayStartedSchema, type WsReplayStop, type WsReplayStopped, WsReplayStoppedSchema, type WsServerMessage, WsServerMessageSchema, type WsStream, type WsStreamCompleted, WsStreamCompletedSchema, type WsStreamProgress, WsStreamProgressSchema, type WsStreamStarted, WsStreamStartedSchema, type WsStreamStop, type WsStreamStopped, WsStreamStoppedSchema, type WsSubscribe, type WsSubscribed, WsSubscribedSchema, type WsUnsubscribe, type WsUnsubscribed, WsUnsubscribedSchema, OxArchive as default, reconstructFinal, reconstructOrderBook };
|
|
5246
|
+
export { type ApiError, type ApiMeta, ApiMetaSchema, type ApiResponse, ApiResponseSchema, type Candle, CandleArrayResponseSchema, type CandleHistoryParams, type CandleInterval, CandleIntervalSchema, CandleSchema, type ClientOptions, type CoinFreshness, CoinFreshnessResponseSchema, CoinFreshnessSchema, type CoinSummary, CoinSummaryResponseSchema, CoinSummarySchema, type CompletenessMetrics, type CoverageGap, type CoverageResponse, type CursorResponse, type DataCadence, type DataFreshness, type DataTypeCoverage, type DataTypeFreshnessInfo, DataTypeFreshnessInfoSchema, type DataTypeStatus, type ExchangeCoverage, type ExchangeLatency, type ExchangeStatus, type FundingHistoryParams, type FundingRate, FundingRateArrayResponseSchema, FundingRateResponseSchema, FundingRateSchema, type GetOrderBookParams, type GetTradesCursorParams, Hip3Client, type Hip3Instrument, HyperliquidClient, type Incident, type IncidentSeverityValue, type IncidentStatusValue, type IncidentsResponse, type Instrument, InstrumentArrayResponseSchema, InstrumentResponseSchema, InstrumentSchema, type InstrumentType, InstrumentTypeSchema, type LatencyResponse, LighterClient, type LighterGranularity, type LighterInstrument, type Liquidation, LiquidationArrayResponseSchema, type LiquidationHistoryParams, LiquidationSchema, LiquidationSideSchema, type LiquidationVolume, LiquidationVolumeArrayResponseSchema, type LiquidationVolumeParams, LiquidationVolumeSchema, type LiquidationsByUserParams, type ListIncidentsParams, type OiFundingInterval, type OpenInterest, OpenInterestArrayResponseSchema, type OpenInterestHistoryParams, OpenInterestResponseSchema, OpenInterestSchema, type OrderBook, OrderBookArrayResponseSchema, type OrderBookHistoryParams, OrderBookReconstructor, OrderBookResponseSchema, OrderBookSchema, type OrderbookDelta, OxArchive, OxArchiveError, OxArchiveWs, type Pagination, type PriceHistoryParams, type PriceLevel, PriceLevelSchema, type PriceSnapshot, PriceSnapshotArrayResponseSchema, PriceSnapshotSchema, type ReconstructOptions, type ReconstructedOrderBook, type RestApiLatency, type SiweChallenge, type SlaActual, type SlaParams, type SlaResponse, type SlaTargets, type StatusResponse, type SymbolCoverageOptions, type SymbolCoverageResponse, type SymbolDataTypeCoverage, type SystemStatusValue, type TickData, type TickHistoryParams, type Timestamp, type TimestampedRecord, TimestampedRecordSchema, type Trade, TradeArrayResponseSchema, type TradeDirection, TradeDirectionSchema, TradeSchema, type TradeSide, TradeSideSchema, type ValidatedApiMeta, type ValidatedCandle, type ValidatedFundingRate, type ValidatedInstrument, type ValidatedLiquidation, type ValidatedOpenInterest, type ValidatedOrderBook, type ValidatedPriceLevel, type ValidatedTrade, type ValidatedWsServerMessage, type Web3ApiKey, type Web3KeysList, type Web3PaymentRequired, type Web3RevokeResult, type Web3SignupResult, type Web3SubscribeResult, type WebSocketLatency, type WsChannel, WsChannelSchema, type WsClientMessage, type WsConnectionState, WsConnectionStateSchema, type WsData, WsDataSchema, type WsError, WsErrorSchema, type WsEventHandlers, type WsGapDetected, type WsHistoricalBatch, WsHistoricalBatchSchema, type WsHistoricalData, WsHistoricalDataSchema, type WsHistoricalTickData, type WsOptions, type WsPing, type WsPong, WsPongSchema, type WsReplay, type WsReplayCompleted, WsReplayCompletedSchema, type WsReplayPause, type WsReplayPaused, WsReplayPausedSchema, type WsReplayResume, type WsReplayResumed, WsReplayResumedSchema, type WsReplaySeek, type WsReplaySnapshot, WsReplaySnapshotSchema, type WsReplayStarted, WsReplayStartedSchema, type WsReplayStop, type WsReplayStopped, WsReplayStoppedSchema, type WsServerMessage, WsServerMessageSchema, type WsStream, type WsStreamCompleted, WsStreamCompletedSchema, type WsStreamProgress, WsStreamProgressSchema, type WsStreamStarted, WsStreamStartedSchema, type WsStreamStop, type WsStreamStopped, WsStreamStoppedSchema, type WsSubscribe, type WsSubscribed, WsSubscribedSchema, type WsUnsubscribe, type WsUnsubscribed, WsUnsubscribedSchema, OxArchive as default, reconstructFinal, reconstructOrderBook };
|