@xchainjs/xchain-thorchain-amm 0.3.6 → 0.3.7
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/lib/index.esm.js +14 -12
- package/lib/index.js +14 -12
- package/package.json +1 -1
package/lib/index.esm.js
CHANGED
|
@@ -997,14 +997,16 @@ class ThorchainAMM {
|
|
|
997
997
|
* @returns The SwapEstimate
|
|
998
998
|
*/
|
|
999
999
|
estimateSwap({ input, destinationAsset, destinationAddress, affiliateAddress = '', interfaceID = `555`, affiliateFeeBasisPoints = 0, slipLimit, }) {
|
|
1000
|
-
return this
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1000
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1001
|
+
return yield this.thorchainQuery.estimateSwap({
|
|
1002
|
+
input,
|
|
1003
|
+
destinationAsset,
|
|
1004
|
+
destinationAddress,
|
|
1005
|
+
affiliateAddress,
|
|
1006
|
+
interfaceID,
|
|
1007
|
+
affiliateFeeBasisPoints,
|
|
1008
|
+
slipLimit,
|
|
1009
|
+
});
|
|
1008
1010
|
});
|
|
1009
1011
|
}
|
|
1010
1012
|
/**
|
|
@@ -1037,7 +1039,7 @@ class ThorchainAMM {
|
|
|
1037
1039
|
*/
|
|
1038
1040
|
estimateAddLiquidity(params) {
|
|
1039
1041
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1040
|
-
return this.thorchainQuery.estimateAddLP(params);
|
|
1042
|
+
return yield this.thorchainQuery.estimateAddLP(params);
|
|
1041
1043
|
});
|
|
1042
1044
|
}
|
|
1043
1045
|
/**
|
|
@@ -1047,7 +1049,7 @@ class ThorchainAMM {
|
|
|
1047
1049
|
*/
|
|
1048
1050
|
estimateWithdrawLiquidity(params) {
|
|
1049
1051
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1050
|
-
return this.thorchainQuery.estimateWithdrawLP(params);
|
|
1052
|
+
return yield this.thorchainQuery.estimateWithdrawLP(params);
|
|
1051
1053
|
});
|
|
1052
1054
|
}
|
|
1053
1055
|
/**
|
|
@@ -1062,7 +1064,7 @@ class ThorchainAMM {
|
|
|
1062
1064
|
const checkLPAdd = yield this.thorchainQuery.estimateAddLP(params);
|
|
1063
1065
|
if (!checkLPAdd.canAdd)
|
|
1064
1066
|
throw Error(`${checkLPAdd.errors}`);
|
|
1065
|
-
return wallet.addLiquidity({
|
|
1067
|
+
return yield wallet.addLiquidity({
|
|
1066
1068
|
asset: params.asset,
|
|
1067
1069
|
rune: params.rune,
|
|
1068
1070
|
waitTimeSeconds: checkLPAdd.estimatedWaitSeconds,
|
|
@@ -1080,7 +1082,7 @@ class ThorchainAMM {
|
|
|
1080
1082
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1081
1083
|
// Caution Dust Limits: BTC,BCH,LTC chains 10k sats; DOGE 1m Sats; ETH 0 wei; THOR 0 RUNE.
|
|
1082
1084
|
const withdrawParams = yield this.thorchainQuery.estimateWithdrawLP(params);
|
|
1083
|
-
return wallet.withdrawLiquidity({
|
|
1085
|
+
return yield wallet.withdrawLiquidity({
|
|
1084
1086
|
assetFee: withdrawParams.inbound.fees.asset,
|
|
1085
1087
|
runeFee: withdrawParams.inbound.fees.rune,
|
|
1086
1088
|
waitTimeSeconds: withdrawParams.estimatedWaitSeconds,
|
package/lib/index.js
CHANGED
|
@@ -1001,14 +1001,16 @@ class ThorchainAMM {
|
|
|
1001
1001
|
* @returns The SwapEstimate
|
|
1002
1002
|
*/
|
|
1003
1003
|
estimateSwap({ input, destinationAsset, destinationAddress, affiliateAddress = '', interfaceID = `555`, affiliateFeeBasisPoints = 0, slipLimit, }) {
|
|
1004
|
-
return this
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1004
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1005
|
+
return yield this.thorchainQuery.estimateSwap({
|
|
1006
|
+
input,
|
|
1007
|
+
destinationAsset,
|
|
1008
|
+
destinationAddress,
|
|
1009
|
+
affiliateAddress,
|
|
1010
|
+
interfaceID,
|
|
1011
|
+
affiliateFeeBasisPoints,
|
|
1012
|
+
slipLimit,
|
|
1013
|
+
});
|
|
1012
1014
|
});
|
|
1013
1015
|
}
|
|
1014
1016
|
/**
|
|
@@ -1041,7 +1043,7 @@ class ThorchainAMM {
|
|
|
1041
1043
|
*/
|
|
1042
1044
|
estimateAddLiquidity(params) {
|
|
1043
1045
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1044
|
-
return this.thorchainQuery.estimateAddLP(params);
|
|
1046
|
+
return yield this.thorchainQuery.estimateAddLP(params);
|
|
1045
1047
|
});
|
|
1046
1048
|
}
|
|
1047
1049
|
/**
|
|
@@ -1051,7 +1053,7 @@ class ThorchainAMM {
|
|
|
1051
1053
|
*/
|
|
1052
1054
|
estimateWithdrawLiquidity(params) {
|
|
1053
1055
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1054
|
-
return this.thorchainQuery.estimateWithdrawLP(params);
|
|
1056
|
+
return yield this.thorchainQuery.estimateWithdrawLP(params);
|
|
1055
1057
|
});
|
|
1056
1058
|
}
|
|
1057
1059
|
/**
|
|
@@ -1066,7 +1068,7 @@ class ThorchainAMM {
|
|
|
1066
1068
|
const checkLPAdd = yield this.thorchainQuery.estimateAddLP(params);
|
|
1067
1069
|
if (!checkLPAdd.canAdd)
|
|
1068
1070
|
throw Error(`${checkLPAdd.errors}`);
|
|
1069
|
-
return wallet.addLiquidity({
|
|
1071
|
+
return yield wallet.addLiquidity({
|
|
1070
1072
|
asset: params.asset,
|
|
1071
1073
|
rune: params.rune,
|
|
1072
1074
|
waitTimeSeconds: checkLPAdd.estimatedWaitSeconds,
|
|
@@ -1084,7 +1086,7 @@ class ThorchainAMM {
|
|
|
1084
1086
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1085
1087
|
// Caution Dust Limits: BTC,BCH,LTC chains 10k sats; DOGE 1m Sats; ETH 0 wei; THOR 0 RUNE.
|
|
1086
1088
|
const withdrawParams = yield this.thorchainQuery.estimateWithdrawLP(params);
|
|
1087
|
-
return wallet.withdrawLiquidity({
|
|
1089
|
+
return yield wallet.withdrawLiquidity({
|
|
1088
1090
|
assetFee: withdrawParams.inbound.fees.asset,
|
|
1089
1091
|
runeFee: withdrawParams.inbound.fees.rune,
|
|
1090
1092
|
waitTimeSeconds: withdrawParams.estimatedWaitSeconds,
|