@shapeshiftoss/unchained-client 9.8.2 → 10.0.0

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.
Files changed (57) hide show
  1. package/dist/cosmos/parser/index.js +6 -6
  2. package/dist/cosmos/parser/utils.js +9 -9
  3. package/dist/cosmos/types.d.ts +2 -2
  4. package/dist/evm/ethereum/parser/abi/foxyStaking.js +161 -161
  5. package/dist/evm/ethereum/parser/abi/shapeShiftRouter.js +119 -119
  6. package/dist/evm/ethereum/parser/abi/thor.js +28 -28
  7. package/dist/evm/ethereum/parser/abi/uniV2.js +55 -55
  8. package/dist/evm/ethereum/parser/abi/uniV2StakingRewards.js +95 -95
  9. package/dist/evm/ethereum/parser/abi/weth.js +66 -66
  10. package/dist/evm/ethereum/parser/abi/yearnVault.js +95 -95
  11. package/dist/evm/ethereum/parser/cowswap.d.ts +4 -0
  12. package/dist/evm/ethereum/parser/cowswap.js +3 -3
  13. package/dist/evm/ethereum/parser/foxy.d.ts +4 -0
  14. package/dist/evm/ethereum/parser/foxy.js +3 -3
  15. package/dist/evm/ethereum/parser/index.js +1 -1
  16. package/dist/evm/ethereum/parser/thor.d.ts +4 -0
  17. package/dist/evm/ethereum/parser/thor.js +2 -2
  18. package/dist/evm/ethereum/parser/uniV2.d.ts +4 -0
  19. package/dist/evm/ethereum/parser/uniV2.js +12 -12
  20. package/dist/evm/ethereum/parser/weth.d.ts +4 -0
  21. package/dist/evm/ethereum/parser/weth.js +9 -9
  22. package/dist/evm/ethereum/parser/yearn.d.ts +7 -0
  23. package/dist/evm/ethereum/parser/yearn.js +32 -16
  24. package/dist/evm/parser/abi/erc20.js +69 -69
  25. package/dist/evm/parser/erc20.d.ts +6 -0
  26. package/dist/evm/parser/erc20.js +15 -12
  27. package/dist/evm/parser/index.js +4 -4
  28. package/dist/evm/parser/types.d.ts +10 -9
  29. package/dist/evm/parser/types.js +0 -5
  30. package/dist/evm/parser/zrx.d.ts +4 -0
  31. package/dist/evm/parser/zrx.js +3 -3
  32. package/dist/generated/cosmos/api.d.ts +183 -66
  33. package/dist/generated/cosmos/api.js +82 -13
  34. package/dist/generated/cosmos/base.d.ts +1 -1
  35. package/dist/generated/cosmos/base.js +1 -1
  36. package/dist/generated/cosmos/common.d.ts +1 -1
  37. package/dist/generated/cosmos/common.js +1 -1
  38. package/dist/generated/cosmos/configuration.d.ts +1 -1
  39. package/dist/generated/cosmos/configuration.js +1 -1
  40. package/dist/generated/cosmos/index.d.ts +1 -1
  41. package/dist/generated/cosmos/index.js +1 -1
  42. package/dist/generated/osmosis/api.d.ts +183 -66
  43. package/dist/generated/osmosis/api.js +82 -13
  44. package/dist/generated/osmosis/base.d.ts +1 -1
  45. package/dist/generated/osmosis/base.js +1 -1
  46. package/dist/generated/osmosis/common.d.ts +1 -1
  47. package/dist/generated/osmosis/common.js +1 -1
  48. package/dist/generated/osmosis/configuration.d.ts +1 -1
  49. package/dist/generated/osmosis/configuration.js +1 -1
  50. package/dist/generated/osmosis/index.d.ts +1 -1
  51. package/dist/generated/osmosis/index.js +1 -1
  52. package/dist/types.d.ts +0 -13
  53. package/dist/types.js +1 -12
  54. package/dist/utils.js +2 -2
  55. package/dist/utxo/parser/index.js +1 -1
  56. package/dist/websocket.js +4 -4
  57. package/package.json +3 -3
package/dist/types.d.ts CHANGED
@@ -44,23 +44,10 @@ export declare enum TransferType {
44
44
  Receive = "Receive",
45
45
  Contract = "Contract"
46
46
  }
47
- export declare enum TxParser {
48
- Cosmos = "cosmos",
49
- Yearn = "yearn",
50
- UniV2 = "uniV2",
51
- ZRX = "zrx",
52
- Thor = "thor",
53
- Foxy = "foxy",
54
- WETH = "weth",
55
- CowSwap = "cowswap"
56
- }
57
47
  export interface BaseTxMetadata {
58
48
  method?: string;
59
49
  parser: string;
60
50
  }
