@chainflip/sdk 2.0.2-dev.1 → 2.0.2-dev.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/swap.cjs +6 -6
- package/dist/swap.js +6 -6
- package/package.json +1 -1
package/dist/swap.cjs
CHANGED
|
@@ -940,7 +940,7 @@ var getChainData = (chain2, network, env) => ({
|
|
|
940
940
|
|
|
941
941
|
// package.json
|
|
942
942
|
var package_default = {
|
|
943
|
-
version: "2.0.2-dev.
|
|
943
|
+
version: "2.0.2-dev.2"};
|
|
944
944
|
|
|
945
945
|
// src/swap/consts.ts
|
|
946
946
|
var CF_SDK_VERSION_HEADERS = { "X-Chainflip-Sdk-Version": package_default.version };
|
|
@@ -1191,7 +1191,7 @@ var SwapSDK = class {
|
|
|
1191
1191
|
ccmParams,
|
|
1192
1192
|
amount: quote.depositAmount
|
|
1193
1193
|
};
|
|
1194
|
-
await this.checkLivePriceProtectionRequirement(depositAddressRequest);
|
|
1194
|
+
await this.checkLivePriceProtectionRequirement(depositAddressRequest, quote);
|
|
1195
1195
|
let response;
|
|
1196
1196
|
if (this.options.broker) {
|
|
1197
1197
|
const result = await requestSwapDepositAddress(
|
|
@@ -1282,7 +1282,7 @@ var SwapSDK = class {
|
|
|
1282
1282
|
commissionBps: brokerCommissionBps,
|
|
1283
1283
|
affiliates
|
|
1284
1284
|
};
|
|
1285
|
-
await this.checkLivePriceProtectionRequirement(vaultSwapRequest);
|
|
1285
|
+
await this.checkLivePriceProtectionRequirement(vaultSwapRequest, quote);
|
|
1286
1286
|
if (this.options.broker) {
|
|
1287
1287
|
assert(
|
|
1288
1288
|
!vaultSwapRequest.brokerAccount,
|
|
@@ -1344,7 +1344,7 @@ var SwapSDK = class {
|
|
|
1344
1344
|
commissionBps: await this.getCommissionBps(brokerCommissionBps),
|
|
1345
1345
|
affiliates
|
|
1346
1346
|
};
|
|
1347
|
-
await this.checkLivePriceProtectionRequirement(requestParams);
|
|
1347
|
+
await this.checkLivePriceProtectionRequirement(requestParams, quote);
|
|
1348
1348
|
if (this.options.broker) {
|
|
1349
1349
|
assert(
|
|
1350
1350
|
!brokerAccount,
|
|
@@ -1391,8 +1391,8 @@ var SwapSDK = class {
|
|
|
1391
1391
|
}
|
|
1392
1392
|
return res.body;
|
|
1393
1393
|
}
|
|
1394
|
-
async checkLivePriceProtectionRequirement(request) {
|
|
1395
|
-
if (!this.dcaV2Enabled) return;
|
|
1394
|
+
async checkLivePriceProtectionRequirement(request, quote) {
|
|
1395
|
+
if (!this.dcaV2Enabled || quote.type !== "DCA") return;
|
|
1396
1396
|
const { assets: assets2 } = await this.cache.read("networkInfo");
|
|
1397
1397
|
const srcAsset = chainflip.getInternalAsset(request.srcAsset);
|
|
1398
1398
|
const destAsset = chainflip.getInternalAsset(request.destAsset);
|
package/dist/swap.js
CHANGED
|
@@ -745,7 +745,7 @@ var getChainData = (chain2, network, env) => ({
|
|
|
745
745
|
|
|
746
746
|
// package.json
|
|
747
747
|
var package_default = {
|
|
748
|
-
version: "2.0.2-dev.
|
|
748
|
+
version: "2.0.2-dev.2"};
|
|
749
749
|
|
|
750
750
|
// src/swap/consts.ts
|
|
751
751
|
var CF_SDK_VERSION_HEADERS = { "X-Chainflip-Sdk-Version": package_default.version };
|
|
@@ -996,7 +996,7 @@ var SwapSDK = class {
|
|
|
996
996
|
ccmParams,
|
|
997
997
|
amount: quote.depositAmount
|
|
998
998
|
};
|
|
999
|
-
await this.checkLivePriceProtectionRequirement(depositAddressRequest);
|
|
999
|
+
await this.checkLivePriceProtectionRequirement(depositAddressRequest, quote);
|
|
1000
1000
|
let response;
|
|
1001
1001
|
if (this.options.broker) {
|
|
1002
1002
|
const result = await requestSwapDepositAddress(
|
|
@@ -1087,7 +1087,7 @@ var SwapSDK = class {
|
|
|
1087
1087
|
commissionBps: brokerCommissionBps,
|
|
1088
1088
|
affiliates
|
|
1089
1089
|
};
|
|
1090
|
-
await this.checkLivePriceProtectionRequirement(vaultSwapRequest);
|
|
1090
|
+
await this.checkLivePriceProtectionRequirement(vaultSwapRequest, quote);
|
|
1091
1091
|
if (this.options.broker) {
|
|
1092
1092
|
assert(
|
|
1093
1093
|
!vaultSwapRequest.brokerAccount,
|
|
@@ -1149,7 +1149,7 @@ var SwapSDK = class {
|
|
|
1149
1149
|
commissionBps: await this.getCommissionBps(brokerCommissionBps),
|
|
1150
1150
|
affiliates
|
|
1151
1151
|
};
|
|
1152
|
-
await this.checkLivePriceProtectionRequirement(requestParams);
|
|
1152
|
+
await this.checkLivePriceProtectionRequirement(requestParams, quote);
|
|
1153
1153
|
if (this.options.broker) {
|
|
1154
1154
|
assert(
|
|
1155
1155
|
!brokerAccount,
|
|
@@ -1196,8 +1196,8 @@ var SwapSDK = class {
|
|
|
1196
1196
|
}
|
|
1197
1197
|
return res.body;
|
|
1198
1198
|
}
|
|
1199
|
-
async checkLivePriceProtectionRequirement(request) {
|
|
1200
|
-
if (!this.dcaV2Enabled) return;
|
|
1199
|
+
async checkLivePriceProtectionRequirement(request, quote) {
|
|
1200
|
+
if (!this.dcaV2Enabled || quote.type !== "DCA") return;
|
|
1201
1201
|
const { assets: assets2 } = await this.cache.read("networkInfo");
|
|
1202
1202
|
const srcAsset = getInternalAsset(request.srcAsset);
|
|
1203
1203
|
const destAsset = getInternalAsset(request.destAsset);
|