@crypticdot/defituna-api 4.2.0 → 4.3.0
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 +308 -0
- package/dist/index.d.cts +609 -1
- package/dist/index.d.ts +609 -1
- package/dist/index.js +286 -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,217 @@ 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 zTokenSearchResponseDto = object({
|
|
9173
|
+
items: array(zTokenSearchItemDto)
|
|
9174
|
+
});
|
|
9175
|
+
var zTokensError400BadRequest = object({
|
|
9176
|
+
code: _enum(["bad_request"])
|
|
9177
|
+
});
|
|
9178
|
+
var zTokensError400Error = union([
|
|
9179
|
+
object({
|
|
9180
|
+
code: literal("bad_request")
|
|
9181
|
+
}).and(zTokensError400BadRequest),
|
|
9182
|
+
object({
|
|
9183
|
+
code: union([
|
|
9184
|
+
literal("invalid_body"),
|
|
9185
|
+
literal("invalid_path"),
|
|
9186
|
+
literal("invalid_query")
|
|
9187
|
+
])
|
|
9188
|
+
}).and(zBadRequestErrorCodeErrorBody)
|
|
9189
|
+
]);
|
|
9190
|
+
var zTokensError404Error = object({
|
|
9191
|
+
code: _enum(["not_found"])
|
|
9192
|
+
});
|
|
9193
|
+
var zTokensError429TooManyRequests = object({
|
|
9194
|
+
code: _enum(["too_many_requests"]),
|
|
9195
|
+
data: zRetryAfterHint
|
|
9196
|
+
});
|
|
9197
|
+
var zTokensError429UpstreamRateLimited = object({
|
|
9198
|
+
code: _enum(["upstream_rate_limited"]),
|
|
9199
|
+
data: zRetryAfterHint
|
|
9200
|
+
});
|
|
9201
|
+
var zTokensError429Error = union([
|
|
9202
|
+
object({
|
|
9203
|
+
code: literal("too_many_requests")
|
|
9204
|
+
}).and(zTokensError429TooManyRequests),
|
|
9205
|
+
object({
|
|
9206
|
+
code: literal("upstream_rate_limited")
|
|
9207
|
+
}).and(zTokensError429UpstreamRateLimited)
|
|
9208
|
+
]);
|
|
9209
|
+
var zTokensError500Error = object({
|
|
9210
|
+
code: _enum(["internal_error"])
|
|
9211
|
+
});
|
|
9212
|
+
var zTokensError502Error = object({
|
|
9213
|
+
code: _enum(["upstream_unavailable"])
|
|
9214
|
+
});
|
|
8998
9215
|
var zTradeHistoryAction = _enum([
|
|
8999
9216
|
"swap",
|
|
9000
9217
|
"limit_order_fill",
|
|
@@ -10346,6 +10563,27 @@ var zUpdateStreamSubscriptionData = object({
|
|
|
10346
10563
|
var zUpdateStreamSubscriptionResponse = object({
|
|
10347
10564
|
data: zHttpStatusData
|
|
10348
10565
|
});
|
|
10566
|
+
var zGetPairPriceData = object({
|
|
10567
|
+
body: optional(never()),
|
|
10568
|
+
path: optional(never()),
|
|
10569
|
+
query: object({
|
|
10570
|
+
tokenA: zPubkeyDto,
|
|
10571
|
+
tokenB: zPubkeyDto
|
|
10572
|
+
})
|
|
10573
|
+
});
|
|
10574
|
+
var zGetPairPriceResponse = object({
|
|
10575
|
+
data: zTokenPairPriceResponseDto
|
|
10576
|
+
});
|
|
10577
|
+
var zSearchTokensData = object({
|
|
10578
|
+
body: optional(never()),
|
|
10579
|
+
path: optional(never()),
|
|
10580
|
+
query: object({
|
|
10581
|
+
q: string2()
|
|
10582
|
+
})
|
|
10583
|
+
});
|
|
10584
|
+
var zSearchTokensResponse = object({
|
|
10585
|
+
data: zTokenSearchResponseDto
|
|
10586
|
+
});
|
|
10349
10587
|
var zGetLendingPositionsData = object({
|
|
10350
10588
|
body: optional(never()),
|
|
10351
10589
|
path: object({
|
|
@@ -11075,6 +11313,32 @@ var _TunaBackendSdk = class _TunaBackendSdk extends HeyApiClient {
|
|
|
11075
11313
|
}
|
|
11076
11314
|
});
|
|
11077
11315
|
}
|
|
11316
|
+
/**
|
|
11317
|
+
* Get USD prices for token_a and token_b
|
|
11318
|
+
*/
|
|
11319
|
+
getPairPrice(parameters, options) {
|
|
11320
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "tokenA" }, { in: "query", key: "tokenB" }] }]);
|
|
11321
|
+
return (options?.client ?? this.client).get({
|
|
11322
|
+
requestValidator: async (data) => await zGetPairPriceData.parseAsync(data),
|
|
11323
|
+
responseValidator: async (data) => await zGetPairPriceResponse.parseAsync(data),
|
|
11324
|
+
url: "/v1/tokens/price",
|
|
11325
|
+
...options,
|
|
11326
|
+
...params
|
|
11327
|
+
});
|
|
11328
|
+
}
|
|
11329
|
+
/**
|
|
11330
|
+
* Search tokens by mint or name/symbol
|
|
11331
|
+
*/
|
|
11332
|
+
searchTokens(parameters, options) {
|
|
11333
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "q" }] }]);
|
|
11334
|
+
return (options?.client ?? this.client).get({
|
|
11335
|
+
requestValidator: async (data) => await zSearchTokensData.parseAsync(data),
|
|
11336
|
+
responseValidator: async (data) => await zSearchTokensResponse.parseAsync(data),
|
|
11337
|
+
url: "/v1/tokens/search",
|
|
11338
|
+
...options,
|
|
11339
|
+
...params
|
|
11340
|
+
});
|
|
11341
|
+
}
|
|
11078
11342
|
/**
|
|
11079
11343
|
* Request all user lending positions
|
|
11080
11344
|
*/
|
|
@@ -11413,6 +11677,7 @@ export {
|
|
|
11413
11677
|
OrderHistoryUiDirection,
|
|
11414
11678
|
PoolProvider,
|
|
11415
11679
|
PoolSubscriptionTopic,
|
|
11680
|
+
RateLimitSource,
|
|
11416
11681
|
StakingPositionActionType,
|
|
11417
11682
|
TradeHistoryAction,
|
|
11418
11683
|
TradeHistoryUiDirection,
|
|
@@ -11485,6 +11750,8 @@ export {
|
|
|
11485
11750
|
zGetOraclePricesResponse,
|
|
11486
11751
|
zGetOrderHistoryData,
|
|
11487
11752
|
zGetOrderHistoryResponse,
|
|
11753
|
+
zGetPairPriceData,
|
|
11754
|
+
zGetPairPriceResponse,
|
|
11488
11755
|
zGetPoolCandlesData,
|
|
11489
11756
|
zGetPoolCandlesResponse,
|
|
11490
11757
|
zGetPoolData,
|
|
@@ -11599,6 +11866,10 @@ export {
|
|
|
11599
11866
|
zPoolsError404Error,
|
|
11600
11867
|
zPoolsError500Error,
|
|
11601
11868
|
zPubkeyDto,
|
|
11869
|
+
zRateLimitSource,
|
|
11870
|
+
zRetryAfterHint,
|
|
11871
|
+
zSearchTokensData,
|
|
11872
|
+
zSearchTokensResponse,
|
|
11602
11873
|
zSnapshot,
|
|
11603
11874
|
zSnapshotContainer,
|
|
11604
11875
|
zSpotPositionError404Error,
|
|
@@ -11637,6 +11908,21 @@ export {
|
|
|
11637
11908
|
zSwapQuoteByOutputDto,
|
|
11638
11909
|
zTickDto,
|
|
11639
11910
|
zTokenAmountWithUsd,
|
|
11911
|
+
zTokenAuditDto,
|
|
11912
|
+
zTokenFirstPoolDto,
|
|
11913
|
+
zTokenPairPriceResponseDto,
|
|
11914
|
+
zTokenPriceDto,
|
|
11915
|
+
zTokenSearchItemDto,
|
|
11916
|
+
zTokenSearchResponseDto,
|
|
11917
|
+
zTokenStatsWindowDto,
|
|
11918
|
+
zTokensError400BadRequest,
|
|
11919
|
+
zTokensError400Error,
|
|
11920
|
+
zTokensError404Error,
|
|
11921
|
+
zTokensError429Error,
|
|
11922
|
+
zTokensError429TooManyRequests,
|
|
11923
|
+
zTokensError429UpstreamRateLimited,
|
|
11924
|
+
zTokensError500Error,
|
|
11925
|
+
zTokensError502Error,
|
|
11640
11926
|
zTradableAmountDto,
|
|
11641
11927
|
zTradeHistoryAction,
|
|
11642
11928
|
zTradeHistoryEntryDto,
|