61
- export interface StandardTxMetadata extends BaseTxMetadata {
62
- parser: `${TxParser}`;
63
- }
64
51
  export interface StandardTx {
65
52
  address: string;
66
53
  blockHash?: string;
package/dist/types.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TxParser = exports.TransferType = exports.TradeType = exports.TxStatus = exports.Dex = void 0;
3
+ exports.TransferType = exports.TradeType = exports.TxStatus = exports.Dex = void 0;
4
4
  // these are user facing values, and should be rendered as such
5
5
  var Dex;
6
6
  (function (Dex) {
@@ -29,14 +29,3 @@ var TransferType;
29
29
  TransferType["Receive"] = "Receive";
30
30
  TransferType["Contract"] = "Contract";
31
31
  })(TransferType = exports.TransferType || (exports.TransferType = {}));
32
- var TxParser;
33
- (function (TxParser) {
34
- TxParser["Cosmos"] = "cosmos";
35
- TxParser["Yearn"] = "yearn";
36
- TxParser["UniV2"] = "uniV2";
37
- TxParser["ZRX"] = "zrx";
38
- TxParser["Thor"] = "thor";
39
- TxParser["Foxy"] = "foxy";
40
- TxParser["WETH"] = "weth";
41
- TxParser["CowSwap"] = "cowswap";
42
- })(TxParser = exports.TxParser || (exports.TxParser = {}));
package/dist/utils.js CHANGED
@@ -33,8 +33,8 @@ function aggregateTransfer(transfers, type, assetId, from, to, value, token) {
33
33
  to,
34
34
  totalValue: value,
35
35
  components: [{ value }],
36
- token
37
- }
36
+ token,
37
+ },
38
38
  ];
39
39
  }
40
40
  return transfers;
@@ -18,7 +18,7 @@ class BaseTransactionParser {
18
18
  confirmations: tx.confirmations,
19
19
  status: tx.confirmations > 0 ? types_1.TxStatus.Confirmed : types_1.TxStatus.Pending,
20
20
  transfers: [],
21
- txid: tx.txid
21
+ txid: tx.txid,
22
22
  };
23
23
  tx.vin.forEach((vin) => {
24
24
  var _a, _b, _c, _d, _e, _f, _g;
package/dist/websocket.js CHANGED
@@ -8,7 +8,7 @@ const logger_1 = require("@shapeshiftoss/logger");
8
8
  const isomorphic_ws_1 = __importDefault(require("isomorphic-ws"));
9
9
  const logger = new logger_1.Logger({
10
10
  namespace: ['unchained-client', 'websocket'],
11
- level: process.env.LOG_LEVEL
11
+ level: process.env.LOG_LEVEL,
12
12
  });
13
13
  const NORMAL_CLOSURE_CODE = 1000;
14
14
  class Client {
@@ -19,7 +19,7 @@ class Client {
19
19
  this.txs = {};
20
20
  this.url = url;
21
21
  this.connections = {
22
- txs: undefined
22
+ txs: undefined,
23
23
  };
24
24
  }
25
25
  async initialize() {
@@ -138,7 +138,7 @@ class Client {
138
138
  async subscribeTxs(subscriptionId, data, onMessage, onError) {
139
139
  var _a, _b, _c, _d;
140
140
  const addresses = [
141
- ...new Set([...((_c = (_b = (_a = this.txs[subscriptionId]) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.addresses) !== null && _c !== void 0 ? _c : []), ...data.addresses])
141
+ ...new Set([...((_c = (_b = (_a = this.txs[subscriptionId]) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.addresses) !== null && _c !== void 0 ? _c : []), ...data.addresses]),
142
142
  ];
143
143
  // keep track of all subscribed addresses and onMessage/onError handlers associated with each subscriptionId
144
144
  this.txs[subscriptionId] = { onMessage, onError, data: { topic: 'txs', addresses } };
@@ -183,7 +183,7 @@ class Client {
183
183
  const payload = {
184
184
  subscriptionId: subscriptionId !== null && subscriptionId !== void 0 ? subscriptionId : '',
185
185
  method: 'unsubscribe',
186
- data: { topic: 'txs', addresses: (_d = data === null || data === void 0 ? void 0 : data.addresses) !== null && _d !== void 0 ? _d : [] }
186
+ data: { topic: 'txs', addresses: (_d = data === null || data === void 0 ? void 0 : data.addresses) !== null && _d !== void 0 ? _d : [] },
187
187
  };
188
188
  (_e = this.connections.txs) === null || _e === void 0 ? void 0 : _e.ws.send(JSON.stringify(payload));
189
189
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshiftoss/unchained-client",
3
- "version": "9.8.2",
3
+ "version": "10.0.0",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "source": "src/index.ts",
@@ -29,13 +29,13 @@
29
29
  "ws": "^8.3.0"
30
30
  },
31
31
  "peerDependencies": {
32
- "@shapeshiftoss/caip": "^6.7.0",
32
+ "@shapeshiftoss/caip": "^7.0.0",
33
33
  "@shapeshiftoss/logger": "^1.1.2",
34
34
  "@shapeshiftoss/types": "^8.1.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@openapitools/openapi-generator-cli": "^2.5.1",
38
- "@shapeshiftoss/caip": "^6.7.0",
38
+ "@shapeshiftoss/caip": "^7.0.0",
39
39
  "@shapeshiftoss/common-api": "^8.0.0",
40
40
  "@shapeshiftoss/logger": "^1.1.2",
41
41
  "@shapeshiftoss/types": "^8.1.0",