@xchainjs/xchain-mayachain-amm 4.0.7 → 4.0.8
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 +25 -21
- package/lib/index.js +4 -0
- package/package.json +3 -2
package/lib/index.esm.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { AssetAETH, ARBChain, Client, defaultArbParams } from '@xchainjs/xchain-arbitrum';
|
|
2
|
-
import {
|
|
2
|
+
import { ZECChain, Client as Client$1, defaultZECParams } from '@xchainjs/xchain-zcash';
|
|
3
|
+
import { BTCChain, Client as Client$8, defaultBTCParams } from '@xchainjs/xchain-bitcoin';
|
|
3
4
|
import { Network } from '@xchainjs/xchain-client';
|
|
4
|
-
import { DASHChain, Client as Client$
|
|
5
|
-
import { AssetETH, ETHChain, Client as Client$
|
|
5
|
+
import { DASHChain, Client as Client$6, defaultDashParams } from '@xchainjs/xchain-dash';
|
|
6
|
+
import { AssetETH, ETHChain, Client as Client$7, defaultEthParams } from '@xchainjs/xchain-ethereum';
|
|
6
7
|
import { abi, MAX_APPROVAL } from '@xchainjs/xchain-evm';
|
|
7
|
-
import { AssetKUJI, KUJIChain, Client as Client$
|
|
8
|
-
import { MAYAChain, Client as Client$
|
|
8
|
+
import { AssetKUJI, KUJIChain, Client as Client$5, defaultKujiParams } from '@xchainjs/xchain-kujira';
|
|
9
|
+
import { MAYAChain, Client as Client$3, CACAO_DECIMAL, AssetCacao } from '@xchainjs/xchain-mayachain';
|
|
9
10
|
import { MayachainQuery } from '@xchainjs/xchain-mayachain-query';
|
|
10
|
-
import { RadixChain, Client as Client$
|
|
11
|
-
import { AssetRuneNative, THORChain, Client as Client$
|
|
11
|
+
import { RadixChain, Client as Client$2, AssetXRD, generateAddressParam, generateBucketParam, generateStringParam } from '@xchainjs/xchain-radix';
|
|
12
|
+
import { AssetRuneNative, THORChain, Client as Client$4 } from '@xchainjs/xchain-thorchain';
|
|
12
13
|
import { eqAsset, isSynthAsset, getContractAddressFromAsset, baseAmount, CryptoAmount, assetToString, AssetCryptoAmount } from '@xchainjs/xchain-util';
|
|
13
14
|
import { Wallet } from '@xchainjs/xchain-wallet';
|
|
14
15
|
import { ethers } from 'ethers';
|
|
@@ -93,19 +94,21 @@ const isRadixChain = (chain) => {
|
|
|
93
94
|
const validateAddress = (network, chain, address) => {
|
|
94
95
|
switch (chain) {
|
|
95
96
|
case BTCChain:
|
|
96
|
-
return new Client$
|
|
97
|
+
return new Client$8(Object.assign(Object.assign({}, defaultBTCParams), { network })).validateAddress(address);
|
|
97
98
|
case ETHChain:
|
|
98
|
-
return new Client$
|
|
99
|
+
return new Client$7(Object.assign(Object.assign({}, defaultEthParams), { network })).validateAddress(address);
|
|
99
100
|
case DASHChain:
|
|
100
|
-
return new Client$
|
|
101
|
+
return new Client$6(Object.assign(Object.assign({}, defaultDashParams), { network })).validateAddress(address);
|
|
101
102
|
case KUJIChain:
|
|
102
|
-
return new Client$
|
|
103
|
+
return new Client$5(Object.assign(Object.assign({}, defaultKujiParams), { network })).validateAddress(address);
|
|
103
104
|
case THORChain:
|
|
104
|
-
return new Client$
|
|
105
|
+
return new Client$4({ network }).validateAddress(address);
|
|
105
106
|
case MAYAChain:
|
|
106
|
-
return new Client$
|
|
107
|
+
return new Client$3({ network }).validateAddress(address);
|
|
107
108
|
case RadixChain:
|
|
108
|
-
return new Client$
|
|
109
|
+
return new Client$2({ network }).validateAddress(address);
|
|
110
|
+
case ZECChain:
|
|
111
|
+
return new Client$1(Object.assign(Object.assign({}, defaultZECParams), { network })).validateAddress(address);
|
|
109
112
|
case ARBChain:
|
|
110
113
|
return new Client(Object.assign(Object.assign({}, defaultArbParams), { network: Network.Mainnet })).validateAddress(address);
|
|
111
114
|
default:
|
|
@@ -254,14 +257,15 @@ class MayachainAMM {
|
|
|
254
257
|
* @returns {MayachainAMM} Returns the MayachainAMM instance.
|
|
255
258
|
*/
|
|
256
259
|
constructor(mayachainQuery = new MayachainQuery(), wallet = new Wallet({
|
|
257
|
-
BTC: new Client$
|
|
258
|
-
ETH: new Client$
|
|
259
|
-
DASH: new Client$
|
|
260
|
-
KUJI: new Client$
|
|
260
|
+
BTC: new Client$8(Object.assign(Object.assign({}, defaultBTCParams), { network: Network.Mainnet })),
|
|
261
|
+
ETH: new Client$7(Object.assign(Object.assign({}, defaultEthParams), { network: Network.Mainnet })),
|
|
262
|
+
DASH: new Client$6(Object.assign(Object.assign({}, defaultDashParams), { network: Network.Mainnet })),
|
|
263
|
+
KUJI: new Client$5(Object.assign(Object.assign({}, defaultKujiParams), { network: Network.Mainnet })),
|
|
261
264
|
ARB: new Client(Object.assign(Object.assign({}, defaultArbParams), { network: Network.Mainnet })),
|
|
262
|
-
THOR: new Client$
|
|
263
|
-
MAYA: new Client$
|
|
264
|
-
XRD: new Client$
|
|
265
|
+
THOR: new Client$4({ network: Network.Mainnet }),
|
|
266
|
+
MAYA: new Client$3({ network: Network.Mainnet }),
|
|
267
|
+
XRD: new Client$2({ network: Network.Mainnet }),
|
|
268
|
+
ZEC: new Client$1(Object.assign(Object.assign({}, defaultZECParams), { network: Network.Mainnet })),
|
|
265
269
|
})) {
|
|
266
270
|
this.mayachainQuery = mayachainQuery;
|
|
267
271
|
this.wallet = wallet;
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var xchainArbitrum = require('@xchainjs/xchain-arbitrum');
|
|
4
|
+
var xchainZcash = require('@xchainjs/xchain-zcash');
|
|
4
5
|
var xchainBitcoin = require('@xchainjs/xchain-bitcoin');
|
|
5
6
|
var xchainClient = require('@xchainjs/xchain-client');
|
|
6
7
|
var xchainDash = require('@xchainjs/xchain-dash');
|
|
@@ -108,6 +109,8 @@ const validateAddress = (network, chain, address) => {
|
|
|
108
109
|
return new xchainMayachain.Client({ network }).validateAddress(address);
|
|
109
110
|
case xchainRadix.RadixChain:
|
|
110
111
|
return new xchainRadix.Client({ network }).validateAddress(address);
|
|
112
|
+
case xchainZcash.ZECChain:
|
|
113
|
+
return new xchainZcash.Client(Object.assign(Object.assign({}, xchainZcash.defaultZECParams), { network })).validateAddress(address);
|
|
111
114
|
case xchainArbitrum.ARBChain:
|
|
112
115
|
return new xchainArbitrum.Client(Object.assign(Object.assign({}, xchainArbitrum.defaultArbParams), { network: xchainClient.Network.Mainnet })).validateAddress(address);
|
|
113
116
|
default:
|
|
@@ -264,6 +267,7 @@ class MayachainAMM {
|
|
|
264
267
|
THOR: new xchainThorchain.Client({ network: xchainClient.Network.Mainnet }),
|
|
265
268
|
MAYA: new xchainMayachain.Client({ network: xchainClient.Network.Mainnet }),
|
|
266
269
|
XRD: new xchainRadix.Client({ network: xchainClient.Network.Mainnet }),
|
|
270
|
+
ZEC: new xchainZcash.Client(Object.assign(Object.assign({}, xchainZcash.defaultZECParams), { network: xchainClient.Network.Mainnet })),
|
|
267
271
|
})) {
|
|
268
272
|
this.mayachainQuery = mayachainQuery;
|
|
269
273
|
this.wallet = wallet;
|
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.8",
|
|
4
4
|
"description": "module that exposes estimating & swapping cryptocurrency assets on mayachain",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"MAYAChain",
|
|
@@ -45,11 +45,12 @@
|
|
|
45
45
|
"@xchainjs/xchain-evm": "2.0.2",
|
|
46
46
|
"@xchainjs/xchain-kujira": "2.0.1",
|
|
47
47
|
"@xchainjs/xchain-mayachain": "3.0.1",
|
|
48
|
-
"@xchainjs/xchain-mayachain-query": "2.0.
|
|
48
|
+
"@xchainjs/xchain-mayachain-query": "2.0.3",
|
|
49
49
|
"@xchainjs/xchain-radix": "2.0.1",
|
|
50
50
|
"@xchainjs/xchain-thorchain": "3.0.5",
|
|
51
51
|
"@xchainjs/xchain-util": "2.0.0",
|
|
52
52
|
"@xchainjs/xchain-wallet": "2.0.6",
|
|
53
|
+
"@xchainjs/xchain-zcash": "1.0.2",
|
|
53
54
|
"ethers": "5.7.2"
|
|
54
55
|
},
|
|
55
56
|
"devDependencies": {
|