@xchainjs/xchain-thorchain-amm 2.0.3 → 2.0.5

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 CHANGED
@@ -381,6 +381,10 @@ class ThorchainAMM {
381
381
  isRouterApprovedToSpend({ asset, amount, address }) {
382
382
  return __awaiter(this, void 0, void 0, function* () {
383
383
  const errors = [];
384
+ if (!isProtocolERC20Asset(asset)) {
385
+ errors.push('Asset should be ERC20');
386
+ return errors;
387
+ }
384
388
  const inboundDetails = yield this.thorchainQuery.getChainInboundDetails(asset.chain);
385
389
  if (!inboundDetails.router)
386
390
  throw Error(`Unknown router address for ${asset.chain}`);
package/lib/index.js CHANGED
@@ -385,6 +385,10 @@ class ThorchainAMM {
385
385
  isRouterApprovedToSpend({ asset, amount, address }) {
386
386
  return __awaiter(this, void 0, void 0, function* () {
387
387
  const errors = [];
388
+ if (!isProtocolERC20Asset(asset)) {
389
+ errors.push('Asset should be ERC20');
390
+ return errors;
391
+ }
388
392
  const inboundDetails = yield this.thorchainQuery.getChainInboundDetails(asset.chain);
389
393
  if (!inboundDetails.router)
390
394
  throw Error(`Unknown router address for ${asset.chain}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xchainjs/xchain-thorchain-amm",
3
- "version": "2.0.3",
3
+ "version": "2.0.5",
4
4
  "description": "module that exposes estimating & swappping cryptocurrency assets on thorchain",
5
5
  "keywords": [
6
6
  "THORChain",
@@ -36,21 +36,21 @@
36
36
  "url": "https://github.com/xchainjs/xchainjs-lib/issues"
37
37
  },
38
38
  "dependencies": {
39
- "@xchainjs/xchain-avax": "1.0.3",
40
- "@xchainjs/xchain-binance": "6.0.1",
41
- "@xchainjs/xchain-bitcoin": "1.0.1",
42
- "@xchainjs/xchain-bitcoincash": "1.0.1",
43
- "@xchainjs/xchain-bsc": "1.0.3",
44
- "@xchainjs/xchain-client": "1.0.1",
45
- "@xchainjs/xchain-cosmos": "2.0.1",
46
- "@xchainjs/xchain-doge": "1.0.1",
47
- "@xchainjs/xchain-ethereum": "1.0.3",
48
- "@xchainjs/xchain-evm": "1.0.3",
49
- "@xchainjs/xchain-litecoin": "1.0.1",
50
- "@xchainjs/xchain-thorchain": "2.0.1",
51
- "@xchainjs/xchain-thorchain-query": "1.0.1",
52
- "@xchainjs/xchain-util": "1.0.0",
53
- "@xchainjs/xchain-wallet": "1.0.3",
39
+ "@xchainjs/xchain-avax": "1.0.4",
40
+ "@xchainjs/xchain-binance": "6.0.2",
41
+ "@xchainjs/xchain-bitcoin": "1.0.2",
42
+ "@xchainjs/xchain-bitcoincash": "1.0.2",
43
+ "@xchainjs/xchain-bsc": "1.0.4",
44
+ "@xchainjs/xchain-client": "1.0.2",
45
+ "@xchainjs/xchain-cosmos": "2.0.2",
46
+ "@xchainjs/xchain-doge": "1.0.2",
47
+ "@xchainjs/xchain-ethereum": "1.0.4",
48
+ "@xchainjs/xchain-evm": "1.0.4",
49
+ "@xchainjs/xchain-litecoin": "1.0.2",
50
+ "@xchainjs/xchain-thorchain": "2.0.3",
51
+ "@xchainjs/xchain-thorchain-query": "1.0.2",
52
+ "@xchainjs/xchain-util": "1.0.1",
53
+ "@xchainjs/xchain-wallet": "1.0.5",
54
54
  "ethers": "5.7.2"
55
55
  },
56
56
  "devDependencies": {