@crypticdot/defituna-api 3.0.1 → 3.0.2

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 CHANGED
@@ -225,11 +225,19 @@ function modifyQuery(url) {
225
225
  async function customFetch(url, init) {
226
226
  const fullUrl = resolveTunaUrl(url, init);
227
227
  const finalInit = { ...init };
228
+ if (finalInit.body && typeof finalInit.body === "string") {
229
+ try {
230
+ const body = JSON.parse(finalInit.body);
231
+ const snaked = normalizeRequestBody(body);
232
+ finalInit.body = JSON.stringify(snaked);
233
+ } catch {
234
+ }
235
+ }
228
236
  if (finalInit.body && typeof finalInit.body === "object" && !(finalInit.body instanceof FormData)) {
229
237
  const snaked = normalizeRequestBody(finalInit.body);
230
238
  finalInit.body = JSON.stringify(snaked);
231
239
  finalInit.headers = {
232
- "content-type": "application/json",
240
+ "Content-Type": "application/json",
233
241
  ...finalInit.headers || {}
234
242
  };
235
243
  }
package/dist/index.d.cts CHANGED
@@ -25,7 +25,8 @@ interface DecreaseSpotPositionQuoteDto {
25
25
  requiredSwapAmount: bigint;
26
26
  }
27
27
  interface FeeAmountWithUsd {
28
- amount: number;
28
+ /** Signed 64-bit integer encoded as a decimal string */
29
+ amount: bigint;
29
30
  usd: number;
30
31
  }
31
32
  interface FeesStatsGroupDto {
package/dist/index.d.ts CHANGED
@@ -25,7 +25,8 @@ interface DecreaseSpotPositionQuoteDto {
25
25
  requiredSwapAmount: bigint;
26
26
  }
27
27
  interface FeeAmountWithUsd {
28
- amount: number;
28
+ /** Signed 64-bit integer encoded as a decimal string */
29
+ amount: bigint;
29
30
  usd: number;
30
31
  }
31
32
  interface FeesStatsGroupDto {
package/dist/index.js CHANGED
@@ -72,11 +72,19 @@ function modifyQuery(url) {
72
72
  async function customFetch(url, init) {
73
73
  const fullUrl = resolveTunaUrl(url, init);
74
74
  const finalInit = { ...init };
75
+ if (finalInit.body && typeof finalInit.body === "string") {
76
+ try {
77
+ const body = JSON.parse(finalInit.body);
78
+ const snaked = normalizeRequestBody(body);
79
+ finalInit.body = JSON.stringify(snaked);
80
+ } catch {
81
+ }
82
+ }
75
83
  if (finalInit.body && typeof finalInit.body === "object" && !(finalInit.body instanceof FormData)) {
76
84
  const snaked = normalizeRequestBody(finalInit.body);
77
85
  finalInit.body = JSON.stringify(snaked);
78
86
  finalInit.headers = {
79
- "content-type": "application/json",
87
+ "Content-Type": "application/json",
80
88
  ...finalInit.headers || {}
81
89
  };
82
90
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crypticdot/defituna-api",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "private": false,
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",