@xchainjs/xchain-mayachain-amm 4.0.8 → 4.0.10
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 +5 -5
- package/lib/index.js +4 -4
- package/package.json +18 -18
package/lib/index.esm.js
CHANGED
|
@@ -12,7 +12,7 @@ import { RadixChain, Client as Client$2, AssetXRD, generateAddressParam, generat
|
|
|
12
12
|
import { AssetRuneNative, THORChain, Client as Client$4 } from '@xchainjs/xchain-thorchain';
|
|
13
13
|
import { eqAsset, isSynthAsset, getContractAddressFromAsset, baseAmount, CryptoAmount, assetToString, AssetCryptoAmount } from '@xchainjs/xchain-util';
|
|
14
14
|
import { Wallet } from '@xchainjs/xchain-wallet';
|
|
15
|
-
import {
|
|
15
|
+
import { getAddress, ZeroAddress, Contract } from 'ethers';
|
|
16
16
|
|
|
17
17
|
/******************************************************************************
|
|
18
18
|
Copyright (c) Microsoft Corporation.
|
|
@@ -202,8 +202,8 @@ class MayachainAction {
|
|
|
202
202
|
// Evm
|
|
203
203
|
const isERC20 = isProtocolERC20Asset(assetAmount.asset);
|
|
204
204
|
const checkSummedContractAddress = isERC20
|
|
205
|
-
?
|
|
206
|
-
:
|
|
205
|
+
? getAddress(getContractAddressFromAsset(assetAmount.asset))
|
|
206
|
+
: ZeroAddress;
|
|
207
207
|
const expiration = Math.floor(new Date(new Date().getTime() + 15 * 60000).getTime() / 1000);
|
|
208
208
|
const depositParams = [
|
|
209
209
|
recipient,
|
|
@@ -212,9 +212,9 @@ class MayachainAction {
|
|
|
212
212
|
memo,
|
|
213
213
|
expiration,
|
|
214
214
|
];
|
|
215
|
-
const routerContract = new
|
|
215
|
+
const routerContract = new Contract(inboundDetails.router, abi.router);
|
|
216
216
|
const gasPrices = yield wallet.getFeeRates(assetAmount.asset.chain);
|
|
217
|
-
const unsignedTx = yield routerContract.populateTransaction
|
|
217
|
+
const unsignedTx = yield routerContract.getFunction('depositWithExpiry').populateTransaction(...depositParams);
|
|
218
218
|
const nativeAsset = wallet.getAssetInfo(assetAmount.asset.chain);
|
|
219
219
|
const tx = {
|
|
220
220
|
asset: nativeAsset.asset,
|
package/lib/index.js
CHANGED
|
@@ -204,8 +204,8 @@ class MayachainAction {
|
|
|
204
204
|
// Evm
|
|
205
205
|
const isERC20 = isProtocolERC20Asset(assetAmount.asset);
|
|
206
206
|
const checkSummedContractAddress = isERC20
|
|
207
|
-
? ethers.
|
|
208
|
-
: ethers.
|
|
207
|
+
? ethers.getAddress(xchainUtil.getContractAddressFromAsset(assetAmount.asset))
|
|
208
|
+
: ethers.ZeroAddress;
|
|
209
209
|
const expiration = Math.floor(new Date(new Date().getTime() + 15 * 60000).getTime() / 1000);
|
|
210
210
|
const depositParams = [
|
|
211
211
|
recipient,
|
|
@@ -214,9 +214,9 @@ class MayachainAction {
|
|
|
214
214
|
memo,
|
|
215
215
|
expiration,
|
|
216
216
|
];
|
|
217
|
-
const routerContract = new ethers.
|
|
217
|
+
const routerContract = new ethers.Contract(inboundDetails.router, xchainEvm.abi.router);
|
|
218
218
|
const gasPrices = yield wallet.getFeeRates(assetAmount.asset.chain);
|
|
219
|
-
const unsignedTx = yield routerContract.populateTransaction
|
|
219
|
+
const unsignedTx = yield routerContract.getFunction('depositWithExpiry').populateTransaction(...depositParams);
|
|
220
220
|
const nativeAsset = wallet.getAssetInfo(assetAmount.asset.chain);
|
|
221
221
|
const tx = {
|
|
222
222
|
asset: nativeAsset.asset,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xchainjs/xchain-mayachain-amm",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.10",
|
|
4
4
|
"description": "module that exposes estimating & swapping cryptocurrency assets on mayachain",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"MAYAChain",
|
|
@@ -36,27 +36,27 @@
|
|
|
36
36
|
"url": "https://github.com/xchainjs/xchainjs-lib/issues"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@xchainjs/xchain-arbitrum": "2.0.
|
|
40
|
-
"@xchainjs/xchain-bitcoin": "2.0.
|
|
41
|
-
"@xchainjs/xchain-client": "2.0.
|
|
42
|
-
"@xchainjs/xchain-crypto": "1.0.
|
|
43
|
-
"@xchainjs/xchain-dash": "2.0.
|
|
44
|
-
"@xchainjs/xchain-ethereum": "2.0.
|
|
45
|
-
"@xchainjs/xchain-evm": "2.0.
|
|
46
|
-
"@xchainjs/xchain-kujira": "2.0.
|
|
47
|
-
"@xchainjs/xchain-mayachain": "3.0.
|
|
48
|
-
"@xchainjs/xchain-mayachain-query": "2.0.
|
|
49
|
-
"@xchainjs/xchain-radix": "2.0.
|
|
50
|
-
"@xchainjs/xchain-thorchain": "3.0.
|
|
51
|
-
"@xchainjs/xchain-util": "2.0.
|
|
52
|
-
"@xchainjs/xchain-wallet": "2.0.
|
|
53
|
-
"@xchainjs/xchain-zcash": "1.0.
|
|
54
|
-
"ethers": "
|
|
39
|
+
"@xchainjs/xchain-arbitrum": "2.0.4",
|
|
40
|
+
"@xchainjs/xchain-bitcoin": "2.0.2",
|
|
41
|
+
"@xchainjs/xchain-client": "2.0.2",
|
|
42
|
+
"@xchainjs/xchain-crypto": "1.0.1",
|
|
43
|
+
"@xchainjs/xchain-dash": "2.0.2",
|
|
44
|
+
"@xchainjs/xchain-ethereum": "2.0.5",
|
|
45
|
+
"@xchainjs/xchain-evm": "2.0.4",
|
|
46
|
+
"@xchainjs/xchain-kujira": "2.0.2",
|
|
47
|
+
"@xchainjs/xchain-mayachain": "3.0.2",
|
|
48
|
+
"@xchainjs/xchain-mayachain-query": "2.0.4",
|
|
49
|
+
"@xchainjs/xchain-radix": "2.0.2",
|
|
50
|
+
"@xchainjs/xchain-thorchain": "3.0.6",
|
|
51
|
+
"@xchainjs/xchain-util": "2.0.1",
|
|
52
|
+
"@xchainjs/xchain-wallet": "2.0.8",
|
|
53
|
+
"@xchainjs/xchain-zcash": "1.0.3",
|
|
54
|
+
"ethers": "^6.14.3"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@ledgerhq/hw-transport-node-hid": "6.28.6",
|
|
58
58
|
"axios": "1.8.4",
|
|
59
|
-
"axios-mock-adapter": "1.
|
|
59
|
+
"axios-mock-adapter": "2.1.0"
|
|
60
60
|
},
|
|
61
61
|
"publishConfig": {
|
|
62
62
|
"access": "public",
|