@xchainjs/xchain-thorchain-amm 0.8.15 → 0.8.17
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 +2 -1
- package/lib/index.js +2 -1
- package/package.json +3 -3
package/lib/index.esm.js
CHANGED
|
@@ -126,10 +126,11 @@ class EvmHelper {
|
|
|
126
126
|
return __awaiter(this, void 0, void 0, function* () {
|
|
127
127
|
const contractAddress = getContractAddressFromAsset(asset);
|
|
128
128
|
const router = yield this.thorchainCache.getRouterAddressForChain(asset.chain);
|
|
129
|
+
const decimals = yield this.thorchainCache.midgardQuery.getDecimalForAsset(asset);
|
|
129
130
|
const approveParams = {
|
|
130
131
|
contractAddress,
|
|
131
132
|
spenderAddress: router,
|
|
132
|
-
amount: baseAmount(amount.toString(),
|
|
133
|
+
amount: baseAmount(amount.toString(), decimals),
|
|
133
134
|
walletIndex,
|
|
134
135
|
};
|
|
135
136
|
return yield this.evmClient.approve(approveParams);
|
package/lib/index.js
CHANGED
|
@@ -130,10 +130,11 @@ class EvmHelper {
|
|
|
130
130
|
return __awaiter(this, void 0, void 0, function* () {
|
|
131
131
|
const contractAddress = xchainUtil.getContractAddressFromAsset(asset);
|
|
132
132
|
const router = yield this.thorchainCache.getRouterAddressForChain(asset.chain);
|
|
133
|
+
const decimals = yield this.thorchainCache.midgardQuery.getDecimalForAsset(asset);
|
|
133
134
|
const approveParams = {
|
|
134
135
|
contractAddress,
|
|
135
136
|
spenderAddress: router,
|
|
136
|
-
amount: xchainUtil.baseAmount(amount.toString(),
|
|
137
|
+
amount: xchainUtil.baseAmount(amount.toString(), decimals),
|
|
137
138
|
walletIndex,
|
|
138
139
|
};
|
|
139
140
|
return yield this.evmClient.approve(approveParams);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xchainjs/xchain-thorchain-amm",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.17",
|
|
4
4
|
"description": "module that exposes estimating & swappping cryptocurrency assets on thorchain",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"THORChain",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@xchainjs/xchain-thornode": "^0.3.10",
|
|
56
56
|
"@xchainjs/xchain-evm": "^0.4.4",
|
|
57
57
|
"@xchainjs/xchain-litecoin": "^0.13.9",
|
|
58
|
-
"@xchainjs/xchain-mayachain": "^0.2.
|
|
58
|
+
"@xchainjs/xchain-mayachain": "^0.2.15",
|
|
59
59
|
"@xchainjs/xchain-midgard": "^0.5.2",
|
|
60
60
|
"@xchainjs/xchain-thorchain": "^0.28.17",
|
|
61
61
|
"@xchainjs/xchain-util": "^0.13.1",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"@xchainjs/xchain-thornode": "^0.3.10",
|
|
88
88
|
"@xchainjs/xchain-evm": "^0.4.4",
|
|
89
89
|
"@xchainjs/xchain-litecoin": "^0.13.9",
|
|
90
|
-
"@xchainjs/xchain-mayachain": "^0.2.
|
|
90
|
+
"@xchainjs/xchain-mayachain": "^0.2.15",
|
|
91
91
|
"@xchainjs/xchain-midgard": "^0.5.2",
|
|
92
92
|
"@xchainjs/xchain-thorchain": "^0.28.17",
|
|
93
93
|
"@xchainjs/xchain-util": "^0.13.1",
|