@nktkas/hyperliquid 0.30.2 → 0.30.3
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 +83 -19
- package/esm/bin/cli.js +10 -0
- package/esm/bin/cli.js.map +1 -1
- package/esm/deps/jsr.io/@std/async/{1.0.16 → 1.1.0}/unstable_semaphore.d.ts +1 -0
- package/esm/deps/jsr.io/@std/async/1.1.0/unstable_semaphore.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/async/{1.0.16 → 1.1.0}/unstable_semaphore.js +4 -3
- package/esm/deps/jsr.io/@std/async/1.1.0/unstable_semaphore.js.map +1 -0
- package/esm/src/api/exchange/_methods/_base/_semaphore.js +1 -1
- package/esm/src/api/exchange/_methods/_base/_semaphore.js.map +1 -1
- package/esm/src/api/exchange/_methods/approveAgent.d.ts +20 -9
- package/esm/src/api/exchange/_methods/approveAgent.d.ts.map +1 -1
- package/esm/src/api/exchange/_methods/approveAgent.js +21 -3
- package/esm/src/api/exchange/_methods/approveAgent.js.map +1 -1
- package/esm/src/api/exchange/_methods/batchModify.d.ts +2 -2
- package/esm/src/api/exchange/_methods/borrowLend.d.ts +173 -0
- package/esm/src/api/exchange/_methods/borrowLend.d.ts.map +1 -0
- package/esm/src/api/exchange/_methods/borrowLend.js +75 -0
- package/esm/src/api/exchange/_methods/borrowLend.js.map +1 -0
- package/esm/src/api/exchange/_methods/modify.d.ts +2 -2
- package/esm/src/api/exchange/_methods/order.d.ts +2 -2
- package/esm/src/api/exchange/_methods/sendAsset.d.ts +10 -10
- package/esm/src/api/exchange/_methods/spotSend.d.ts +5 -5
- package/esm/src/api/exchange/_methods/usdSend.d.ts +5 -5
- package/esm/src/api/exchange/_methods/userPortfolioMargin.d.ts +193 -0
- package/esm/src/api/exchange/_methods/userPortfolioMargin.d.ts.map +1 -0
- package/esm/src/api/exchange/_methods/userPortfolioMargin.js +92 -0
- package/esm/src/api/exchange/_methods/userPortfolioMargin.js.map +1 -0
- package/esm/src/api/exchange/_methods/withdraw3.d.ts +5 -5
- package/esm/src/api/exchange/client.d.ts +8 -0
- package/esm/src/api/exchange/client.d.ts.map +1 -1
- package/esm/src/api/exchange/client.js +10 -0
- package/esm/src/api/exchange/client.js.map +1 -1
- package/esm/src/api/exchange/mod.d.ts +2 -0
- package/esm/src/api/exchange/mod.d.ts.map +1 -1
- package/esm/src/api/exchange/mod.js +2 -0
- package/esm/src/api/exchange/mod.js.map +1 -1
- package/esm/src/api/info/_methods/activeAssetData.js +2 -2
- package/esm/src/api/info/_methods/activeAssetData.js.map +1 -1
- package/esm/src/api/info/_methods/allBorrowLendReserveStates.d.ts +71 -0
- package/esm/src/api/info/_methods/allBorrowLendReserveStates.d.ts.map +1 -0
- package/esm/src/api/info/_methods/allBorrowLendReserveStates.js +56 -0
- package/esm/src/api/info/_methods/allBorrowLendReserveStates.js.map +1 -0
- package/esm/src/api/info/_methods/borrowLendReserveState.d.ts +79 -0
- package/esm/src/api/info/_methods/borrowLendReserveState.d.ts.map +1 -0
- package/esm/src/api/info/_methods/borrowLendReserveState.js +76 -0
- package/esm/src/api/info/_methods/borrowLendReserveState.js.map +1 -0
- package/esm/src/api/info/_methods/borrowLendUserState.d.ts +103 -0
- package/esm/src/api/info/_methods/borrowLendUserState.d.ts.map +1 -0
- package/esm/src/api/info/_methods/borrowLendUserState.js +85 -0
- package/esm/src/api/info/_methods/borrowLendUserState.js.map +1 -0
- package/esm/src/api/info/_methods/clearinghouseState.js +3 -3
- package/esm/src/api/info/_methods/clearinghouseState.js.map +1 -1
- package/esm/src/api/info/_methods/perpDexs.d.ts +5 -1
- package/esm/src/api/info/_methods/perpDexs.d.ts.map +1 -1
- package/esm/src/api/info/_methods/perpDexs.js +3 -1
- package/esm/src/api/info/_methods/perpDexs.js.map +1 -1
- package/esm/src/api/info/_methods/spotMeta.d.ts +36 -0
- package/esm/src/api/info/_methods/spotMeta.d.ts.map +1 -1
- package/esm/src/api/info/_methods/spotMeta.js +16 -0
- package/esm/src/api/info/_methods/spotMeta.js.map +1 -1
- package/esm/src/api/info/_methods/spotMetaAndAssetCtxs.d.ts +38 -0
- package/esm/src/api/info/_methods/spotMetaAndAssetCtxs.d.ts.map +1 -1
- package/esm/src/api/info/_methods/userBorrowLendInterest.d.ts +73 -0
- package/esm/src/api/info/_methods/userBorrowLendInterest.d.ts.map +1 -0
- package/esm/src/api/info/_methods/userBorrowLendInterest.js +72 -0
- package/esm/src/api/info/_methods/userBorrowLendInterest.js.map +1 -0
- package/esm/src/api/info/_methods/userNonFundingLedgerUpdates.d.ts +57 -0
- package/esm/src/api/info/_methods/userNonFundingLedgerUpdates.d.ts.map +1 -1
- package/esm/src/api/info/_methods/userNonFundingLedgerUpdates.js +33 -0
- package/esm/src/api/info/_methods/userNonFundingLedgerUpdates.js.map +1 -1
- package/esm/src/api/info/client.d.ts +16 -0
- package/esm/src/api/info/client.d.ts.map +1 -1
- package/esm/src/api/info/client.js +20 -0
- package/esm/src/api/info/client.js.map +1 -1
- package/esm/src/api/info/mod.d.ts +4 -0
- package/esm/src/api/info/mod.d.ts.map +1 -1
- package/esm/src/api/info/mod.js +4 -0
- package/esm/src/api/info/mod.js.map +1 -1
- package/esm/src/api/subscription/_methods/userNonFundingLedgerUpdates.d.ts +75 -0
- package/esm/src/api/subscription/_methods/userNonFundingLedgerUpdates.d.ts.map +1 -1
- package/package.json +1 -1
- package/script/bin/cli.js +10 -0
- package/script/bin/cli.js.map +1 -1
- package/script/deps/jsr.io/@std/async/{1.0.16 → 1.1.0}/unstable_semaphore.d.ts +1 -0
- package/script/deps/jsr.io/@std/async/1.1.0/unstable_semaphore.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/async/{1.0.16 → 1.1.0}/unstable_semaphore.js +4 -3
- package/script/deps/jsr.io/@std/async/1.1.0/unstable_semaphore.js.map +1 -0
- package/script/src/api/exchange/_methods/_base/_semaphore.js +1 -1
- package/script/src/api/exchange/_methods/_base/_semaphore.js.map +1 -1
- package/script/src/api/exchange/_methods/approveAgent.d.ts +20 -9
- package/script/src/api/exchange/_methods/approveAgent.d.ts.map +1 -1
- package/script/src/api/exchange/_methods/approveAgent.js +21 -3
- package/script/src/api/exchange/_methods/approveAgent.js.map +1 -1
- package/script/src/api/exchange/_methods/batchModify.d.ts +2 -2
- package/script/src/api/exchange/_methods/borrowLend.d.ts +173 -0
- package/script/src/api/exchange/_methods/borrowLend.d.ts.map +1 -0
- package/script/src/api/exchange/_methods/borrowLend.js +112 -0
- package/script/src/api/exchange/_methods/borrowLend.js.map +1 -0
- package/script/src/api/exchange/_methods/modify.d.ts +2 -2
- package/script/src/api/exchange/_methods/order.d.ts +2 -2
- package/script/src/api/exchange/_methods/sendAsset.d.ts +10 -10
- package/script/src/api/exchange/_methods/spotSend.d.ts +5 -5
- package/script/src/api/exchange/_methods/usdSend.d.ts +5 -5
- package/script/src/api/exchange/_methods/userPortfolioMargin.d.ts +193 -0
- package/script/src/api/exchange/_methods/userPortfolioMargin.d.ts.map +1 -0
- package/script/src/api/exchange/_methods/userPortfolioMargin.js +129 -0
- package/script/src/api/exchange/_methods/userPortfolioMargin.js.map +1 -0
- package/script/src/api/exchange/_methods/withdraw3.d.ts +5 -5
- package/script/src/api/exchange/client.d.ts +8 -0
- package/script/src/api/exchange/client.d.ts.map +1 -1
- package/script/src/api/exchange/client.js +10 -0
- package/script/src/api/exchange/client.js.map +1 -1
- package/script/src/api/exchange/mod.d.ts +2 -0
- package/script/src/api/exchange/mod.d.ts.map +1 -1
- package/script/src/api/exchange/mod.js +2 -0
- package/script/src/api/exchange/mod.js.map +1 -1
- package/script/src/api/info/_methods/activeAssetData.js +1 -1
- package/script/src/api/info/_methods/activeAssetData.js.map +1 -1
- package/script/src/api/info/_methods/allBorrowLendReserveStates.d.ts +71 -0
- package/script/src/api/info/_methods/allBorrowLendReserveStates.d.ts.map +1 -0
- package/script/src/api/info/_methods/allBorrowLendReserveStates.js +93 -0
- package/script/src/api/info/_methods/allBorrowLendReserveStates.js.map +1 -0
- package/script/src/api/info/_methods/borrowLendReserveState.d.ts +79 -0
- package/script/src/api/info/_methods/borrowLendReserveState.d.ts.map +1 -0
- package/script/src/api/info/_methods/borrowLendReserveState.js +113 -0
- package/script/src/api/info/_methods/borrowLendReserveState.js.map +1 -0
- package/script/src/api/info/_methods/borrowLendUserState.d.ts +103 -0
- package/script/src/api/info/_methods/borrowLendUserState.d.ts.map +1 -0
- package/script/src/api/info/_methods/borrowLendUserState.js +122 -0
- package/script/src/api/info/_methods/borrowLendUserState.js.map +1 -0
- package/script/src/api/info/_methods/clearinghouseState.js +3 -3
- package/script/src/api/info/_methods/clearinghouseState.js.map +1 -1
- package/script/src/api/info/_methods/perpDexs.d.ts +5 -1
- package/script/src/api/info/_methods/perpDexs.d.ts.map +1 -1
- package/script/src/api/info/_methods/perpDexs.js +3 -1
- package/script/src/api/info/_methods/perpDexs.js.map +1 -1
- package/script/src/api/info/_methods/spotMeta.d.ts +36 -0
- package/script/src/api/info/_methods/spotMeta.d.ts.map +1 -1
- package/script/src/api/info/_methods/spotMeta.js +16 -0
- package/script/src/api/info/_methods/spotMeta.js.map +1 -1
- package/script/src/api/info/_methods/spotMetaAndAssetCtxs.d.ts +38 -0
- package/script/src/api/info/_methods/spotMetaAndAssetCtxs.d.ts.map +1 -1
- package/script/src/api/info/_methods/userBorrowLendInterest.d.ts +73 -0
- package/script/src/api/info/_methods/userBorrowLendInterest.d.ts.map +1 -0
- package/script/src/api/info/_methods/userBorrowLendInterest.js +109 -0
- package/script/src/api/info/_methods/userBorrowLendInterest.js.map +1 -0
- package/script/src/api/info/_methods/userNonFundingLedgerUpdates.d.ts +57 -0
- package/script/src/api/info/_methods/userNonFundingLedgerUpdates.d.ts.map +1 -1
- package/script/src/api/info/_methods/userNonFundingLedgerUpdates.js +33 -0
- package/script/src/api/info/_methods/userNonFundingLedgerUpdates.js.map +1 -1
- package/script/src/api/info/client.d.ts +16 -0
- package/script/src/api/info/client.d.ts.map +1 -1
- package/script/src/api/info/client.js +20 -0
- package/script/src/api/info/client.js.map +1 -1
- package/script/src/api/info/mod.d.ts +4 -0
- package/script/src/api/info/mod.d.ts.map +1 -1
- package/script/src/api/info/mod.js +4 -0
- package/script/src/api/info/mod.js.map +1 -1
- package/script/src/api/subscription/_methods/userNonFundingLedgerUpdates.d.ts +75 -0
- package/script/src/api/subscription/_methods/userNonFundingLedgerUpdates.d.ts.map +1 -1
- package/src/bin/cli.ts +10 -0
- package/src/deps/jsr.io/@std/async/{1.0.16 → 1.1.0}/unstable_semaphore.ts +4 -3
- package/src/src/api/exchange/_methods/_base/_semaphore.ts +1 -1
- package/src/src/api/exchange/_methods/approveAgent.ts +25 -5
- package/src/src/api/exchange/_methods/borrowLend.ts +133 -0
- package/src/src/api/exchange/_methods/userPortfolioMargin.ts +156 -0
- package/src/src/api/exchange/client.ts +34 -0
- package/src/src/api/exchange/mod.ts +2 -0
- package/src/src/api/info/_methods/activeAssetData.ts +2 -2
- package/src/src/api/info/_methods/allBorrowLendReserveStates.ts +82 -0
- package/src/src/api/info/_methods/borrowLendReserveState.ts +131 -0
- package/src/src/api/info/_methods/borrowLendUserState.ts +144 -0
- package/src/src/api/info/_methods/clearinghouseState.ts +3 -3
- package/src/src/api/info/_methods/perpDexs.ts +6 -1
- package/src/src/api/info/_methods/spotMeta.ts +41 -0
- package/src/src/api/info/_methods/userBorrowLendInterest.ts +122 -0
- package/src/src/api/info/_methods/userNonFundingLedgerUpdates.ts +69 -0
- package/src/src/api/info/client.ts +60 -0
- package/src/src/api/info/mod.ts +4 -0
- package/esm/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.js.map +0 -1
- package/script/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.js.map +0 -1
|
@@ -125,6 +125,47 @@ export const SpotMetaResponse = /* @__PURE__ */ (() => {
|
|
|
125
125
|
),
|
|
126
126
|
v.description("Tokens available for spot trading."),
|
|
127
127
|
),
|
|
128
|
+
/** Outcome markets available for spot trading. */
|
|
129
|
+
outcomes: v.pipe(
|
|
130
|
+
v.array(
|
|
131
|
+
v.object({
|
|
132
|
+
/** Unique identifier of the outcome market. */
|
|
133
|
+
outcome: v.pipe(
|
|
134
|
+
UnsignedInteger,
|
|
135
|
+
v.description("Unique identifier of the outcome market."),
|
|
136
|
+
),
|
|
137
|
+
/** Short name of the outcome market. */
|
|
138
|
+
name: v.pipe(
|
|
139
|
+
v.string(),
|
|
140
|
+
v.description("Short name of the outcome market."),
|
|
141
|
+
),
|
|
142
|
+
/** Description of the outcome market. */
|
|
143
|
+
description: v.pipe(
|
|
144
|
+
v.string(),
|
|
145
|
+
v.description("Description of the outcome market."),
|
|
146
|
+
),
|
|
147
|
+
/** Token specifications for each side of the outcome market. */
|
|
148
|
+
sideSpecs: v.pipe(
|
|
149
|
+
v.array(
|
|
150
|
+
v.object({
|
|
151
|
+
/** Side name (e.g., "YES", "NO"). */
|
|
152
|
+
name: v.pipe(
|
|
153
|
+
v.string(),
|
|
154
|
+
v.description('Side name (e.g., "YES", "NO").'),
|
|
155
|
+
),
|
|
156
|
+
/** Spot token index corresponding to this side. */
|
|
157
|
+
token: v.pipe(
|
|
158
|
+
UnsignedInteger,
|
|
159
|
+
v.description("Spot token index corresponding to this side."),
|
|
160
|
+
),
|
|
161
|
+
}),
|
|
162
|
+
),
|
|
163
|
+
v.description("Token specifications for each side of the outcome market."),
|
|
164
|
+
),
|
|
165
|
+
}),
|
|
166
|
+
),
|
|
167
|
+
v.description("Outcome markets available for spot trading."),
|
|
168
|
+
),
|
|
128
169
|
}),
|
|
129
170
|
v.description("Metadata for spot assets."),
|
|
130
171
|
);
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
|
|
3
|
+
// ============================================================
|
|
4
|
+
// API Schemas
|
|
5
|
+
// ============================================================
|
|
6
|
+
|
|
7
|
+
import { Address, UnsignedDecimal, UnsignedInteger } from "../../_schemas.js";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Request user borrow/lend interest.
|
|
11
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-borrow-lend-user-state
|
|
12
|
+
*/
|
|
13
|
+
export const UserBorrowLendInterestRequest = /* @__PURE__ */ (() => {
|
|
14
|
+
return v.pipe(
|
|
15
|
+
v.object({
|
|
16
|
+
/** Type of request. */
|
|
17
|
+
type: v.pipe(
|
|
18
|
+
v.literal("userBorrowLendInterest"),
|
|
19
|
+
v.description("Type of request."),
|
|
20
|
+
),
|
|
21
|
+
/** User address. */
|
|
22
|
+
user: v.pipe(
|
|
23
|
+
Address,
|
|
24
|
+
v.description("User address."),
|
|
25
|
+
),
|
|
26
|
+
/** Start time (in ms since epoch). */
|
|
27
|
+
startTime: v.pipe(
|
|
28
|
+
UnsignedInteger,
|
|
29
|
+
v.description("Start time (in ms since epoch)."),
|
|
30
|
+
),
|
|
31
|
+
/** End time (in ms since epoch). */
|
|
32
|
+
endTime: v.pipe(
|
|
33
|
+
v.nullish(UnsignedInteger),
|
|
34
|
+
v.description("End time (in ms since epoch)."),
|
|
35
|
+
),
|
|
36
|
+
}),
|
|
37
|
+
v.description("Request user borrow/lend interest."),
|
|
38
|
+
);
|
|
39
|
+
})();
|
|
40
|
+
export type UserBorrowLendInterestRequest = v.InferOutput<typeof UserBorrowLendInterestRequest>;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* User's borrow/lend interest.
|
|
44
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-borrow-lend-user-state
|
|
45
|
+
*/
|
|
46
|
+
export const UserBorrowLendInterestResponse = /* @__PURE__ */ (() => {
|
|
47
|
+
return v.pipe(
|
|
48
|
+
v.array(
|
|
49
|
+
v.object({
|
|
50
|
+
/** Timestamp of the update (in ms since epoch). */
|
|
51
|
+
time: v.pipe(
|
|
52
|
+
UnsignedInteger,
|
|
53
|
+
v.description("Timestamp of the update (in ms since epoch)."),
|
|
54
|
+
),
|
|
55
|
+
/** Token symbol. */
|
|
56
|
+
token: v.pipe(
|
|
57
|
+
v.string(),
|
|
58
|
+
v.description("Token symbol."),
|
|
59
|
+
),
|
|
60
|
+
/** Borrow interest amount. */
|
|
61
|
+
borrow: v.pipe(
|
|
62
|
+
UnsignedDecimal,
|
|
63
|
+
v.description("Borrow interest amount."),
|
|
64
|
+
),
|
|
65
|
+
/** Supply interest amount. */
|
|
66
|
+
supply: v.pipe(
|
|
67
|
+
UnsignedDecimal,
|
|
68
|
+
v.description("Supply interest amount."),
|
|
69
|
+
),
|
|
70
|
+
}),
|
|
71
|
+
),
|
|
72
|
+
v.description("User's borrow/lend interest."),
|
|
73
|
+
);
|
|
74
|
+
})();
|
|
75
|
+
export type UserBorrowLendInterestResponse = v.InferOutput<typeof UserBorrowLendInterestResponse>;
|
|
76
|
+
// ============================================================
|
|
77
|
+
// Execution Logic
|
|
78
|
+
// ============================================================
|
|
79
|
+
|
|
80
|
+
import type { InfoConfig } from "./_base/types.js";
|
|
81
|
+
|
|
82
|
+
/** Request parameters for the {@linkcode userBorrowLendInterest} function. */
|
|
83
|
+
export type UserBorrowLendInterestParameters = Omit<v.InferInput<typeof UserBorrowLendInterestRequest>, "type">;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Request borrow/lend user interest.
|
|
87
|
+
*
|
|
88
|
+
* @param config - General configuration for Info API requests.
|
|
89
|
+
* @param params - Parameters specific to the API request.
|
|
90
|
+
* @param signal - {@link https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal | AbortSignal} to cancel the request.
|
|
91
|
+
*
|
|
92
|
+
* @returns User's borrow/lend interest.
|
|
93
|
+
*
|
|
94
|
+
* @throws {ValiError} When the request parameters fail validation (before sending).
|
|
95
|
+
* @throws {TransportError} When the transport layer throws an error.
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```ts
|
|
99
|
+
* import { HttpTransport } from "@nktkas/hyperliquid";
|
|
100
|
+
* import { userBorrowLendInterest } from "@nktkas/hyperliquid/api/info";
|
|
101
|
+
*
|
|
102
|
+
* const transport = new HttpTransport(); // or `WebSocketTransport`
|
|
103
|
+
*
|
|
104
|
+
* const data = await userBorrowLendInterest(
|
|
105
|
+
* { transport },
|
|
106
|
+
* { user: "0x...", startTime: 1725991229384 },
|
|
107
|
+
* );
|
|
108
|
+
* ```
|
|
109
|
+
*
|
|
110
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-borrow-lend-user-state
|
|
111
|
+
*/
|
|
112
|
+
export function userBorrowLendInterest(
|
|
113
|
+
config: InfoConfig,
|
|
114
|
+
params: UserBorrowLendInterestParameters,
|
|
115
|
+
signal?: AbortSignal,
|
|
116
|
+
): Promise<UserBorrowLendInterestResponse> {
|
|
117
|
+
const request = v.parse(UserBorrowLendInterestRequest, {
|
|
118
|
+
type: "userBorrowLendInterest",
|
|
119
|
+
...params,
|
|
120
|
+
});
|
|
121
|
+
return config.transport.request("info", request, signal);
|
|
122
|
+
}
|
|
@@ -484,6 +484,75 @@ export const UserNonFundingLedgerUpdatesResponse = /* @__PURE__ */ (() => {
|
|
|
484
484
|
v.description("`true` for deposit, `false` for withdrawal."),
|
|
485
485
|
),
|
|
486
486
|
}),
|
|
487
|
+
/** Borrow/lend operation update. */
|
|
488
|
+
v.object({
|
|
489
|
+
/** Update type. */
|
|
490
|
+
type: v.pipe(
|
|
491
|
+
v.literal("borrowLend"),
|
|
492
|
+
v.description("Update type."),
|
|
493
|
+
),
|
|
494
|
+
/** Token symbol. */
|
|
495
|
+
token: v.pipe(
|
|
496
|
+
v.string(),
|
|
497
|
+
v.description("Token symbol."),
|
|
498
|
+
),
|
|
499
|
+
/** Operation type. */
|
|
500
|
+
operation: v.pipe(
|
|
501
|
+
v.picklist(["supply", "withdraw", "repay", "borrow"]),
|
|
502
|
+
v.description("Operation type."),
|
|
503
|
+
),
|
|
504
|
+
/** Amount in the specified token. */
|
|
505
|
+
amount: v.pipe(
|
|
506
|
+
UnsignedDecimal,
|
|
507
|
+
v.description("Amount in the specified token."),
|
|
508
|
+
),
|
|
509
|
+
/** Interest amount in the specified token. */
|
|
510
|
+
interestAmount: v.pipe(
|
|
511
|
+
UnsignedDecimal,
|
|
512
|
+
v.description("Interest amount in the specified token."),
|
|
513
|
+
),
|
|
514
|
+
}),
|
|
515
|
+
/** Spot genesis operation update. */
|
|
516
|
+
v.object({
|
|
517
|
+
/** Update type. */
|
|
518
|
+
type: v.pipe(
|
|
519
|
+
v.literal("spotGenesis"),
|
|
520
|
+
v.description("Update type."),
|
|
521
|
+
),
|
|
522
|
+
/** Token symbol. */
|
|
523
|
+
token: v.pipe(
|
|
524
|
+
v.string(),
|
|
525
|
+
v.description("Token symbol."),
|
|
526
|
+
),
|
|
527
|
+
/** Amount in the specified token. */
|
|
528
|
+
amount: v.pipe(
|
|
529
|
+
Decimal,
|
|
530
|
+
v.description("Amount in the specified token."),
|
|
531
|
+
),
|
|
532
|
+
}),
|
|
533
|
+
/** Activate DEX abstraction update. */
|
|
534
|
+
v.object({
|
|
535
|
+
/** Update type. */
|
|
536
|
+
type: v.pipe(
|
|
537
|
+
v.literal("activateDexAbstraction"),
|
|
538
|
+
v.description("Update type."),
|
|
539
|
+
),
|
|
540
|
+
/** Name of the dex. */
|
|
541
|
+
dex: v.pipe(
|
|
542
|
+
v.string(),
|
|
543
|
+
v.description("Name of the dex."),
|
|
544
|
+
),
|
|
545
|
+
/** Token symbol. */
|
|
546
|
+
token: v.pipe(
|
|
547
|
+
v.string(),
|
|
548
|
+
v.description("Token symbol."),
|
|
549
|
+
),
|
|
550
|
+
/** Amount in the specified token. */
|
|
551
|
+
amount: v.pipe(
|
|
552
|
+
UnsignedDecimal,
|
|
553
|
+
v.description("Amount in the specified token."),
|
|
554
|
+
),
|
|
555
|
+
}),
|
|
487
556
|
]),
|
|
488
557
|
v.description("Update details."),
|
|
489
558
|
),
|
|
@@ -14,9 +14,23 @@ import {
|
|
|
14
14
|
type AlignedQuoteTokenInfoParameters,
|
|
15
15
|
type AlignedQuoteTokenInfoResponse,
|
|
16
16
|
} from "./_methods/alignedQuoteTokenInfo.js";
|
|
17
|
+
import {
|
|
18
|
+
allBorrowLendReserveStates,
|
|
19
|
+
type AllBorrowLendReserveStatesResponse,
|
|
20
|
+
} from "./_methods/allBorrowLendReserveStates.js";
|
|
17
21
|
import { allMids, type AllMidsParameters, type AllMidsResponse } from "./_methods/allMids.js";
|
|
18
22
|
import { allPerpMetas, type AllPerpMetasResponse } from "./_methods/allPerpMetas.js";
|
|
19
23
|
import { blockDetails, type BlockDetailsParameters, type BlockDetailsResponse } from "./_methods/blockDetails.js";
|
|
24
|
+
import {
|
|
25
|
+
borrowLendReserveState,
|
|
26
|
+
type BorrowLendReserveStateParameters,
|
|
27
|
+
type BorrowLendReserveStateResponse,
|
|
28
|
+
} from "./_methods/borrowLendReserveState.js";
|
|
29
|
+
import {
|
|
30
|
+
borrowLendUserState,
|
|
31
|
+
type BorrowLendUserStateParameters,
|
|
32
|
+
type BorrowLendUserStateResponse,
|
|
33
|
+
} from "./_methods/borrowLendUserState.js";
|
|
20
34
|
import {
|
|
21
35
|
candleSnapshot,
|
|
22
36
|
type CandleSnapshotParameters,
|
|
@@ -116,6 +130,11 @@ import { subAccounts2, type SubAccounts2Parameters, type SubAccounts2Response }
|
|
|
116
130
|
import { tokenDetails, type TokenDetailsParameters, type TokenDetailsResponse } from "./_methods/tokenDetails.js";
|
|
117
131
|
import { twapHistory, type TwapHistoryParameters, type TwapHistoryResponse } from "./_methods/twapHistory.js";
|
|
118
132
|
import { txDetails, type TxDetailsParameters, type TxDetailsResponse } from "./_methods/txDetails.js";
|
|
133
|
+
import {
|
|
134
|
+
userBorrowLendInterest,
|
|
135
|
+
type UserBorrowLendInterestParameters,
|
|
136
|
+
type UserBorrowLendInterestResponse,
|
|
137
|
+
} from "./_methods/userBorrowLendInterest.js";
|
|
119
138
|
import { userDetails, type UserDetailsParameters, type UserDetailsResponse } from "./_methods/userDetails.js";
|
|
120
139
|
import {
|
|
121
140
|
userDexAbstraction,
|
|
@@ -209,6 +228,13 @@ export class InfoClient<C extends InfoConfig = InfoConfig> {
|
|
|
209
228
|
return alignedQuoteTokenInfo(this.config_, params, signal);
|
|
210
229
|
}
|
|
211
230
|
|
|
231
|
+
/** @see {@link allBorrowLendReserveStates} */
|
|
232
|
+
allBorrowLendReserveStates(
|
|
233
|
+
signal?: AbortSignal,
|
|
234
|
+
): Promise<AllBorrowLendReserveStatesResponse> {
|
|
235
|
+
return allBorrowLendReserveStates(this.config_, signal);
|
|
236
|
+
}
|
|
237
|
+
|
|
212
238
|
/** @see {@link allMids} */
|
|
213
239
|
allMids(
|
|
214
240
|
params?: AllMidsParameters,
|
|
@@ -241,6 +267,22 @@ export class InfoClient<C extends InfoConfig = InfoConfig> {
|
|
|
241
267
|
return blockDetails(this.config_, params, signal);
|
|
242
268
|
}
|
|
243
269
|
|
|
270
|
+
/** @see {@link borrowLendReserveState} */
|
|
271
|
+
borrowLendReserveState(
|
|
272
|
+
params: BorrowLendReserveStateParameters,
|
|
273
|
+
signal?: AbortSignal,
|
|
274
|
+
): Promise<BorrowLendReserveStateResponse> {
|
|
275
|
+
return borrowLendReserveState(this.config_, params, signal);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/** @see {@link borrowLendUserState} */
|
|
279
|
+
borrowLendUserState(
|
|
280
|
+
params: BorrowLendUserStateParameters,
|
|
281
|
+
signal?: AbortSignal,
|
|
282
|
+
): Promise<BorrowLendUserStateResponse> {
|
|
283
|
+
return borrowLendUserState(this.config_, params, signal);
|
|
284
|
+
}
|
|
285
|
+
|
|
244
286
|
/** @see {@link candleSnapshot} */
|
|
245
287
|
candleSnapshot(
|
|
246
288
|
params: CandleSnapshotParameters,
|
|
@@ -610,6 +652,14 @@ export class InfoClient<C extends InfoConfig = InfoConfig> {
|
|
|
610
652
|
return txDetails(this.config_, params, signal);
|
|
611
653
|
}
|
|
612
654
|
|
|
655
|
+
/** @see {@link userBorrowLendInterest} */
|
|
656
|
+
userBorrowLendInterest(
|
|
657
|
+
params: UserBorrowLendInterestParameters,
|
|
658
|
+
signal?: AbortSignal,
|
|
659
|
+
): Promise<UserBorrowLendInterestResponse> {
|
|
660
|
+
return userBorrowLendInterest(this.config_, params, signal);
|
|
661
|
+
}
|
|
662
|
+
|
|
613
663
|
/** @see {@link userDetails} */
|
|
614
664
|
userDetails(
|
|
615
665
|
params: UserDetailsParameters,
|
|
@@ -763,9 +813,15 @@ export type {
|
|
|
763
813
|
AlignedQuoteTokenInfoParameters,
|
|
764
814
|
AlignedQuoteTokenInfoResponse,
|
|
765
815
|
} from "./_methods/alignedQuoteTokenInfo.js";
|
|
816
|
+
export type { AllBorrowLendReserveStatesResponse } from "./_methods/allBorrowLendReserveStates.js";
|
|
766
817
|
export type { AllMidsParameters, AllMidsResponse } from "./_methods/allMids.js";
|
|
767
818
|
export type { AllPerpMetasResponse } from "./_methods/allPerpMetas.js";
|
|
768
819
|
export type { BlockDetailsParameters, BlockDetailsResponse } from "./_methods/blockDetails.js";
|
|
820
|
+
export type {
|
|
821
|
+
BorrowLendReserveStateParameters,
|
|
822
|
+
BorrowLendReserveStateResponse,
|
|
823
|
+
} from "./_methods/borrowLendReserveState.js";
|
|
824
|
+
export type { BorrowLendUserStateParameters, BorrowLendUserStateResponse } from "./_methods/borrowLendUserState.js";
|
|
769
825
|
export type { CandleSnapshotParameters, CandleSnapshotResponse } from "./_methods/candleSnapshot.js";
|
|
770
826
|
export type { ClearinghouseStateParameters, ClearinghouseStateResponse } from "./_methods/clearinghouseState.js";
|
|
771
827
|
export type { DelegationsParameters, DelegationsResponse } from "./_methods/delegations.js";
|
|
@@ -816,6 +872,10 @@ export type { SubAccounts2Parameters, SubAccounts2Response } from "./_methods/su
|
|
|
816
872
|
export type { TokenDetailsParameters, TokenDetailsResponse } from "./_methods/tokenDetails.js";
|
|
817
873
|
export type { TwapHistoryParameters, TwapHistoryResponse } from "./_methods/twapHistory.js";
|
|
818
874
|
export type { TxDetailsParameters, TxDetailsResponse } from "./_methods/txDetails.js";
|
|
875
|
+
export type {
|
|
876
|
+
UserBorrowLendInterestParameters,
|
|
877
|
+
UserBorrowLendInterestResponse,
|
|
878
|
+
} from "./_methods/userBorrowLendInterest.js";
|
|
819
879
|
export type { UserDetailsParameters, UserDetailsResponse } from "./_methods/userDetails.js";
|
|
820
880
|
export type {
|
|
821
881
|
UserDexAbstractionParameters as UserDexAbstractionInfoParameters,
|
package/src/src/api/info/mod.ts
CHANGED
|
@@ -26,9 +26,12 @@ export type { InfoConfig } from "./_methods/_base/types.js";
|
|
|
26
26
|
|
|
27
27
|
export * from "./_methods/activeAssetData.js";
|
|
28
28
|
export * from "./_methods/alignedQuoteTokenInfo.js";
|
|
29
|
+
export * from "./_methods/allBorrowLendReserveStates.js";
|
|
29
30
|
export * from "./_methods/allMids.js";
|
|
30
31
|
export * from "./_methods/allPerpMetas.js";
|
|
31
32
|
export * from "./_methods/blockDetails.js";
|
|
33
|
+
export * from "./_methods/borrowLendReserveState.js";
|
|
34
|
+
export * from "./_methods/borrowLendUserState.js";
|
|
32
35
|
export * from "./_methods/candleSnapshot.js";
|
|
33
36
|
export * from "./_methods/clearinghouseState.js";
|
|
34
37
|
export * from "./_methods/delegations.js";
|
|
@@ -73,6 +76,7 @@ export * from "./_methods/subAccounts2.js";
|
|
|
73
76
|
export * from "./_methods/tokenDetails.js";
|
|
74
77
|
export * from "./_methods/twapHistory.js";
|
|
75
78
|
export * from "./_methods/txDetails.js";
|
|
79
|
+
export * from "./_methods/userBorrowLendInterest.js";
|
|
76
80
|
export * from "./_methods/userDetails.js";
|
|
77
81
|
export * from "./_methods/userDexAbstraction.js";
|
|
78
82
|
export * from "./_methods/userFees.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unstable_semaphore.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,SAAS;;IASpB;;;;OAIG;gBACS,GAAG,GAAE,MAAU;IAS3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC;IAgB9B;;;;;;;;;;;;;;;;;;OAkBG;IACH,UAAU,IAAI,UAAU,GAAG,SAAS;IAQpC;;;;;;;;;;;;;;;OAeG;IACH,OAAO,IAAI,IAAI;CAShB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unstable_semaphore.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,qCAAqC;AAQrC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,SAAS;IACpB,IAAI,CAAS;IACb,2CAA2C;IAC3C,MAAM,CAAS;IACf,iCAAiC;IACjC,KAAK,CAAmB;IACxB,iCAAiC;IACjC,KAAK,CAAmB;IAExB;;;;OAIG;IACH,YAAY,MAAc,CAAC;QACzB,IAAI,GAAG,GAAG,CAAC,EAAE,CAAC;YACZ,MAAM,IAAI,SAAS,CACjB,yEAAyE,GAAG,EAAE,CAC/E,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IAChC,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,OAAO;QACL,MAAM,UAAU,GAAe,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;QAC1E,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpB,IAAI,CAAC,MAAM,EAA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
|
|
1
|
-
{"version":3,"file":"unstable_semaphore.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,SAAS;;IASpB;;;;OAIG;gBACS,GAAG,GAAE,MAAU;IAS3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC;IAgB9B;;;;;;;;;;;;;;;;;;OAkBG;IACH,UAAU,IAAI,UAAU,GAAG,SAAS;IAQpC;;;;;;;;;;;;;;;OAeG;IACH,OAAO,IAAI,IAAI;CAShB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unstable_semaphore.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/async/1.0.16/unstable_semaphore.ts"],"names":[],"mappings":";AAAA,qDAAqD;AACrD,qCAAqC;;;AAQrC;;;;;;;;;;;;;;;GAeG;AACH,MAAa,SAAS;IACpB,IAAI,CAAS;IACb,2CAA2C;IAC3C,MAAM,CAAS;IACf,iCAAiC;IACjC,KAAK,CAAmB;IACxB,iCAAiC;IACjC,KAAK,CAAmB;IAExB;;;;OAIG;IACH,YAAY,MAAc,CAAC;QACzB,IAAI,GAAG,GAAG,CAAC,EAAE,CAAC;YACZ,MAAM,IAAI,SAAS,CACjB,yEAAyE,GAAG,EAAE,CAC/E,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IAChC,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,OAAO;QACL,MAAM,UAAU,GAAe,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;QAC1E,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpB,I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