@crypticdot/defituna-api 1.10.3 → 1.10.5
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.d.mts +105 -605
- package/dist/index.d.ts +105 -605
- package/dist/index.js +44 -48
- package/dist/index.mjs +44 -48
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -57,7 +57,6 @@ __export(schemas_exports, {
|
|
|
57
57
|
LendingPosition: () => LendingPosition,
|
|
58
58
|
LendingPositionNotification: () => LendingPositionNotification,
|
|
59
59
|
LimitOrder: () => LimitOrder,
|
|
60
|
-
LimitOrderNotification: () => LimitOrderNotification,
|
|
61
60
|
LimitOrderQuoteByInput: () => LimitOrderQuoteByInput,
|
|
62
61
|
LimitOrderQuoteByOutput: () => LimitOrderQuoteByOutput,
|
|
63
62
|
LimitOrderState: () => LimitOrderState,
|
|
@@ -92,7 +91,6 @@ __export(schemas_exports, {
|
|
|
92
91
|
Pool: () => Pool,
|
|
93
92
|
PoolPriceCandle: () => PoolPriceCandle,
|
|
94
93
|
PoolPriceUpdate: () => PoolPriceUpdate,
|
|
95
|
-
PoolPriceUpdateNotification: () => PoolPriceUpdateNotification,
|
|
96
94
|
PoolProvider: () => PoolProvider,
|
|
97
95
|
PoolProviderSchema: () => PoolProviderSchema,
|
|
98
96
|
PoolSubscriptionTopic: () => PoolSubscriptionTopic,
|
|
@@ -143,7 +141,6 @@ __export(schemas_exports, {
|
|
|
143
141
|
TunaLpPositionTransfer: () => TunaLpPositionTransfer,
|
|
144
142
|
TunaLpPositionValue: () => TunaLpPositionValue,
|
|
145
143
|
TunaPositionLegacy: () => TunaPositionLegacy,
|
|
146
|
-
TunaPositionNotification: () => TunaPositionNotification,
|
|
147
144
|
TunaPositionPoolSchema: () => TunaPositionPoolSchema,
|
|
148
145
|
TunaPositionPoolToken: () => TunaPositionPoolToken,
|
|
149
146
|
TunaPositionPoolTokenSchema: () => TunaPositionPoolTokenSchema,
|
|
@@ -151,7 +148,6 @@ __export(schemas_exports, {
|
|
|
151
148
|
TunaPositionStateSchema: () => TunaPositionStateSchema,
|
|
152
149
|
TunaPositionTokenPnlSchema: () => TunaPositionTokenPnlSchema,
|
|
153
150
|
TunaSpotPosition: () => TunaSpotPosition,
|
|
154
|
-
TunaSpotPositionNotification: () => TunaSpotPositionNotification,
|
|
155
151
|
TunaSpotPositionState: () => TunaSpotPositionState,
|
|
156
152
|
TunaSpotPositionStateSchema: () => TunaSpotPositionStateSchema,
|
|
157
153
|
UpdateStreamSubscriptionResult: () => UpdateStreamSubscriptionResult,
|
|
@@ -186,8 +182,36 @@ var PoolProvider = {
|
|
|
186
182
|
};
|
|
187
183
|
var PoolProviderSchema = import_zod.z.enum([PoolProvider.ORCA, ...Object.values(PoolProvider)]);
|
|
188
184
|
|
|
185
|
+
// src/client/schemas/state_snapshot.ts
|
|
186
|
+
var import_zod7 = __toESM(require("zod"));
|
|
187
|
+
|
|
189
188
|
// src/client/schemas/limit_orders.ts
|
|
189
|
+
var import_zod4 = require("zod");
|
|
190
|
+
|
|
191
|
+
// src/client/schemas/mint.ts
|
|
190
192
|
var import_zod2 = require("zod");
|
|
193
|
+
var Mint = import_zod2.z.object({
|
|
194
|
+
mint: import_zod2.z.string(),
|
|
195
|
+
symbol: import_zod2.z.string(),
|
|
196
|
+
name: import_zod2.z.string(),
|
|
197
|
+
logo: import_zod2.z.string(),
|
|
198
|
+
decimals: import_zod2.z.number()
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
// src/client/schemas/positions_shared.ts
|
|
202
|
+
var import_zod3 = __toESM(require("zod"));
|
|
203
|
+
var TunaPositionPoolSchema = import_zod3.default.object({
|
|
204
|
+
addr: import_zod3.default.string(),
|
|
205
|
+
price: import_zod3.default.number(),
|
|
206
|
+
tickSpacing: import_zod3.default.number()
|
|
207
|
+
});
|
|
208
|
+
var TunaPositionPoolToken = {
|
|
209
|
+
A: "a",
|
|
210
|
+
B: "b"
|
|
211
|
+
};
|
|
212
|
+
var TunaPositionPoolTokenSchema = import_zod3.default.enum(Object.values(TunaPositionPoolToken));
|
|
213
|
+
|
|
214
|
+
// src/client/schemas/limit_orders.ts
|
|
191
215
|
var LimitOrderState = {
|
|
192
216
|
OPEN: "open",
|
|
193
217
|
PARTIALLY_FILLED: "partially_filled",
|
|
@@ -195,50 +219,27 @@ var LimitOrderState = {
|
|
|
195
219
|
COMPLETE: "complete",
|
|
196
220
|
CANCELLED: "cancelled"
|
|
197
221
|
};
|
|
198
|
-
var LimitOrderStateSchema =
|
|
199
|
-
var LimitOrder =
|
|
200
|
-
address:
|
|
201
|
-
|
|
202
|
-
|
|
222
|
+
var LimitOrderStateSchema = import_zod4.z.enum([LimitOrderState.OPEN, ...Object.values(LimitOrderState)]);
|
|
223
|
+
var LimitOrder = import_zod4.z.object({
|
|
224
|
+
address: import_zod4.z.string(),
|
|
225
|
+
orderMint: import_zod4.z.string(),
|
|
226
|
+
mintA: Mint,
|
|
227
|
+
mintB: Mint,
|
|
228
|
+
pool: TunaPositionPoolSchema,
|
|
203
229
|
state: LimitOrderStateSchema,
|
|
204
|
-
aToB:
|
|
205
|
-
tickIndex:
|
|
206
|
-
fillRatio:
|
|
207
|
-
openTxSignature:
|
|
208
|
-
closeTxSignature:
|
|
230
|
+
aToB: import_zod4.z.boolean(),
|
|
231
|
+
tickIndex: import_zod4.z.number(),
|
|
232
|
+
fillRatio: import_zod4.z.number(),
|
|
233
|
+
openTxSignature: import_zod4.z.string(),
|
|
234
|
+
closeTxSignature: import_zod4.z.nullable(import_zod4.z.string()),
|
|
209
235
|
amountIn: AmountWithUsdSchema,
|
|
210
236
|
amountOut: AmountWithUsdSchema,
|
|
211
|
-
openedAt:
|
|
212
|
-
closedAt:
|
|
237
|
+
openedAt: import_zod4.z.coerce.date(),
|
|
238
|
+
closedAt: import_zod4.z.nullable(import_zod4.z.coerce.date())
|
|
213
239
|
});
|
|
214
240
|
|
|
215
241
|
// src/client/schemas/lp_positions.ts
|
|
216
242
|
var import_zod5 = __toESM(require("zod"));
|
|
217
|
-
|
|
218
|
-
// src/client/schemas/mint.ts
|
|
219
|
-
var import_zod3 = require("zod");
|
|
220
|
-
var Mint = import_zod3.z.object({
|
|
221
|
-
mint: import_zod3.z.string(),
|
|
222
|
-
symbol: import_zod3.z.string(),
|
|
223
|
-
name: import_zod3.z.string(),
|
|
224
|
-
logo: import_zod3.z.string(),
|
|
225
|
-
decimals: import_zod3.z.number()
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
// src/client/schemas/positions_shared.ts
|
|
229
|
-
var import_zod4 = __toESM(require("zod"));
|
|
230
|
-
var TunaPositionPoolSchema = import_zod4.default.object({
|
|
231
|
-
addr: import_zod4.default.string(),
|
|
232
|
-
price: import_zod4.default.number(),
|
|
233
|
-
tickSpacing: import_zod4.default.number()
|
|
234
|
-
});
|
|
235
|
-
var TunaPositionPoolToken = {
|
|
236
|
-
A: "a",
|
|
237
|
-
B: "b"
|
|
238
|
-
};
|
|
239
|
-
var TunaPositionPoolTokenSchema = import_zod4.default.enum(Object.values(TunaPositionPoolToken));
|
|
240
|
-
|
|
241
|
-
// src/client/schemas/lp_positions.ts
|
|
242
243
|
var LpPositionLimitOrderSwap = {
|
|
243
244
|
NO_SWAP: "no_swap",
|
|
244
245
|
SWAP_TO_TOKEN_A: "swap_to_token_a",
|
|
@@ -545,8 +546,8 @@ var TunaSpotPosition = import_zod6.z.object({
|
|
|
545
546
|
mintA: Mint,
|
|
546
547
|
mintB: Mint,
|
|
547
548
|
pool: TunaPositionPoolSchema,
|
|
548
|
-
positionToken:
|
|
549
|
-
collateralToken:
|
|
549
|
+
positionToken: TunaPositionPoolTokenSchema,
|
|
550
|
+
collateralToken: TunaPositionPoolTokenSchema,
|
|
550
551
|
marketMaker: PoolProviderSchema,
|
|
551
552
|
depositedCollateral: AmountWithUsdSchema,
|
|
552
553
|
initialDebt: AmountWithUsdSchema,
|
|
@@ -609,7 +610,6 @@ var CloseSpotPositionQuote = import_zod6.z.object({
|
|
|
609
610
|
});
|
|
610
611
|
|
|
611
612
|
// src/client/schemas/state_snapshot.ts
|
|
612
|
-
var import_zod7 = __toESM(require("zod"));
|
|
613
613
|
var PoolPriceUpdate = import_zod7.default.object({
|
|
614
614
|
pool: import_zod7.default.string(),
|
|
615
615
|
price: import_zod7.default.number(),
|
|
@@ -1057,12 +1057,8 @@ var OrderBookNotificationMeta = import_zod8.z.object({
|
|
|
1057
1057
|
inverted: import_zod8.z.boolean()
|
|
1058
1058
|
});
|
|
1059
1059
|
var PoolSwapNotification = createNotificationSchema(PoolSwap);
|
|
1060
|
-
var PoolPriceUpdateNotification = createNotificationSchema(PoolPriceUpdate);
|
|
1061
1060
|
var OrderBookNotification = createNotificationSchema(OrderBook, OrderBookNotificationMeta);
|
|
1062
|
-
var TunaPositionNotification = createNotificationSchema(TunaPositionLegacy);
|
|
1063
|
-
var TunaSpotPositionNotification = createNotificationSchema(TunaSpotPosition);
|
|
1064
1061
|
var LendingPositionNotification = createNotificationSchema(LendingPosition);
|
|
1065
|
-
var LimitOrderNotification = createNotificationSchema(LimitOrder);
|
|
1066
1062
|
var TradeHistoryEntryNotification = createNotificationSchema(TradeHistoryEntry);
|
|
1067
1063
|
var OrderHistoryEntryNotification = createNotificationSchema(OrderHistoryEntry);
|
|
1068
1064
|
var StakingPositionNotification = createNotificationSchema(StakingPosition);
|
package/dist/index.mjs
CHANGED
|
@@ -20,7 +20,6 @@ __export(schemas_exports, {
|
|
|
20
20
|
LendingPosition: () => LendingPosition,
|
|
21
21
|
LendingPositionNotification: () => LendingPositionNotification,
|
|
22
22
|
LimitOrder: () => LimitOrder,
|
|
23
|
-
LimitOrderNotification: () => LimitOrderNotification,
|
|
24
23
|
LimitOrderQuoteByInput: () => LimitOrderQuoteByInput,
|
|
25
24
|
LimitOrderQuoteByOutput: () => LimitOrderQuoteByOutput,
|
|
26
25
|
LimitOrderState: () => LimitOrderState,
|
|
@@ -55,7 +54,6 @@ __export(schemas_exports, {
|
|
|
55
54
|
Pool: () => Pool,
|
|
56
55
|
PoolPriceCandle: () => PoolPriceCandle,
|
|
57
56
|
PoolPriceUpdate: () => PoolPriceUpdate,
|
|
58
|
-
PoolPriceUpdateNotification: () => PoolPriceUpdateNotification,
|
|
59
57
|
PoolProvider: () => PoolProvider,
|
|
60
58
|
PoolProviderSchema: () => PoolProviderSchema,
|
|
61
59
|
PoolSubscriptionTopic: () => PoolSubscriptionTopic,
|
|
@@ -106,7 +104,6 @@ __export(schemas_exports, {
|
|
|
106
104
|
TunaLpPositionTransfer: () => TunaLpPositionTransfer,
|
|
107
105
|
TunaLpPositionValue: () => TunaLpPositionValue,
|
|
108
106
|
TunaPositionLegacy: () => TunaPositionLegacy,
|
|
109
|
-
TunaPositionNotification: () => TunaPositionNotification,
|
|
110
107
|
TunaPositionPoolSchema: () => TunaPositionPoolSchema,
|
|
111
108
|
TunaPositionPoolToken: () => TunaPositionPoolToken,
|
|
112
109
|
TunaPositionPoolTokenSchema: () => TunaPositionPoolTokenSchema,
|
|
@@ -114,7 +111,6 @@ __export(schemas_exports, {
|
|
|
114
111
|
TunaPositionStateSchema: () => TunaPositionStateSchema,
|
|
115
112
|
TunaPositionTokenPnlSchema: () => TunaPositionTokenPnlSchema,
|
|
116
113
|
TunaSpotPosition: () => TunaSpotPosition,
|
|
117
|
-
TunaSpotPositionNotification: () => TunaSpotPositionNotification,
|
|
118
114
|
TunaSpotPositionState: () => TunaSpotPositionState,
|
|
119
115
|
TunaSpotPositionStateSchema: () => TunaSpotPositionStateSchema,
|
|
120
116
|
UpdateStreamSubscriptionResult: () => UpdateStreamSubscriptionResult,
|
|
@@ -149,8 +145,36 @@ var PoolProvider = {
|
|
|
149
145
|
};
|
|
150
146
|
var PoolProviderSchema = z.enum([PoolProvider.ORCA, ...Object.values(PoolProvider)]);
|
|
151
147
|
|
|
148
|
+
// src/client/schemas/state_snapshot.ts
|
|
149
|
+
import z7 from "zod";
|
|
150
|
+
|
|
152
151
|
// src/client/schemas/limit_orders.ts
|
|
152
|
+
import { z as z4 } from "zod";
|
|
153
|
+
|
|
154
|
+
// src/client/schemas/mint.ts
|
|
153
155
|
import { z as z2 } from "zod";
|
|
156
|
+
var Mint = z2.object({
|
|
157
|
+
mint: z2.string(),
|
|
158
|
+
symbol: z2.string(),
|
|
159
|
+
name: z2.string(),
|
|
160
|
+
logo: z2.string(),
|
|
161
|
+
decimals: z2.number()
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
// src/client/schemas/positions_shared.ts
|
|
165
|
+
import z3 from "zod";
|
|
166
|
+
var TunaPositionPoolSchema = z3.object({
|
|
167
|
+
addr: z3.string(),
|
|
168
|
+
price: z3.number(),
|
|
169
|
+
tickSpacing: z3.number()
|
|
170
|
+
});
|
|
171
|
+
var TunaPositionPoolToken = {
|
|
172
|
+
A: "a",
|
|
173
|
+
B: "b"
|
|
174
|
+
};
|
|
175
|
+
var TunaPositionPoolTokenSchema = z3.enum(Object.values(TunaPositionPoolToken));
|
|
176
|
+
|
|
177
|
+
// src/client/schemas/limit_orders.ts
|
|
154
178
|
var LimitOrderState = {
|
|
155
179
|
OPEN: "open",
|
|
156
180
|
PARTIALLY_FILLED: "partially_filled",
|
|
@@ -158,50 +182,27 @@ var LimitOrderState = {
|
|
|
158
182
|
COMPLETE: "complete",
|
|
159
183
|
CANCELLED: "cancelled"
|
|
160
184
|
};
|
|
161
|
-
var LimitOrderStateSchema =
|
|
162
|
-
var LimitOrder =
|
|
163
|
-
address:
|
|
164
|
-
|
|
165
|
-
|
|
185
|
+
var LimitOrderStateSchema = z4.enum([LimitOrderState.OPEN, ...Object.values(LimitOrderState)]);
|
|
186
|
+
var LimitOrder = z4.object({
|
|
187
|
+
address: z4.string(),
|
|
188
|
+
orderMint: z4.string(),
|
|
189
|
+
mintA: Mint,
|
|
190
|
+
mintB: Mint,
|
|
191
|
+
pool: TunaPositionPoolSchema,
|
|
166
192
|
state: LimitOrderStateSchema,
|
|
167
|
-
aToB:
|
|
168
|
-
tickIndex:
|
|
169
|
-
fillRatio:
|
|
170
|
-
openTxSignature:
|
|
171
|
-
closeTxSignature:
|
|
193
|
+
aToB: z4.boolean(),
|
|
194
|
+
tickIndex: z4.number(),
|
|
195
|
+
fillRatio: z4.number(),
|
|
196
|
+
openTxSignature: z4.string(),
|
|
197
|
+
closeTxSignature: z4.nullable(z4.string()),
|
|
172
198
|
amountIn: AmountWithUsdSchema,
|
|
173
199
|
amountOut: AmountWithUsdSchema,
|
|
174
|
-
openedAt:
|
|
175
|
-
closedAt:
|
|
200
|
+
openedAt: z4.coerce.date(),
|
|
201
|
+
closedAt: z4.nullable(z4.coerce.date())
|
|
176
202
|
});
|
|
177
203
|
|
|
178
204
|
// src/client/schemas/lp_positions.ts
|
|
179
205
|
import z5 from "zod";
|
|
180
|
-
|
|
181
|
-
// src/client/schemas/mint.ts
|
|
182
|
-
import { z as z3 } from "zod";
|
|
183
|
-
var Mint = z3.object({
|
|
184
|
-
mint: z3.string(),
|
|
185
|
-
symbol: z3.string(),
|
|
186
|
-
name: z3.string(),
|
|
187
|
-
logo: z3.string(),
|
|
188
|
-
decimals: z3.number()
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
// src/client/schemas/positions_shared.ts
|
|
192
|
-
import z4 from "zod";
|
|
193
|
-
var TunaPositionPoolSchema = z4.object({
|
|
194
|
-
addr: z4.string(),
|
|
195
|
-
price: z4.number(),
|
|
196
|
-
tickSpacing: z4.number()
|
|
197
|
-
});
|
|
198
|
-
var TunaPositionPoolToken = {
|
|
199
|
-
A: "a",
|
|
200
|
-
B: "b"
|
|
201
|
-
};
|
|
202
|
-
var TunaPositionPoolTokenSchema = z4.enum(Object.values(TunaPositionPoolToken));
|
|
203
|
-
|
|
204
|
-
// src/client/schemas/lp_positions.ts
|
|
205
206
|
var LpPositionLimitOrderSwap = {
|
|
206
207
|
NO_SWAP: "no_swap",
|
|
207
208
|
SWAP_TO_TOKEN_A: "swap_to_token_a",
|
|
@@ -508,8 +509,8 @@ var TunaSpotPosition = z6.object({
|
|
|
508
509
|
mintA: Mint,
|
|
509
510
|
mintB: Mint,
|
|
510
511
|
pool: TunaPositionPoolSchema,
|
|
511
|
-
positionToken:
|
|
512
|
-
collateralToken:
|
|
512
|
+
positionToken: TunaPositionPoolTokenSchema,
|
|
513
|
+
collateralToken: TunaPositionPoolTokenSchema,
|
|
513
514
|
marketMaker: PoolProviderSchema,
|
|
514
515
|
depositedCollateral: AmountWithUsdSchema,
|
|
515
516
|
initialDebt: AmountWithUsdSchema,
|
|
@@ -572,7 +573,6 @@ var CloseSpotPositionQuote = z6.object({
|
|
|
572
573
|
});
|
|
573
574
|
|
|
574
575
|
// src/client/schemas/state_snapshot.ts
|
|
575
|
-
import z7 from "zod";
|
|
576
576
|
var PoolPriceUpdate = z7.object({
|
|
577
577
|
pool: z7.string(),
|
|
578
578
|
price: z7.number(),
|
|
@@ -1020,12 +1020,8 @@ var OrderBookNotificationMeta = z8.object({
|
|
|
1020
1020
|
inverted: z8.boolean()
|
|
1021
1021
|
});
|
|
1022
1022
|
var PoolSwapNotification = createNotificationSchema(PoolSwap);
|
|
1023
|
-
var PoolPriceUpdateNotification = createNotificationSchema(PoolPriceUpdate);
|
|
1024
1023
|
var OrderBookNotification = createNotificationSchema(OrderBook, OrderBookNotificationMeta);
|
|
1025
|
-
var TunaPositionNotification = createNotificationSchema(TunaPositionLegacy);
|
|
1026
|
-
var TunaSpotPositionNotification = createNotificationSchema(TunaSpotPosition);
|
|
1027
1024
|
var LendingPositionNotification = createNotificationSchema(LendingPosition);
|
|
1028
|
-
var LimitOrderNotification = createNotificationSchema(LimitOrder);
|
|
1029
1025
|
var TradeHistoryEntryNotification = createNotificationSchema(TradeHistoryEntry);
|
|
1030
1026
|
var OrderHistoryEntryNotification = createNotificationSchema(OrderHistoryEntry);
|
|
1031
1027
|
var StakingPositionNotification = createNotificationSchema(StakingPosition);
|