@cetusprotocol/aggregator-sdk 0.3.30 → 0.3.31
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.js +14 -25
- package/dist/index.mjs +14 -25
- package/package.json +1 -1
- package/src/api.ts +1 -1
- package/src/utils/msafe.ts +16 -26
package/dist/index.js
CHANGED
|
@@ -7102,34 +7102,23 @@ function getAggregatorV2ExtendPublishedAt(aggregatorV2ExtendPublishedAt, package
|
|
|
7102
7102
|
// src/utils/msafe.ts
|
|
7103
7103
|
var import_bn6 = __toESM(require_bn());
|
|
7104
7104
|
var dealWithFastRouterSwapParamsForMsafe = (data) => {
|
|
7105
|
-
|
|
7106
|
-
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
|
|
7110
|
-
|
|
7111
|
-
|
|
7112
|
-
amountIn: (_a2 = item == null ? void 0 : item.amountIn) == null ? void 0 : _a2.toString(),
|
|
7113
|
-
amountOut: (_b2 = item == null ? void 0 : item.amountOut) == null ? void 0 : _b2.toString(),
|
|
7114
|
-
initialPrice: (_c2 = item == null ? void 0 : item.initialPrice) == null ? void 0 : _c2.toString()
|
|
7115
|
-
});
|
|
7116
|
-
})
|
|
7105
|
+
const result = data == null ? void 0 : data.map((item) => {
|
|
7106
|
+
var _a, _b, _c;
|
|
7107
|
+
return __spreadProps(__spreadValues({}, item), {
|
|
7108
|
+
amountIn: (_a = item == null ? void 0 : item.amountIn) == null ? void 0 : _a.toString(),
|
|
7109
|
+
amountOut: (_b = item == null ? void 0 : item.amountOut) == null ? void 0 : _b.toString(),
|
|
7110
|
+
initialPrice: (_c = item == null ? void 0 : item.initialPrice) == null ? void 0 : _c.toString()
|
|
7111
|
+
});
|
|
7117
7112
|
});
|
|
7118
7113
|
return result;
|
|
7119
7114
|
};
|
|
7120
7115
|
var restituteMsafeFastRouterSwapParams = (data) => {
|
|
7121
|
-
|
|
7122
|
-
|
|
7123
|
-
|
|
7124
|
-
|
|
7125
|
-
|
|
7126
|
-
|
|
7127
|
-
return __spreadProps(__spreadValues({}, item), {
|
|
7128
|
-
amountIn: new import_bn6.default(item == null ? void 0 : item.amountIn),
|
|
7129
|
-
amountOut: new import_bn6.default(item == null ? void 0 : item.amountOut),
|
|
7130
|
-
initialPrice: new decimal_default((_a2 = item == null ? void 0 : item.initialPrice) == null ? void 0 : _a2.toString())
|
|
7131
|
-
});
|
|
7132
|
-
})
|
|
7116
|
+
const result = data == null ? void 0 : data.map((item) => {
|
|
7117
|
+
return __spreadProps(__spreadValues({}, item), {
|
|
7118
|
+
amountIn: new import_bn6.default(item == null ? void 0 : item.amountIn),
|
|
7119
|
+
amountOut: new import_bn6.default(item == null ? void 0 : item.amountOut),
|
|
7120
|
+
initialPrice: new decimal_default(item == null ? void 0 : item.initialPrice)
|
|
7121
|
+
});
|
|
7133
7122
|
});
|
|
7134
7123
|
return result;
|
|
7135
7124
|
};
|
|
@@ -7143,7 +7132,7 @@ function processEndpoint(endpoint) {
|
|
|
7143
7132
|
}
|
|
7144
7133
|
|
|
7145
7134
|
// src/api.ts
|
|
7146
|
-
var SDK_VERSION =
|
|
7135
|
+
var SDK_VERSION = 1000331;
|
|
7147
7136
|
function getRouterResult(endpoint, params) {
|
|
7148
7137
|
return __async(this, null, function* () {
|
|
7149
7138
|
let response;
|
package/dist/index.mjs
CHANGED
|
@@ -7100,34 +7100,23 @@ function getAggregatorV2ExtendPublishedAt(aggregatorV2ExtendPublishedAt, package
|
|
|
7100
7100
|
// src/utils/msafe.ts
|
|
7101
7101
|
var import_bn6 = __toESM(require_bn());
|
|
7102
7102
|
var dealWithFastRouterSwapParamsForMsafe = (data) => {
|
|
7103
|
-
|
|
7104
|
-
|
|
7105
|
-
|
|
7106
|
-
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
|
|
7110
|
-
amountIn: (_a2 = item == null ? void 0 : item.amountIn) == null ? void 0 : _a2.toString(),
|
|
7111
|
-
amountOut: (_b2 = item == null ? void 0 : item.amountOut) == null ? void 0 : _b2.toString(),
|
|
7112
|
-
initialPrice: (_c2 = item == null ? void 0 : item.initialPrice) == null ? void 0 : _c2.toString()
|
|
7113
|
-
});
|
|
7114
|
-
})
|
|
7103
|
+
const result = data == null ? void 0 : data.map((item) => {
|
|
7104
|
+
var _a, _b, _c;
|
|
7105
|
+
return __spreadProps(__spreadValues({}, item), {
|
|
7106
|
+
amountIn: (_a = item == null ? void 0 : item.amountIn) == null ? void 0 : _a.toString(),
|
|
7107
|
+
amountOut: (_b = item == null ? void 0 : item.amountOut) == null ? void 0 : _b.toString(),
|
|
7108
|
+
initialPrice: (_c = item == null ? void 0 : item.initialPrice) == null ? void 0 : _c.toString()
|
|
7109
|
+
});
|
|
7115
7110
|
});
|
|
7116
7111
|
return result;
|
|
7117
7112
|
};
|
|
7118
7113
|
var restituteMsafeFastRouterSwapParams = (data) => {
|
|
7119
|
-
|
|
7120
|
-
|
|
7121
|
-
|
|
7122
|
-
|
|
7123
|
-
|
|
7124
|
-
|
|
7125
|
-
return __spreadProps(__spreadValues({}, item), {
|
|
7126
|
-
amountIn: new import_bn6.default(item == null ? void 0 : item.amountIn),
|
|
7127
|
-
amountOut: new import_bn6.default(item == null ? void 0 : item.amountOut),
|
|
7128
|
-
initialPrice: new decimal_default((_a2 = item == null ? void 0 : item.initialPrice) == null ? void 0 : _a2.toString())
|
|
7129
|
-
});
|
|
7130
|
-
})
|
|
7114
|
+
const result = data == null ? void 0 : data.map((item) => {
|
|
7115
|
+
return __spreadProps(__spreadValues({}, item), {
|
|
7116
|
+
amountIn: new import_bn6.default(item == null ? void 0 : item.amountIn),
|
|
7117
|
+
amountOut: new import_bn6.default(item == null ? void 0 : item.amountOut),
|
|
7118
|
+
initialPrice: new decimal_default(item == null ? void 0 : item.initialPrice)
|
|
7119
|
+
});
|
|
7131
7120
|
});
|
|
7132
7121
|
return result;
|
|
7133
7122
|
};
|
|
@@ -7141,7 +7130,7 @@ function processEndpoint(endpoint) {
|
|
|
7141
7130
|
}
|
|
7142
7131
|
|
|
7143
7132
|
// src/api.ts
|
|
7144
|
-
var SDK_VERSION =
|
|
7133
|
+
var SDK_VERSION = 1000331;
|
|
7145
7134
|
function getRouterResult(endpoint, params) {
|
|
7146
7135
|
return __async(this, null, function* () {
|
|
7147
7136
|
let response;
|
package/package.json
CHANGED
package/src/api.ts
CHANGED
package/src/utils/msafe.ts
CHANGED
|
@@ -3,38 +3,28 @@ import BN from 'bn.js'
|
|
|
3
3
|
import Decimal from "decimal.js"
|
|
4
4
|
|
|
5
5
|
export const dealWithFastRouterSwapParamsForMsafe = (data: any) => {
|
|
6
|
-
const result = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
amountOut: item?.amountOut?.toString(),
|
|
15
|
-
initialPrice: item?.initialPrice?.toString()
|
|
16
|
-
}
|
|
17
|
-
})
|
|
18
|
-
}
|
|
6
|
+
const result = data?.map((item: any) => {
|
|
7
|
+
return {
|
|
8
|
+
...item,
|
|
9
|
+
amountIn: item?.amountIn?.toString(),
|
|
10
|
+
amountOut: item?.amountOut?.toString(),
|
|
11
|
+
initialPrice: item?.initialPrice?.toString()
|
|
12
|
+
}
|
|
13
|
+
} )
|
|
19
14
|
|
|
20
15
|
return result
|
|
21
16
|
}
|
|
22
17
|
|
|
23
18
|
|
|
24
19
|
export const restituteMsafeFastRouterSwapParams = (data: any) => {
|
|
25
|
-
const result = {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
amountOut: new BN(item?.amountOut),
|
|
34
|
-
initialPrice: new Decimal(item?.initialPrice?.toString())
|
|
35
|
-
}
|
|
36
|
-
})
|
|
37
|
-
}
|
|
20
|
+
const result = data?.map((item: any) => {
|
|
21
|
+
return {
|
|
22
|
+
...item,
|
|
23
|
+
amountIn: new BN(item?.amountIn),
|
|
24
|
+
amountOut: new BN(item?.amountOut),
|
|
25
|
+
initialPrice: new Decimal(item?.initialPrice)
|
|
26
|
+
}
|
|
27
|
+
} )
|
|
38
28
|
|
|
39
29
|
return result
|
|
40
30
|
}
|