@shapeshiftoss/swapper 1.16.0 → 2.0.2

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/dist/index.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -25,7 +25,7 @@ async function getZrxSendMaxAmount({ adapterManager }, { wallet, quote, sellAsse
25
25
  let balance;
26
26
  if (tokenId) {
27
27
  balance = (_c = (_b = account.chainSpecific.tokens) === null || _b === void 0 ? void 0 : _b.find((token) => {
28
- return caip_1.caip19.fromCAIP19(token.caip19).tokenId === tokenId.toLowerCase();
28
+ return caip_1.caip19.fromCAIP19(token.caip19).assetReference === tokenId.toLowerCase();
29
29
  })) === null || _c === void 0 ? void 0 : _c.balance;
30
30
  }
31
31
  else {
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FOX = exports.WETH = exports.BTC = void 0;
4
+ const caip_1 = require("@shapeshiftoss/caip");
4
5
  const types_1 = require("@shapeshiftoss/types");
5
6
  exports.BTC = {
6
7
  caip19: 'bip122:000000000019d6689c085ae165831e93/slip44:0',
@@ -11,7 +12,7 @@ exports.BTC = {
11
12
  network: types_1.NetworkTypes.MAINNET,
12
13
  precision: 8,
13
14
  slip44: 44,
14
- contractType: types_1.ContractTypes.ERC20,
15
+ contractType: caip_1.AssetNamespace.ERC20,
15
16
  color: '#FFFFFF',
16
17
  secondaryColor: '#FFFFFF',
17
18
  icon: 'https://assets.coincap.io/assets/icons/btc@2x.png',
@@ -31,7 +32,7 @@ exports.WETH = {
31
32
  network: types_1.NetworkTypes.MAINNET,
32
33
  precision: 18,
33
34
  tokenId: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
34
- contractType: types_1.ContractTypes.ERC20,
35
+ contractType: caip_1.AssetNamespace.ERC20,
35
36
  color: '#FFFFFF',
36
37
  secondaryColor: '#FFFFFF',
37
38
  icon: 'https://assets.coingecko.com/coins/images/2518/thumb/weth.png?1628852295',
@@ -52,7 +53,7 @@ exports.FOX = {
52
53
  network: types_1.NetworkTypes.MAINNET,
53
54
  precision: 18,
54
55
  tokenId: '0xc770eefad204b5180df6a14ee197d99d808ee52d',
55
- contractType: types_1.ContractTypes.ERC20,
56
+ contractType: caip_1.AssetNamespace.ERC20,
56
57
  color: '#FFFFFF',
57
58
  secondaryColor: '#FFFFFF',
58
59
  icon: 'https://assets.coincap.io/assets/icons/fox@2x.png',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshiftoss/swapper",
3
- "version": "1.16.0",
3
+ "version": "2.0.2",
4
4
  "description": "TODO: description",
5
5
  "repository": "https://github.com/shapeshift/lib",
6
6
  "license": "MIT",
@@ -27,18 +27,18 @@
27
27
  "web3": "^1.6.1"
28
28
  },
29
29
  "peerDependencies": {
30
- "@shapeshiftoss/asset-service": "^1.6.1",
31
- "@shapeshiftoss/caip": "^1.11.0",
32
- "@shapeshiftoss/chain-adapters": "^1.33.0",
30
+ "@shapeshiftoss/asset-service": "^2.0.0",
31
+ "@shapeshiftoss/caip": "^2.0.0",
32
+ "@shapeshiftoss/chain-adapters": "^2.0.0",
33
33
  "@shapeshiftoss/hdwallet-core": "^1.18.2",
34
- "@shapeshiftoss/types": "^1.23.0"
34
+ "@shapeshiftoss/types": "^2.1.0"
35
35
  },
36
36
  "devDependencies": {
37
- "@shapeshiftoss/asset-service": "^1.6.1",
38
- "@shapeshiftoss/caip": "^1.11.0",
39
- "@shapeshiftoss/chain-adapters": "^1.33.0",
37
+ "@shapeshiftoss/asset-service": "^2.0.0",
38
+ "@shapeshiftoss/caip": "^2.0.0",
39
+ "@shapeshiftoss/chain-adapters": "^2.0.0",
40
40
  "@shapeshiftoss/hdwallet-core": "^1.19.0",
41
- "@shapeshiftoss/types": "^1.23.0",
41
+ "@shapeshiftoss/types": "^2.1.0",
42
42
  "@types/readline-sync": "^1.4.4",
43
43
  "readline-sync": "^1.4.10",
44
44
  "web3-utils": "^1.5.2"