@crypticdot/defituna-api 1.5.0 → 1.5.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.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -2229,7 +2229,7 @@ declare const IncreaseSpotPositionQuote$1: z.ZodObject<{
|
|
|
2229
2229
|
}>;
|
|
2230
2230
|
declare const DecreaseSpotPositionQuote$1: z.ZodObject<{
|
|
2231
2231
|
/** Position decrease percentage */
|
|
2232
|
-
decreasePercent: z.
|
|
2232
|
+
decreasePercent: z.ZodNumber;
|
|
2233
2233
|
/** Collateral token of the new position */
|
|
2234
2234
|
collateralToken: z.ZodNumber;
|
|
2235
2235
|
/** Token of the new position */
|
|
@@ -2264,7 +2264,7 @@ declare const DecreaseSpotPositionQuote$1: z.ZodObject<{
|
|
|
2264
2264
|
protocolFeeB: bigint;
|
|
2265
2265
|
priceImpact: number;
|
|
2266
2266
|
uiLiquidationPrice: number | null;
|
|
2267
|
-
decreasePercent:
|
|
2267
|
+
decreasePercent: number;
|
|
2268
2268
|
decreaseAcceptableSwapAmount: bigint;
|
|
2269
2269
|
increaseMinSwapOutputAmount: bigint;
|
|
2270
2270
|
}, {
|
|
@@ -2277,7 +2277,7 @@ declare const DecreaseSpotPositionQuote$1: z.ZodObject<{
|
|
|
2277
2277
|
protocolFeeB: bigint;
|
|
2278
2278
|
priceImpact: number;
|
|
2279
2279
|
uiLiquidationPrice: number | null;
|
|
2280
|
-
decreasePercent:
|
|
2280
|
+
decreasePercent: number;
|
|
2281
2281
|
decreaseAcceptableSwapAmount: bigint;
|
|
2282
2282
|
increaseMinSwapOutputAmount: bigint;
|
|
2283
2283
|
}>;
|
|
@@ -6410,8 +6410,8 @@ declare class TunaApiClient {
|
|
|
6410
6410
|
getFeesStats(from: Date, to: Date, interval: string): Promise<FeesStatsGroup[]>;
|
|
6411
6411
|
getStakingRevenueStats(from: Date, to: Date): Promise<StakingRevenueStatsGroup[]>;
|
|
6412
6412
|
getSwapQuoteByInput(pool: string, amountIn: bigint, aToB: boolean, slippageToleranceBps?: number): Promise<SwapByInputQuote>;
|
|
6413
|
-
getSwapQuoteByOutput(pool: string, amountOut: bigint, aToB: boolean, slippageToleranceBps?: number): Promise<
|
|
6414
|
-
getIncreaseSpotPositionQuote(market: string, increaseAmount: bigint, collateralToken: number, positionToken: number, leverage: number, positionAmount?:
|
|
6413
|
+
getSwapQuoteByOutput(pool: string, amountOut: bigint, aToB: boolean, slippageToleranceBps?: number): Promise<SwapByOutputQuote>;
|
|
6414
|
+
getIncreaseSpotPositionQuote(market: string, increaseAmount: bigint, collateralToken: number, positionToken: number, leverage: number, positionAmount?: bigint, positionDebt?: bigint, slippageTolerance?: number): Promise<IncreaseSpotPositionQuote>;
|
|
6415
6415
|
getDecreaseSpotPositionQuote(market: string, decreaseAmount: bigint, collateralToken: number, positionToken: number, leverage: number, reduceOnly: boolean, positionAmount: bigint, positionDebt: bigint, slippageTolerance?: number): Promise<DecreaseSpotPositionQuote>;
|
|
6416
6416
|
getTradableAmount(market: string, collateralToken: number, positionToken: number, newPositionToken: number, availableBalance: bigint, leverage: number, reduceOnly: boolean, positionAmount: bigint, positionDebt: bigint): Promise<TradableAmount>;
|
|
6417
6417
|
getUpdatesStream(): Promise<EventSource>;
|
package/dist/index.d.ts
CHANGED
|
@@ -2229,7 +2229,7 @@ declare const IncreaseSpotPositionQuote$1: z.ZodObject<{
|
|
|
2229
2229
|
}>;
|
|
2230
2230
|
declare const DecreaseSpotPositionQuote$1: z.ZodObject<{
|
|
2231
2231
|
/** Position decrease percentage */
|
|
2232
|
-
decreasePercent: z.
|
|
2232
|
+
decreasePercent: z.ZodNumber;
|
|
2233
2233
|
/** Collateral token of the new position */
|
|
2234
2234
|
collateralToken: z.ZodNumber;
|
|
2235
2235
|
/** Token of the new position */
|
|
@@ -2264,7 +2264,7 @@ declare const DecreaseSpotPositionQuote$1: z.ZodObject<{
|
|
|
2264
2264
|
protocolFeeB: bigint;
|
|
2265
2265
|
priceImpact: number;
|
|
2266
2266
|
uiLiquidationPrice: number | null;
|
|
2267
|
-
decreasePercent:
|
|
2267
|
+
decreasePercent: number;
|
|
2268
2268
|
decreaseAcceptableSwapAmount: bigint;
|
|
2269
2269
|
increaseMinSwapOutputAmount: bigint;
|
|
2270
2270
|
}, {
|
|
@@ -2277,7 +2277,7 @@ declare const DecreaseSpotPositionQuote$1: z.ZodObject<{
|
|
|
2277
2277
|
protocolFeeB: bigint;
|
|
2278
2278
|
priceImpact: number;
|
|
2279
2279
|
uiLiquidationPrice: number | null;
|
|
2280
|
-
decreasePercent:
|
|
2280
|
+
decreasePercent: number;
|
|
2281
2281
|
decreaseAcceptableSwapAmount: bigint;
|
|
2282
2282
|
increaseMinSwapOutputAmount: bigint;
|
|
2283
2283
|
}>;
|
|
@@ -6410,8 +6410,8 @@ declare class TunaApiClient {
|
|
|
6410
6410
|
getFeesStats(from: Date, to: Date, interval: string): Promise<FeesStatsGroup[]>;
|
|
6411
6411
|
getStakingRevenueStats(from: Date, to: Date): Promise<StakingRevenueStatsGroup[]>;
|
|
6412
6412
|
getSwapQuoteByInput(pool: string, amountIn: bigint, aToB: boolean, slippageToleranceBps?: number): Promise<SwapByInputQuote>;
|
|
6413
|
-
getSwapQuoteByOutput(pool: string, amountOut: bigint, aToB: boolean, slippageToleranceBps?: number): Promise<
|
|
6414
|
-
getIncreaseSpotPositionQuote(market: string, increaseAmount: bigint, collateralToken: number, positionToken: number, leverage: number, positionAmount?:
|
|
6413
|
+
getSwapQuoteByOutput(pool: string, amountOut: bigint, aToB: boolean, slippageToleranceBps?: number): Promise<SwapByOutputQuote>;
|
|
6414
|
+
getIncreaseSpotPositionQuote(market: string, increaseAmount: bigint, collateralToken: number, positionToken: number, leverage: number, positionAmount?: bigint, positionDebt?: bigint, slippageTolerance?: number): Promise<IncreaseSpotPositionQuote>;
|
|
6415
6415
|
getDecreaseSpotPositionQuote(market: string, decreaseAmount: bigint, collateralToken: number, positionToken: number, leverage: number, reduceOnly: boolean, positionAmount: bigint, positionDebt: bigint, slippageTolerance?: number): Promise<DecreaseSpotPositionQuote>;
|
|
6416
6416
|
getTradableAmount(market: string, collateralToken: number, positionToken: number, newPositionToken: number, availableBalance: bigint, leverage: number, reduceOnly: boolean, positionAmount: bigint, positionDebt: bigint): Promise<TradableAmount>;
|
|
6417
6417
|
getUpdatesStream(): Promise<EventSource>;
|
package/dist/index.js
CHANGED
|
@@ -667,7 +667,7 @@ var IncreaseSpotPositionQuote = import_zod.z.object({
|
|
|
667
667
|
});
|
|
668
668
|
var DecreaseSpotPositionQuote = import_zod.z.object({
|
|
669
669
|
/** Position decrease percentage */
|
|
670
|
-
decreasePercent: import_zod.z.
|
|
670
|
+
decreasePercent: import_zod.z.number(),
|
|
671
671
|
/** Collateral token of the new position */
|
|
672
672
|
collateralToken: import_zod.z.number(),
|
|
673
673
|
/** Token of the new position */
|
|
@@ -1047,7 +1047,7 @@ var TunaApiClient = class {
|
|
|
1047
1047
|
query.slippage_tolerance = slippageToleranceBps;
|
|
1048
1048
|
}
|
|
1049
1049
|
const url = this.appendUrlSearchParams(this.buildURL(`quotes/swap-by-output`), query);
|
|
1050
|
-
return await this.httpRequest(url,
|
|
1050
|
+
return await this.httpRequest(url, SwapByOutputQuote);
|
|
1051
1051
|
}
|
|
1052
1052
|
async getIncreaseSpotPositionQuote(market, increaseAmount, collateralToken, positionToken, leverage, positionAmount, positionDebt, slippageTolerance) {
|
|
1053
1053
|
let query = {
|
package/dist/index.mjs
CHANGED
|
@@ -632,7 +632,7 @@ var IncreaseSpotPositionQuote = z.object({
|
|
|
632
632
|
});
|
|
633
633
|
var DecreaseSpotPositionQuote = z.object({
|
|
634
634
|
/** Position decrease percentage */
|
|
635
|
-
decreasePercent: z.
|
|
635
|
+
decreasePercent: z.number(),
|
|
636
636
|
/** Collateral token of the new position */
|
|
637
637
|
collateralToken: z.number(),
|
|
638
638
|
/** Token of the new position */
|
|
@@ -1012,7 +1012,7 @@ var TunaApiClient = class {
|
|
|
1012
1012
|
query.slippage_tolerance = slippageToleranceBps;
|
|
1013
1013
|
}
|
|
1014
1014
|
const url = this.appendUrlSearchParams(this.buildURL(`quotes/swap-by-output`), query);
|
|
1015
|
-
return await this.httpRequest(url,
|
|
1015
|
+
return await this.httpRequest(url, SwapByOutputQuote);
|
|
1016
1016
|
}
|
|
1017
1017
|
async getIncreaseSpotPositionQuote(market, increaseAmount, collateralToken, positionToken, leverage, positionAmount, positionDebt, slippageTolerance) {
|
|
1018
1018
|
let query = {
|