@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.js
CHANGED
|
@@ -721,6 +721,7 @@ var PoolSubscriptionTopic = {
|
|
|
721
721
|
ORDER_BOOK: "order_book",
|
|
722
722
|
POOL_PRICES: "pool_prices"
|
|
723
723
|
};
|
|
724
|
+
var RateLimitSource = { INTERNAL: "internal", UPSTREAM: "upstream" };
|
|
724
725
|
var StakingPositionActionType = {
|
|
725
726
|
STAKE: "stake",
|
|
726
727
|
UNSTAKE: "unstake",
|
|
@@ -8931,6 +8932,11 @@ var zMintDto = object({
|
|
|
8931
8932
|
name: string2(),
|
|
8932
8933
|
symbol: string2()
|
|
8933
8934
|
});
|
|
8935
|
+
var zRateLimitSource = _enum(["internal", "upstream"]);
|
|
8936
|
+
var zRetryAfterHint = object({
|
|
8937
|
+
retryAfterSeconds: coerce_exports.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
|
|
8938
|
+
source: zRateLimitSource
|
|
8939
|
+
});
|
|
8934
8940
|
var zSpotPositionError404Error = object({
|
|
8935
8941
|
code: _enum(["not_found"])
|
|
8936
8942
|
});
|
|
@@ -8995,6 +9001,214 @@ var zPoolTicksDto = object({
|
|
|
8995
9001
|
tickSpacing: int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
8996
9002
|
ticks: array(zTickDto)
|
|
8997
9003
|
});
|
|
9004
|
+
var zTokenAuditDto = object({
|
|
9005
|
+
freezeAuthorityDisabled: optional(union([
|
|
9006
|
+
boolean2(),
|
|
9007
|
+
_null3()
|
|
9008
|
+
])),
|
|
9009
|
+
mintAuthorityDisabled: optional(union([
|
|
9010
|
+
boolean2(),
|
|
9011
|
+
_null3()
|
|
9012
|
+
])),
|
|
9013
|
+
topHoldersPercentage: optional(union([
|
|
9014
|
+
number2(),
|
|
9015
|
+
_null3()
|
|
9016
|
+
]))
|
|
9017
|
+
});
|
|
9018
|
+
var zTokenFirstPoolDto = object({
|
|
9019
|
+
createdAt: string2(),
|
|
9020
|
+
id: string2()
|
|
9021
|
+
});
|
|
9022
|
+
var zTokenPriceDto = object({
|
|
9023
|
+
mint: string2(),
|
|
9024
|
+
priceBlockId: optional(union([
|
|
9025
|
+
coerce_exports.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
|
|
9026
|
+
_null3()
|
|
9027
|
+
])),
|
|
9028
|
+
priceChange24h: optional(union([
|
|
9029
|
+
number2(),
|
|
9030
|
+
_null3()
|
|
9031
|
+
])),
|
|
9032
|
+
usdPrice: number2()
|
|
9033
|
+
});
|
|
9034
|
+
var zTokenPairPriceResponseDto = object({
|
|
9035
|
+
tokenA: zTokenPriceDto,
|
|
9036
|
+
tokenB: zTokenPriceDto
|
|
9037
|
+
});
|
|
9038
|
+
var zTokenStatsWindowDto = object({
|
|
9039
|
+
buyOrganicVolume: optional(union([
|
|
9040
|
+
number2(),
|
|
9041
|
+
_null3()
|
|
9042
|
+
])),
|
|
9043
|
+
buyVolume: optional(union([
|
|
9044
|
+
number2(),
|
|
9045
|
+
_null3()
|
|
9046
|
+
])),
|
|
9047
|
+
liquidityChange: optional(union([
|
|
9048
|
+
number2(),
|
|
9049
|
+
_null3()
|
|
9050
|
+
])),
|
|
9051
|
+
numBuys: optional(union([
|
|
9052
|
+
coerce_exports.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
|
|
9053
|
+
_null3()
|
|
9054
|
+
])),
|
|
9055
|
+
numNetBuyers: optional(union([
|
|
9056
|
+
coerce_exports.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
|
|
9057
|
+
_null3()
|
|
9058
|
+
])),
|
|
9059
|
+
numOrganicBuyers: optional(union([
|
|
9060
|
+
coerce_exports.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
|
|
9061
|
+
_null3()
|
|
9062
|
+
])),
|
|
9063
|
+
numSells: optional(union([
|
|
9064
|
+
coerce_exports.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
|
|
9065
|
+
_null3()
|
|
9066
|
+
])),
|
|
9067
|
+
numTraders: optional(union([
|
|
9068
|
+
coerce_exports.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
|
|
9069
|
+
_null3()
|
|
9070
|
+
])),
|
|
9071
|
+
priceChange: optional(union([
|
|
9072
|
+
number2(),
|
|
9073
|
+
_null3()
|
|
9074
|
+
])),
|
|
9075
|
+
sellOrganicVolume: optional(union([
|
|
9076
|
+
number2(),
|
|
9077
|
+
_null3()
|
|
9078
|
+
])),
|
|
9079
|
+
sellVolume: optional(union([
|
|
9080
|
+
number2(),
|
|
9081
|
+
_null3()
|
|
9082
|
+
])),
|
|
9083
|
+
volumeChange: optional(union([
|
|
9084
|
+
number2(),
|
|
9085
|
+
_null3()
|
|
9086
|
+
]))
|
|
9087
|
+
});
|
|
9088
|
+
var zTokenSearchItemDto = object({
|
|
9089
|
+
audit: optional(union([
|
|
9090
|
+
_null3(),
|
|
9091
|
+
zTokenAuditDto
|
|
9092
|
+
])),
|
|
9093
|
+
circSupply: optional(union([
|
|
9094
|
+
number2(),
|
|
9095
|
+
_null3()
|
|
9096
|
+
])),
|
|
9097
|
+
decimals: int().gte(0).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
|
|
9098
|
+
fdv: optional(union([
|
|
9099
|
+
number2(),
|
|
9100
|
+
_null3()
|
|
9101
|
+
])),
|
|
9102
|
+
firstPool: optional(union([
|
|
9103
|
+
_null3(),
|
|
9104
|
+
zTokenFirstPoolDto
|
|
9105
|
+
])),
|
|
9106
|
+
holderCount: optional(union([
|
|
9107
|
+
coerce_exports.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
|
|
9108
|
+
_null3()
|
|
9109
|
+
])),
|
|
9110
|
+
iconUrl: optional(union([
|
|
9111
|
+
string2(),
|
|
9112
|
+
_null3()
|
|
9113
|
+
])),
|
|
9114
|
+
isVerified: boolean2(),
|
|
9115
|
+
liquidity: optional(union([
|
|
9116
|
+
number2(),
|
|
9117
|
+
_null3()
|
|
9118
|
+
])),
|
|
9119
|
+
mcap: optional(union([
|
|
9120
|
+
number2(),
|
|
9121
|
+
_null3()
|
|
9122
|
+
])),
|
|
9123
|
+
mint: string2(),
|
|
9124
|
+
name: string2(),
|
|
9125
|
+
organicScore: optional(union([
|
|
9126
|
+
number2(),
|
|
9127
|
+
_null3()
|
|
9128
|
+
])),
|
|
9129
|
+
organicScoreLabel: optional(union([
|
|
9130
|
+
string2(),
|
|
9131
|
+
_null3()
|
|
9132
|
+
])),
|
|
9133
|
+
priceBlockId: optional(union([
|
|
9134
|
+
coerce_exports.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
|
|
9135
|
+
_null3()
|
|
9136
|
+
])),
|
|
9137
|
+
stats1h: optional(union([
|
|
9138
|
+
_null3(),
|
|
9139
|
+
zTokenStatsWindowDto
|
|
9140
|
+
])),
|
|
9141
|
+
stats24h: optional(union([
|
|
9142
|
+
_null3(),
|
|
9143
|
+
zTokenStatsWindowDto
|
|
9144
|
+
])),
|
|
9145
|
+
stats5m: optional(union([
|
|
9146
|
+
_null3(),
|
|
9147
|
+
zTokenStatsWindowDto
|
|
9148
|
+
])),
|
|
9149
|
+
stats6h: optional(union([
|
|
9150
|
+
_null3(),
|
|
9151
|
+
zTokenStatsWindowDto
|
|
9152
|
+
])),
|
|
9153
|
+
symbol: string2(),
|
|
9154
|
+
tags: array(string2()),
|
|
9155
|
+
tokenProgram: optional(union([
|
|
9156
|
+
string2(),
|
|
9157
|
+
_null3()
|
|
9158
|
+
])),
|
|
9159
|
+
totalSupply: optional(union([
|
|
9160
|
+
number2(),
|
|
9161
|
+
_null3()
|
|
9162
|
+
])),
|
|
9163
|
+
updatedAt: optional(union([
|
|
9164
|
+
string2(),
|
|
9165
|
+
_null3()
|
|
9166
|
+
])),
|
|
9167
|
+
usdPrice: optional(union([
|
|
9168
|
+
number2(),
|
|
9169
|
+
_null3()
|
|
9170
|
+
]))
|
|
9171
|
+
});
|
|
9172
|
+
var zTokensError400BadRequest = object({
|
|
9173
|
+
code: _enum(["bad_request"])
|
|
9174
|
+
});
|
|
9175
|
+
var zTokensError400Error = union([
|
|
9176
|
+
object({
|
|
9177
|
+
code: literal("bad_request")
|
|
9178
|
+
}).and(zTokensError400BadRequest),
|
|
9179
|
+
object({
|
|
9180
|
+
code: union([
|
|
9181
|
+
literal("invalid_body"),
|
|
9182
|
+
literal("invalid_path"),
|
|
9183
|
+
literal("invalid_query")
|
|
9184
|
+
])
|
|
9185
|
+
}).and(zBadRequestErrorCodeErrorBody)
|
|
9186
|
+
]);
|
|
9187
|
+
var zTokensError404Error = object({
|
|
9188
|
+
code: _enum(["not_found"])
|
|
9189
|
+
});
|
|
9190
|
+
var zTokensError429TooManyRequests = object({
|
|
9191
|
+
code: _enum(["too_many_requests"]),
|
|
9192
|
+
data: zRetryAfterHint
|
|
9193
|
+
});
|
|
9194
|
+
var zTokensError429UpstreamRateLimited = object({
|
|
9195
|
+
code: _enum(["upstream_rate_limited"]),
|
|
9196
|
+
data: zRetryAfterHint
|
|
9197
|
+
});
|
|
9198
|
+
var zTokensError429Error = union([
|
|
9199
|
+
object({
|
|
9200
|
+
code: literal("too_many_requests")
|
|
9201
|
+
}).and(zTokensError429TooManyRequests),
|
|
9202
|
+
object({
|
|
9203
|
+
code: literal("upstream_rate_limited")
|
|
9204
|
+
}).and(zTokensError429UpstreamRateLimited)
|
|
9205
|
+
]);
|
|
9206
|
+
var zTokensError500Error = object({
|
|
9207
|
+
code: _enum(["internal_error"])
|
|
9208
|
+
});
|
|
9209
|
+
var zTokensError502Error = object({
|
|
9210
|
+
code: _enum(["upstream_unavailable"])
|
|
9211
|
+
});
|
|
8998
9212
|
var zTradeHistoryAction = _enum([
|
|
8999
9213
|
"swap",
|
|
9000
9214
|
"limit_order_fill",
|
|
@@ -10346,6 +10560,27 @@ var zUpdateStreamSubscriptionData = object({
|
|
|
10346
10560
|
var zUpdateStreamSubscriptionResponse = object({
|
|
10347
10561
|
data: zHttpStatusData
|
|
10348
10562
|
});
|
|
10563
|
+
var zGetPairPriceData = object({
|
|
10564
|
+
body: optional(never()),
|
|
10565
|
+
path: optional(never()),
|
|
10566
|
+
query: object({
|
|
10567
|
+
tokenA: zPubkeyDto,
|
|
10568
|
+
tokenB: zPubkeyDto
|
|
10569
|
+
})
|
|
10570
|
+
});
|
|
10571
|
+
var zGetPairPriceResponse = object({
|
|
10572
|
+
data: zTokenPairPriceResponseDto
|
|
10573
|
+
});
|
|
10574
|
+
var zSearchTokensData = object({
|
|
10575
|
+
body: optional(never()),
|
|
10576
|
+
path: optional(never()),
|
|
10577
|
+
query: object({
|
|
10578
|
+
q: string2().min(2).max(44)
|
|
10579
|
+
})
|
|
10580
|
+
});
|
|
10581
|
+
var zSearchTokensResponse = object({
|
|
10582
|
+
data: array(zTokenSearchItemDto)
|
|
10583
|
+
});
|
|
10349
10584
|
var zGetLendingPositionsData = object({
|
|
10350
10585
|
body: optional(never()),
|
|
10351
10586
|
path: object({
|
|
@@ -11075,6 +11310,32 @@ var _TunaBackendSdk = class _TunaBackendSdk extends HeyApiClient {
|
|
|
11075
11310
|
}
|
|
11076
11311
|
});
|
|
11077
11312
|
}
|
|
11313
|
+
/**
|
|
11314
|
+
* Get USD prices for token_a and token_b
|
|
11315
|
+
*/
|
|
11316
|
+
getPairPrice(parameters, options) {
|
|
11317
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "tokenA" }, { in: "query", key: "tokenB" }] }]);
|
|
11318
|
+
return (options?.client ?? this.client).get({
|
|
11319
|
+
requestValidator: async (data) => await zGetPairPriceData.parseAsync(data),
|
|
11320
|
+
responseValidator: async (data) => await zGetPairPriceResponse.parseAsync(data),
|
|
11321
|
+
url: "/v1/tokens/price",
|
|
11322
|
+
...options,
|
|
11323
|
+
...params
|
|
11324
|
+
});
|
|
11325
|
+
}
|
|
11326
|
+
/**
|
|
11327
|
+
* Search tokens by mint or name/symbol
|
|
11328
|
+
*/
|
|
11329
|
+
searchTokens(parameters, options) {
|
|
11330
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "q" }] }]);
|
|
11331
|
+
return (options?.client ?? this.client).get({
|
|
11332
|
+
requestValidator: async (data) => await zSearchTokensData.parseAsync(data),
|
|
11333
|
+
responseValidator: async (data) => await zSearchTokensResponse.parseAsync(data),
|
|
11334
|
+
url: "/v1/tokens/search",
|
|
11335
|
+
...options,
|
|
11336
|
+
...params
|
|
11337
|
+
});
|
|
11338
|
+
}
|
|
11078
11339
|
/**
|
|
11079
11340
|
* Request all user lending positions
|
|
11080
11341
|
*/
|
|
@@ -11413,6 +11674,7 @@ export {
|
|
|
11413
11674
|
OrderHistoryUiDirection,
|
|
11414
11675
|
PoolProvider,
|
|
11415
11676
|
PoolSubscriptionTopic,
|
|
11677
|
+
RateLimitSource,
|
|
11416
11678
|
StakingPositionActionType,
|
|
11417
11679
|
TradeHistoryAction,
|
|
11418
11680
|
TradeHistoryUiDirection,
|
|
@@ -11485,6 +11747,8 @@ export {
|
|
|
11485
11747
|
zGetOraclePricesResponse,
|
|
11486
11748
|
zGetOrderHistoryData,
|
|
11487
11749
|
zGetOrderHistoryResponse,
|
|
11750
|
+
zGetPairPriceData,
|
|
11751
|
+
zGetPairPriceResponse,
|
|
11488
11752
|
zGetPoolCandlesData,
|
|
11489
11753
|
zGetPoolCandlesResponse,
|
|
11490
11754
|
zGetPoolData,
|
|
@@ -11599,6 +11863,10 @@ export {
|
|
|
11599
11863
|
zPoolsError404Error,
|
|
11600
11864
|
zPoolsError500Error,
|
|
11601
11865
|
zPubkeyDto,
|
|
11866
|
+
zRateLimitSource,
|
|
11867
|
+
zRetryAfterHint,
|
|
11868
|
+
zSearchTokensData,
|
|
11869
|
+
zSearchTokensResponse,
|
|
11602
11870
|
zSnapshot,
|
|
11603
11871
|
zSnapshotContainer,
|
|
11604
11872
|
zSpotPositionError404Error,
|
|
@@ -11637,6 +11905,20 @@ export {
|
|
|
11637
11905
|
zSwapQuoteByOutputDto,
|
|
11638
11906
|
zTickDto,
|
|
11639
11907
|
zTokenAmountWithUsd,
|
|
11908
|
+
zTokenAuditDto,
|
|
11909
|
+
zTokenFirstPoolDto,
|
|
11910
|
+
zTokenPairPriceResponseDto,
|
|
11911
|
+
zTokenPriceDto,
|
|
11912
|
+
zTokenSearchItemDto,
|
|
11913
|
+
zTokenStatsWindowDto,
|
|
11914
|
+
zTokensError400BadRequest,
|
|
11915
|
+
zTokensError400Error,
|
|
11916
|
+
zTokensError404Error,
|
|
11917
|
+
zTokensError429Error,
|
|
11918
|
+
zTokensError429TooManyRequests,
|
|
11919
|
+
zTokensError429UpstreamRateLimited,
|
|
11920
|
+
zTokensError500Error,
|
|
11921
|
+
zTokensError502Error,
|
|
11640
11922
|
zTradableAmountDto,
|
|
11641
11923
|
zTradeHistoryAction,
|
|
11642
11924
|
zTradeHistoryEntryDto,
|