txflow-sdk 0.2.2 → 0.2.4
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 +10 -2
- package/dist/client.d.ts +8 -5
- package/dist/client.js +16 -2
- package/package.json +1 -5
package/README.md
CHANGED
|
@@ -206,10 +206,18 @@ const candles = await client.getCandleSnapshot({
|
|
|
206
206
|
endTime: Date.now(),
|
|
207
207
|
});
|
|
208
208
|
const fees = await client.getUserFees("0xUSER_ADDRESS");
|
|
209
|
-
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### History
|
|
212
|
+
|
|
213
|
+
```typescript
|
|
214
|
+
const orderHistory = await client.getOrderHistory({
|
|
210
215
|
user: "0xUSER_ADDRESS",
|
|
211
|
-
startTime: Date.now() - 86400000,
|
|
216
|
+
startTime: Date.now() - 30 * 86400000,
|
|
212
217
|
});
|
|
218
|
+
const tradeHistory = await client.getTradeHistory("0xUSER_ADDRESS");
|
|
219
|
+
const fundingHistory = await client.getFundingHistory("0xUSER_ADDRESS");
|
|
220
|
+
const ledger = await client.getUserNonFundingLedgerUpdates("0xUSER_ADDRESS");
|
|
213
221
|
```
|
|
214
222
|
|
|
215
223
|
### Testnet Faucet
|
package/dist/client.d.ts
CHANGED
|
@@ -51,17 +51,20 @@ export declare class TxFlowClient {
|
|
|
51
51
|
reduceOnly: boolean;
|
|
52
52
|
}): Promise<InfoResponse>;
|
|
53
53
|
getUserState(user: string): Promise<InfoResponse>;
|
|
54
|
-
getFundingHistory(
|
|
55
|
-
user: string;
|
|
56
|
-
startTime: number;
|
|
57
|
-
endTime?: number;
|
|
58
|
-
}): Promise<InfoResponse>;
|
|
54
|
+
getFundingHistory(user: string): Promise<InfoResponse>;
|
|
59
55
|
getUserFees(user: string): Promise<InfoResponse>;
|
|
60
56
|
getReferral(user: string): Promise<InfoResponse>;
|
|
61
57
|
getPerpMeta(dex?: string): Promise<InfoResponse>;
|
|
62
58
|
getSpotMeta(dex?: string): Promise<InfoResponse>;
|
|
63
59
|
getActiveAssetData(user: string, coin: string): Promise<InfoResponse>;
|
|
64
60
|
getL2Book(coin: string | number): Promise<InfoResponse>;
|
|
61
|
+
getOrderHistory(params: {
|
|
62
|
+
user: string;
|
|
63
|
+
startTime: number;
|
|
64
|
+
endTime?: number;
|
|
65
|
+
}): Promise<InfoResponse>;
|
|
66
|
+
getTradeHistory(user: string): Promise<InfoResponse>;
|
|
67
|
+
getUserNonFundingLedgerUpdates(user: string): Promise<InfoResponse>;
|
|
65
68
|
getCandleSnapshot(params: {
|
|
66
69
|
coin: string;
|
|
67
70
|
interval: string;
|
package/dist/client.js
CHANGED
|
@@ -344,8 +344,8 @@ export class TxFlowClient {
|
|
|
344
344
|
async getUserState(user) {
|
|
345
345
|
return this.postInfo({ type: "clearinghouseState", user });
|
|
346
346
|
}
|
|
347
|
-
async getFundingHistory(
|
|
348
|
-
return this.postInfo({ type: "
|
|
347
|
+
async getFundingHistory(user) {
|
|
348
|
+
return this.postInfo({ type: "userFundings", user });
|
|
349
349
|
}
|
|
350
350
|
async getUserFees(user) {
|
|
351
351
|
return this.postInfo({ type: "userfees", user });
|
|
@@ -365,6 +365,20 @@ export class TxFlowClient {
|
|
|
365
365
|
async getL2Book(coin) {
|
|
366
366
|
return this.postInfo({ type: "l2book", coin: String(coin) });
|
|
367
367
|
}
|
|
368
|
+
async getOrderHistory(params) {
|
|
369
|
+
return this.postInfo({
|
|
370
|
+
type: "historicalOrders",
|
|
371
|
+
user: params.user,
|
|
372
|
+
startTime: params.startTime,
|
|
373
|
+
endTime: params.endTime ?? Date.now(),
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
async getTradeHistory(user) {
|
|
377
|
+
return this.postInfo({ type: "userFills", user });
|
|
378
|
+
}
|
|
379
|
+
async getUserNonFundingLedgerUpdates(user) {
|
|
380
|
+
return this.postInfo({ type: "userNonFundingLedgerUpdates", user });
|
|
381
|
+
}
|
|
368
382
|
async getCandleSnapshot(params) {
|
|
369
383
|
return this.postInfo({ type: "candleSnapshot", ...params });
|
|
370
384
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "txflow-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "TypeScript SDK for TxFlow perpetual DEX with EIP-712 signing and MCP server",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -36,10 +36,6 @@
|
|
|
36
36
|
"futures"
|
|
37
37
|
],
|
|
38
38
|
"license": "MIT",
|
|
39
|
-
"repository": {
|
|
40
|
-
"type": "git",
|
|
41
|
-
"url": "https://gitlab.com/andy-vibecoding/txflow-sdk.git"
|
|
42
|
-
},
|
|
43
39
|
"dependencies": {
|
|
44
40
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
45
41
|
"@msgpack/msgpack": "^3.0.0-beta2",
|