@crypticdot/defituna-api 4.2.0 → 4.3.1
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 +303 -0
- package/dist/index.d.cts +516 -1
- package/dist/index.d.ts +516 -1
- package/dist/index.js +282 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -29,6 +29,7 @@ __export(index_exports, {
|
|
|
29
29
|
OrderHistoryUiDirection: () => OrderHistoryUiDirection,
|
|
30
30
|
PoolProvider: () => PoolProvider,
|
|
31
31
|
PoolSubscriptionTopic: () => PoolSubscriptionTopic,
|
|
32
|
+
RateLimitSource: () => RateLimitSource,
|
|
32
33
|
StakingPositionActionType: () => StakingPositionActionType,
|
|
33
34
|
TradeHistoryAction: () => TradeHistoryAction,
|
|
34
35
|
TradeHistoryUiDirection: () => TradeHistoryUiDirection,
|
|
@@ -101,6 +102,8 @@ __export(index_exports, {
|
|
|
101
102
|
zGetOraclePricesResponse: () => zGetOraclePricesResponse,
|
|
102
103
|
zGetOrderHistoryData: () => zGetOrderHistoryData,
|
|
103
104
|
zGetOrderHistoryResponse: () => zGetOrderHistoryResponse,
|
|
105
|
+
zGetPairPriceData: () => zGetPairPriceData,
|
|
106
|
+
zGetPairPriceResponse: () => zGetPairPriceResponse,
|
|
104
107
|
zGetPoolCandlesData: () => zGetPoolCandlesData,
|
|
105
108
|
zGetPoolCandlesResponse: () => zGetPoolCandlesResponse,
|
|
106
109
|
zGetPoolData: () => zGetPoolData,
|
|
@@ -215,6 +218,10 @@ __export(index_exports, {
|
|
|
215
218
|
zPoolsError404Error: () => zPoolsError404Error,
|
|
216
219
|
zPoolsError500Error: () => zPoolsError500Error,
|
|
217
220
|
zPubkeyDto: () => zPubkeyDto,
|
|
221
|
+
zRateLimitSource: () => zRateLimitSource,
|
|
222
|
+
zRetryAfterHint: () => zRetryAfterHint,
|
|
223
|
+
zSearchTokensData: () => zSearchTokensData,
|
|
224
|
+
zSearchTokensResponse: () => zSearchTokensResponse,
|
|
218
225
|
zSnapshot: () => zSnapshot,
|
|
219
226
|
zSnapshotContainer: () => zSnapshotContainer,
|
|
220
227
|
zSpotPositionError404Error: () => zSpotPositionError404Error,
|
|
@@ -253,6 +260,20 @@ __export(index_exports, {
|
|
|
253
260
|
zSwapQuoteByOutputDto: () => zSwapQuoteByOutputDto,
|
|
254
261
|
zTickDto: () => zTickDto,
|
|
255
262
|
zTokenAmountWithUsd: () => zTokenAmountWithUsd,
|
|
263
|
+
zTokenAuditDto: () => zTokenAuditDto,
|
|
264
|
+
zTokenFirstPoolDto: () => zTokenFirstPoolDto,
|
|
265
|
+
zTokenPairPriceResponseDto: () => zTokenPairPriceResponseDto,
|
|
266
|
+
zTokenPriceDto: () => zTokenPriceDto,
|
|
267
|
+
zTokenSearchItemDto: () => zTokenSearchItemDto,
|
|
268
|
+
zTokenStatsWindowDto: () => zTokenStatsWindowDto,
|
|
269
|
+
zTokensError400BadRequest: () => zTokensError400BadRequest,
|
|
270
|
+
zTokensError400Error: () => zTokensError400Error,
|
|
271
|
+
zTokensError404Error: () => zTokensError404Error,
|
|
272
|
+
zTokensError429Error: () => zTokensError429Error,
|
|
273
|
+
zTokensError429TooManyRequests: () => zTokensError429TooManyRequests,
|
|
274
|
+
zTokensError429UpstreamRateLimited: () => zTokensError429UpstreamRateLimited,
|
|
275
|
+
zTokensError500Error: () => zTokensError500Error,
|
|
276
|
+
zTokensError502Error: () => zTokensError502Error,
|
|
256
277
|
zTradableAmountDto: () => zTradableAmountDto,
|
|
257
278
|
zTradeHistoryAction: () => zTradeHistoryAction,
|
|
258
279
|
zTradeHistoryEntryDto: () => zTradeHistoryEntryDto,
|
|
@@ -1026,6 +1047,7 @@ var PoolSubscriptionTopic = {
|
|
|
1026
1047
|
ORDER_BOOK: "order_book",
|
|
1027
1048
|
POOL_PRICES: "pool_prices"
|
|
1028
1049
|
};
|
|
1050
|
+
var RateLimitSource = { INTERNAL: "internal", UPSTREAM: "upstream" };
|
|
1029
1051
|
var StakingPositionActionType = {
|
|
1030
1052
|
STAKE: "stake",
|
|
1031
1053
|
UNSTAKE: "unstake",
|
|
@@ -9236,6 +9258,11 @@ var zMintDto = object({
|
|
|
9236
9258
|
name: string2(),
|
|
9237
9259
|
symbol: string2()
|
|
9238
9260
|
});
|
|
9261
|
+
var zRateLimitSource = _enum(["internal", "upstream"]);
|
|
9262
|
+
var zRetryAfterHint = object({
|
|
9263
|
+
retryAfterSeconds: coerce_exports.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
|
|
9264
|
+
source: zRateLimitSource
|
|
9265
|
+
});
|
|
9239
9266
|
var zSpotPositionError404Error = object({
|
|
9240
9267
|
code: _enum(["not_found"])
|
|
9241
9268
|
});
|
|
@@ -9300,6 +9327,214 @@ var zPoolTicksDto = object({
|
|
|
9300
9327
|
tickSpacing: int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
9301
9328
|
ticks: array(zTickDto)
|
|
9302
9329
|
});
|
|
9330
|
+
var zTokenAuditDto = object({
|
|
9331
|
+
freezeAuthorityDisabled: optional(union([
|
|
9332
|
+
boolean2(),
|
|
9333
|
+
_null3()
|
|
9334
|
+
])),
|
|
9335
|
+
mintAuthorityDisabled: optional(union([
|
|
9336
|
+
boolean2(),
|
|
9337
|
+
_null3()
|
|
9338
|
+
])),
|
|
9339
|
+
topHoldersPercentage: optional(union([
|
|
9340
|
+
number2(),
|
|
9341
|
+
_null3()
|
|
9342
|
+
]))
|
|
9343
|
+
});
|
|
9344
|
+
var zTokenFirstPoolDto = object({
|
|
9345
|
+
createdAt: string2(),
|
|
9346
|
+
id: string2()
|
|
9347
|
+
});
|
|
9348
|
+
var zTokenPriceDto = object({
|
|
9349
|
+
mint: string2(),
|
|
9350
|
+
priceBlockId: optional(union([
|
|
9351
|
+
coerce_exports.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
|
|
9352
|
+
_null3()
|
|
9353
|
+
])),
|
|
9354
|
+
priceChange24h: optional(union([
|
|
9355
|
+
number2(),
|
|
9356
|
+
_null3()
|
|
9357
|
+
])),
|
|
9358
|
+
usdPrice: number2()
|
|
9359
|
+
});
|
|
9360
|
+
var zTokenPairPriceResponseDto = object({
|
|
9361
|
+
tokenA: zTokenPriceDto,
|
|
9362
|
+
tokenB: zTokenPriceDto
|
|
9363
|
+
});
|
|
9364
|
+
var zTokenStatsWindowDto = object({
|
|
9365
|
+
buyOrganicVolume: optional(union([
|
|
9366
|
+
number2(),
|
|
9367
|
+
_null3()
|
|
9368
|
+
])),
|
|
9369
|
+
buyVolume: optional(union([
|
|
9370
|
+
number2(),
|
|
9371
|
+
_null3()
|
|
9372
|
+
])),
|
|
9373
|
+
liquidityChange: optional(union([
|
|
9374
|
+
number2(),
|
|
9375
|
+
_null3()
|
|
9376
|
+
])),
|
|
9377
|
+
numBuys: optional(union([
|
|
9378
|
+
coerce_exports.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
|
|
9379
|
+
_null3()
|
|
9380
|
+
])),
|
|
9381
|
+
numNetBuyers: optional(union([
|
|
9382
|
+
coerce_exports.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
|
|
9383
|
+
_null3()
|
|
9384
|
+
])),
|
|
9385
|
+
numOrganicBuyers: optional(union([
|
|
9386
|
+
coerce_exports.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
|
|
9387
|
+
_null3()
|
|
9388
|
+
])),
|
|
9389
|
+
numSells: optional(union([
|
|
9390
|
+
coerce_exports.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
|
|
9391
|
+
_null3()
|
|
9392
|
+
])),
|
|
9393
|
+
numTraders: optional(union([
|
|
9394
|
+
coerce_exports.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
|
|
9395
|
+
_null3()
|
|
9396
|
+
])),
|
|
9397
|
+
priceChange: optional(union([
|
|
9398
|
+
number2(),
|
|
9399
|
+
_null3()
|
|
9400
|
+
])),
|
|
9401
|
+
sellOrganicVolume: optional(union([
|
|
9402
|
+
number2(),
|
|
9403
|
+
_null3()
|
|
9404
|
+
])),
|
|
9405
|
+
sellVolume: optional(union([
|
|
9406
|
+
number2(),
|
|
9407
|
+
_null3()
|
|
9408
|
+
])),
|
|
9409
|
+
volumeChange: optional(union([
|
|
9410
|
+
number2(),
|
|
9411
|
+
_null3()
|
|
9412
|
+
]))
|
|
9413
|
+
});
|
|
9414
|
+
var zTokenSearchItemDto = object({
|
|
9415
|
+
audit: optional(union([
|
|
9416
|
+
_null3(),
|
|
9417
|
+
zTokenAuditDto
|
|
9418
|
+
])),
|
|
9419
|
+
circSupply: optional(union([
|
|
9420
|
+
number2(),
|
|
9421
|
+
_null3()
|
|
9422
|
+
])),
|
|
9423
|
+
decimals: int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
9424
|
+
fdv: optional(union([
|
|
9425
|
+
number2(),
|
|
9426
|
+
_null3()
|
|
9427
|
+
])),
|
|
9428
|
+
firstPool: optional(union([
|
|
9429
|
+
_null3(),
|
|
9430
|
+
zTokenFirstPoolDto
|
|
9431
|
+
])),
|
|
9432
|
+
holderCount: optional(union([
|
|
9433
|
+
coerce_exports.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
|
|
9434
|
+
_null3()
|
|
9435
|
+
])),
|
|
9436
|
+
iconUrl: optional(union([
|
|
9437
|
+
string2(),
|
|
9438
|
+
_null3()
|
|
9439
|
+
])),
|
|
9440
|
+
isVerified: boolean2(),
|
|
9441
|
+
liquidity: optional(union([
|
|
9442
|
+
number2(),
|
|
9443
|
+
_null3()
|
|
9444
|
+
])),
|
|
9445
|
+
mcap: optional(union([
|
|
9446
|
+
number2(),
|
|
9447
|
+
_null3()
|
|
9448
|
+
])),
|
|
9449
|
+
mint: string2(),
|
|
9450
|
+
name: string2(),
|
|
9451
|
+
organicScore: optional(union([
|
|
9452
|
+
number2(),
|
|
9453
|
+
_null3()
|
|
9454
|
+
])),
|
|
9455
|
+
organicScoreLabel: optional(union([
|
|
9456
|
+
string2(),
|
|
9457
|
+
_null3()
|
|
9458
|
+
])),
|
|
9459
|
+
priceBlockId: optional(union([
|
|
9460
|
+
coerce_exports.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
|
|
9461
|
+
_null3()
|
|
9462
|
+
])),
|
|
9463
|
+
stats1h: optional(union([
|
|
9464
|
+
_null3(),
|
|
9465
|
+
zTokenStatsWindowDto
|
|
9466
|
+
])),
|
|
9467
|
+
stats24h: optional(union([
|
|
9468
|
+
_null3(),
|
|
9469
|
+
zTokenStatsWindowDto
|
|
9470
|
+
])),
|
|
9471
|
+
stats5m: optional(union([
|
|
9472
|
+
_null3(),
|
|
9473
|
+
zTokenStatsWindowDto
|
|
9474
|
+
])),
|
|
9475
|
+
stats6h: optional(union([
|
|
9476
|
+
_null3(),
|
|
9477
|
+
zTokenStatsWindowDto
|
|
9478
|
+
])),
|
|
9479
|
+
symbol: string2(),
|
|
9480
|
+
tags: array(string2()),
|
|
9481
|
+
tokenProgram: optional(union([
|
|
9482
|
+
string2(),
|
|
9483
|
+
_null3()
|
|
9484
|
+
])),
|
|
9485
|
+
totalSupply: optional(union([
|
|
9486
|
+
number2(),
|
|
9487
|
+
_null3()
|
|
9488
|
+
])),
|
|
9489
|
+
updatedAt: optional(union([
|
|
9490
|
+
string2(),
|
|
9491
|
+
_null3()
|
|
9492
|
+
])),
|
|
9493
|
+
usdPrice: optional(union([
|
|
9494
|
+
number2(),
|
|
9495
|
+
_null3()
|
|
9496
|
+
]))
|
|
9497
|
+
});
|
|
9498
|
+
var zTokensError400BadRequest = object({
|
|
9499
|
+
code: _enum(["bad_request"])
|
|
9500
|
+
});
|
|
9501
|
+
var zTokensError400Error = union([
|
|
9502
|
+
object({
|
|
9503
|
+
code: literal("bad_request")
|
|
9504
|
+
}).and(zTokensError400BadRequest),
|
|
9505
|
+
object({
|
|
9506
|
+
code: union([
|
|
9507
|
+
literal("invalid_body"),
|
|
9508
|
+
literal("invalid_path"),
|
|
9509
|
+
literal("invalid_query")
|
|
9510
|
+
])
|
|
9511
|
+
}).and(zBadRequestErrorCodeErrorBody)
|
|
9512
|
+
]);
|
|
9513
|
+
var zTokensError404Error = object({
|
|
9514
|
+
code: _enum(["not_found"])
|
|
9515
|
+
});
|
|
9516
|
+
var zTokensError429TooManyRequests = object({
|
|
9517
|
+
code: _enum(["too_many_requests"]),
|
|
9518
|
+
data: zRetryAfterHint
|
|
9519
|
+
});
|
|
9520
|
+
var zTokensError429UpstreamRateLimited = object({
|
|
9521
|
+
code: _enum(["upstream_rate_limited"]),
|
|
9522
|
+
data: zRetryAfterHint
|
|
9523
|
+
});
|
|
9524
|
+
var zTokensError429Error = union([
|
|
9525
|
+
object({
|
|
9526
|
+
code: literal("too_many_requests")
|
|
9527
|
+
}).and(zTokensError429TooManyRequests),
|
|
9528
|
+
object({
|
|
9529
|
+
code: literal("upstream_rate_limited")
|
|
9530
|
+
}).and(zTokensError429UpstreamRateLimited)
|
|
9531
|
+
]);
|
|
9532
|
+
var zTokensError500Error = object({
|
|
9533
|
+
code: _enum(["internal_error"])
|
|
9534
|
+
});
|
|
9535
|
+
var zTokensError502Error = object({
|
|
9536
|
+
code: _enum(["upstream_unavailable"])
|
|
9537
|
+
});
|
|
9303
9538
|
var zTradeHistoryAction = _enum([
|
|
9304
9539
|
"swap",
|
|
9305
9540
|
"limit_order_fill",
|
|
@@ -10651,6 +10886,27 @@ var zUpdateStreamSubscriptionData = object({
|
|
|
10651
10886
|
var zUpdateStreamSubscriptionResponse = object({
|
|
10652
10887
|
data: zHttpStatusData
|
|
10653
10888
|
});
|
|
10889
|
+
var zGetPairPriceData = object({
|
|
10890
|
+
body: optional(never()),
|
|
10891
|
+
path: optional(never()),
|
|
10892
|
+
query: object({
|
|
10893
|
+
tokenA: zPubkeyDto,
|
|
10894
|
+
tokenB: zPubkeyDto
|
|
10895
|
+
})
|
|
10896
|
+
});
|
|
10897
|
+
var zGetPairPriceResponse = object({
|
|
10898
|
+
data: zTokenPairPriceResponseDto
|
|
10899
|
+
});
|
|
10900
|
+
var zSearchTokensData = object({
|
|
10901
|
+
body: optional(never()),
|
|
10902
|
+
path: optional(never()),
|
|
10903
|
+
query: object({
|
|
10904
|
+
q: string2().min(2).max(44)
|
|
10905
|
+
})
|
|
10906
|
+
});
|
|
10907
|
+
var zSearchTokensResponse = object({
|
|
10908
|
+
data: array(zTokenSearchItemDto)
|
|
10909
|
+
});
|
|
10654
10910
|
var zGetLendingPositionsData = object({
|
|
10655
10911
|
body: optional(never()),
|
|
10656
10912
|
path: object({
|
|
@@ -11380,6 +11636,32 @@ var _TunaBackendSdk = class _TunaBackendSdk extends HeyApiClient {
|
|
|
11380
11636
|
}
|
|
11381
11637
|
});
|
|
11382
11638
|
}
|
|
11639
|
+
/**
|
|
11640
|
+
* Get USD prices for token_a and token_b
|
|
11641
|
+
*/
|
|
11642
|
+
getPairPrice(parameters, options) {
|
|
11643
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "tokenA" }, { in: "query", key: "tokenB" }] }]);
|
|
11644
|
+
return (options?.client ?? this.client).get({
|
|
11645
|
+
requestValidator: async (data) => await zGetPairPriceData.parseAsync(data),
|
|
11646
|
+
responseValidator: async (data) => await zGetPairPriceResponse.parseAsync(data),
|
|
11647
|
+
url: "/v1/tokens/price",
|
|
11648
|
+
...options,
|
|
11649
|
+
...params
|
|
11650
|
+
});
|
|
11651
|
+
}
|
|
11652
|
+
/**
|
|
11653
|
+
* Search tokens by mint or name/symbol
|
|
11654
|
+
*/
|
|
11655
|
+
searchTokens(parameters, options) {
|
|
11656
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "q" }] }]);
|
|
11657
|
+
return (options?.client ?? this.client).get({
|
|
11658
|
+
requestValidator: async (data) => await zSearchTokensData.parseAsync(data),
|
|
11659
|
+
responseValidator: async (data) => await zSearchTokensResponse.parseAsync(data),
|
|
11660
|
+
url: "/v1/tokens/search",
|
|
11661
|
+
...options,
|
|
11662
|
+
...params
|
|
11663
|
+
});
|
|
11664
|
+
}
|
|
11383
11665
|
/**
|
|
11384
11666
|
* Request all user lending positions
|
|
11385
11667
|
*/
|
|
@@ -11719,6 +12001,7 @@ async function unwrap(promise2) {
|
|
|
11719
12001
|
OrderHistoryUiDirection,
|
|
11720
12002
|
PoolProvider,
|
|
11721
12003
|
PoolSubscriptionTopic,
|
|
12004
|
+
RateLimitSource,
|
|
11722
12005
|
StakingPositionActionType,
|
|
11723
12006
|
TradeHistoryAction,
|
|
11724
12007
|
TradeHistoryUiDirection,
|
|
@@ -11791,6 +12074,8 @@ async function unwrap(promise2) {
|
|
|
11791
12074
|
zGetOraclePricesResponse,
|
|
11792
12075
|
zGetOrderHistoryData,
|
|
11793
12076
|
zGetOrderHistoryResponse,
|
|
12077
|
+
zGetPairPriceData,
|
|
12078
|
+
zGetPairPriceResponse,
|
|
11794
12079
|
zGetPoolCandlesData,
|
|
11795
12080
|
zGetPoolCandlesResponse,
|
|
11796
12081
|
zGetPoolData,
|
|
@@ -11905,6 +12190,10 @@ async function unwrap(promise2) {
|
|
|
11905
12190
|
zPoolsError404Error,
|
|
11906
12191
|
zPoolsError500Error,
|
|
11907
12192
|
zPubkeyDto,
|
|
12193
|
+
zRateLimitSource,
|
|
12194
|
+
zRetryAfterHint,
|
|
12195
|
+
zSearchTokensData,
|
|
12196
|
+
zSearchTokensResponse,
|
|
11908
12197
|
zSnapshot,
|
|
11909
12198
|
zSnapshotContainer,
|
|
11910
12199
|
zSpotPositionError404Error,
|
|
@@ -11943,6 +12232,20 @@ async function unwrap(promise2) {
|
|
|
11943
12232
|
zSwapQuoteByOutputDto,
|
|
11944
12233
|
zTickDto,
|
|
11945
12234
|
zTokenAmountWithUsd,
|
|
12235
|
+
zTokenAuditDto,
|
|
12236
|
+
zTokenFirstPoolDto,
|
|
12237
|
+
zTokenPairPriceResponseDto,
|
|
12238
|
+
zTokenPriceDto,
|
|
12239
|
+
zTokenSearchItemDto,
|
|
12240
|
+
zTokenStatsWindowDto,
|
|
12241
|
+
zTokensError400BadRequest,
|
|
12242
|
+
zTokensError400Error,
|
|
12243
|
+
zTokensError404Error,
|
|
12244
|
+
zTokensError429Error,
|
|
12245
|
+
zTokensError429TooManyRequests,
|
|
12246
|
+
zTokensError429UpstreamRateLimited,
|
|
12247
|
+
zTokensError500Error,
|
|
12248
|
+
zTokensError502Error,
|
|
11946
12249
|
zTradableAmountDto,
|
|
11947
12250
|
zTradeHistoryAction,
|
|
11948
12251
|
zTradeHistoryEntryDto,
|