ault-sdk-ts 0.0.2-alpha.7 → 0.0.2-alpha.8
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/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/ws/types.d.ts +17 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -18159,7 +18159,7 @@ function createDexWs(url, options) {
|
|
|
18159
18159
|
}
|
|
18160
18160
|
|
|
18161
18161
|
// src/index.ts
|
|
18162
|
-
var SDK_VERSION = "0.0.2-alpha.
|
|
18162
|
+
var SDK_VERSION = "0.0.2-alpha.8";
|
|
18163
18163
|
// Annotate the CommonJS export names for ESM import in node:
|
|
18164
18164
|
0 && (module.exports = {
|
|
18165
18165
|
AGENT_DEFAULTS,
|
package/dist/index.js
CHANGED
|
@@ -17888,7 +17888,7 @@ function createDexWs(url, options) {
|
|
|
17888
17888
|
}
|
|
17889
17889
|
|
|
17890
17890
|
// src/index.ts
|
|
17891
|
-
var SDK_VERSION = "0.0.2-alpha.
|
|
17891
|
+
var SDK_VERSION = "0.0.2-alpha.8";
|
|
17892
17892
|
export {
|
|
17893
17893
|
AGENT_DEFAULTS,
|
|
17894
17894
|
AULT_SIGNER_MARKER,
|
package/dist/ws/types.d.ts
CHANGED
|
@@ -24,7 +24,23 @@ export interface WsCommandResponse {
|
|
|
24
24
|
error?: string;
|
|
25
25
|
ttl?: number;
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Payload for the `chain:block` topic. Emitted once per new block regardless
|
|
29
|
+
* of market activity so subscribers can drive liveness indicators.
|
|
30
|
+
*
|
|
31
|
+
* The block header fields (hash, proposer, tx_count, gas_used, gas_wanted)
|
|
32
|
+
* are optional because older chain versions may not supply them.
|
|
33
|
+
*/
|
|
34
|
+
export interface BlockUpdate {
|
|
35
|
+
height: number;
|
|
36
|
+
timestamp: number;
|
|
37
|
+
hash?: string;
|
|
38
|
+
proposer?: string;
|
|
39
|
+
tx_count?: number;
|
|
40
|
+
gas_used?: number;
|
|
41
|
+
gas_wanted?: number;
|
|
42
|
+
}
|
|
43
|
+
export type PayloadFor<T extends string> = T extends `orderbook:${string}` ? OrderbookResponse : T extends `trades:${string}` ? TradeResponse[] : T extends `ticker:${string}` ? TickerResponse : T extends `chart:${string}` ? OHLCVEntry : T extends `orders:${string}` ? OrderResponse[] : T extends `balances:${string}` ? BalancesResponse : T extends `mytrades:${string}` ? TradeResponse[] : T extends "chain:block" ? BlockUpdate : unknown;
|
|
28
44
|
export interface SubscriptionHandlers<T> {
|
|
29
45
|
onData: (data: T, message: WsServerMessage<T>) => void;
|
|
30
46
|
onError?: (error: Error) => void;
|