@shapeshiftoss/unchained-client 9.3.1 → 9.5.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 (84) hide show
  1. package/dist/cosmos/parser/index.js +1 -1
  2. package/dist/evm/avalanche/parser/index.js +1 -5
  3. package/dist/evm/ethereum/parser/constants.d.ts +1 -0
  4. package/dist/evm/ethereum/parser/constants.js +2 -1
  5. package/dist/evm/ethereum/parser/cowswap.d.ts +5 -0
  6. package/dist/evm/ethereum/parser/cowswap.js +27 -0
  7. package/dist/evm/ethereum/parser/index.js +4 -6
  8. package/dist/evm/parser/index.js +4 -4
  9. package/dist/generated/avalanche/api.d.ts +1 -1
  10. package/dist/generated/avalanche/api.js +1 -1
  11. package/dist/generated/avalanche/base.d.ts +1 -1
  12. package/dist/generated/avalanche/base.js +1 -1
  13. package/dist/generated/avalanche/common.d.ts +1 -1
  14. package/dist/generated/avalanche/common.js +1 -1
  15. package/dist/generated/avalanche/configuration.d.ts +1 -1
  16. package/dist/generated/avalanche/configuration.js +1 -1
  17. package/dist/generated/avalanche/index.d.ts +1 -1
  18. package/dist/generated/avalanche/index.js +1 -1
  19. package/dist/generated/bitcoin/api.d.ts +201 -201
  20. package/dist/generated/bitcoin/api.js +26 -26
  21. package/dist/generated/bitcoin/base.d.ts +1 -1
  22. package/dist/generated/bitcoin/base.js +1 -1
  23. package/dist/generated/bitcoin/common.d.ts +1 -1
  24. package/dist/generated/bitcoin/common.js +1 -1
  25. package/dist/generated/bitcoin/configuration.d.ts +1 -1
  26. package/dist/generated/bitcoin/configuration.js +1 -1
  27. package/dist/generated/bitcoin/index.d.ts +1 -1
  28. package/dist/generated/bitcoin/index.js +1 -1
  29. package/dist/generated/dogecoin/api.d.ts +201 -201
  30. package/dist/generated/dogecoin/api.js +26 -26
  31. package/dist/generated/dogecoin/base.d.ts +1 -1
  32. package/dist/generated/dogecoin/base.js +1 -1
  33. package/dist/generated/dogecoin/common.d.ts +1 -1
  34. package/dist/generated/dogecoin/common.js +1 -1
  35. package/dist/generated/dogecoin/configuration.d.ts +1 -1
  36. package/dist/generated/dogecoin/configuration.js +1 -1
  37. package/dist/generated/dogecoin/index.d.ts +1 -1
  38. package/dist/generated/dogecoin/index.js +1 -1
  39. package/dist/generated/ethereum/api.d.ts +1 -1
  40. package/dist/generated/ethereum/api.js +1 -1
  41. package/dist/generated/ethereum/base.d.ts +1 -1
  42. package/dist/generated/ethereum/base.js +1 -1
  43. package/dist/generated/ethereum/common.d.ts +1 -1
  44. package/dist/generated/ethereum/common.js +1 -1
  45. package/dist/generated/ethereum/configuration.d.ts +1 -1
  46. package/dist/generated/ethereum/configuration.js +1 -1
  47. package/dist/generated/ethereum/index.d.ts +1 -1
  48. package/dist/generated/ethereum/index.js +1 -1
  49. package/dist/generated/litecoin/api.d.ts +1010 -0
  50. package/dist/generated/litecoin/api.js +521 -0
  51. package/dist/generated/litecoin/base.d.ts +55 -0
  52. package/dist/generated/litecoin/base.js +64 -0
  53. package/dist/generated/litecoin/common.d.ts +65 -0
  54. package/dist/generated/litecoin/common.js +137 -0
  55. package/dist/generated/litecoin/configuration.d.ts +83 -0
  56. package/dist/generated/litecoin/configuration.js +42 -0
  57. package/dist/generated/litecoin/index.d.ts +13 -0
  58. package/dist/generated/litecoin/index.js +31 -0
  59. package/dist/index.d.ts +4 -2
  60. package/dist/index.js +5 -3
  61. package/dist/types.d.ts +17 -14
  62. package/dist/types.js +21 -14
  63. package/dist/utxo/bitcoin/index.d.ts +2 -0
  64. package/dist/{bitcoin → utxo/bitcoin}/index.js +1 -2
  65. package/dist/utxo/bitcoin/parser/index.d.ts +6 -0
  66. package/dist/utxo/bitcoin/parser/index.js +12 -0
  67. package/dist/utxo/dogecoin/index.d.ts +2 -0
  68. package/dist/{dogecoin → utxo/dogecoin}/index.js +2 -3
  69. package/dist/utxo/dogecoin/parser/index.d.ts +6 -0
  70. package/dist/utxo/dogecoin/parser/index.js +12 -0
  71. package/dist/utxo/index.d.ts +5 -0
  72. package/dist/utxo/index.js +31 -0
  73. package/dist/utxo/litecoin/index.d.ts +2 -0
  74. package/dist/utxo/litecoin/index.js +18 -0
  75. package/dist/utxo/litecoin/parser/index.d.ts +6 -0
  76. package/dist/utxo/litecoin/parser/index.js +12 -0
  77. package/dist/utxo/parser/index.d.ts +12 -0
  78. package/dist/{bitcoin → utxo}/parser/index.js +4 -11
  79. package/package.json +4 -4
  80. package/dist/bitcoin/index.d.ts +0 -3
  81. package/dist/bitcoin/parser/index.d.ts +0 -13
  82. package/dist/bitcoin/types.d.ts +0 -1
  83. package/dist/bitcoin/types.js +0 -2
  84. package/dist/dogecoin/index.d.ts +0 -3
@@ -25,7 +25,7 @@ class TransactionParser {
25
25
  blockTime: (_b = tx.timestamp) !== null && _b !== void 0 ? _b : Math.floor(Date.now() / 1000),
26
26
  chainId: this.chainId,
27
27
  confirmations: tx.confirmations,
28
- status: tx.confirmations > 0 ? types_1.Status.Confirmed : types_1.Status.Pending,
28
+ status: tx.confirmations > 0 ? types_1.TxStatus.Confirmed : types_1.TxStatus.Pending,
29
29
  transfers: [],
30
30
  txid: tx.txid
31
31
  };
@@ -6,11 +6,7 @@ const parser_1 = require("../../parser");
6
6
  class TransactionParser extends parser_1.BaseTransactionParser {
7
7
  constructor(args) {
8
8
  super(args);
9
- this.assetId = (0, caip_1.toAssetId)({
10
- chainId: this.chainId,
11
- assetNamespace: 'slip44',
12
- assetReference: caip_1.ASSET_REFERENCE.AvalancheC
13
- });
9
+ this.assetId = caip_1.avalancheAssetId;
14
10
  }
15
11
  }
16
12
  exports.TransactionParser = TransactionParser;
@@ -7,3 +7,4 @@ export declare const FOXY_STAKING_CONTRACT = "0xee77aa3Fd23BbeBaf94386dD44b548e9
7
7
  export declare const WETH_CONTRACT_MAINNET = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2";
8
8
  export declare const WETH_CONTRACT_ROPSTEN = "0xc778417E063141139Fce010982780140Aa0cD5Ab";
9
9
  export declare const UNI_V2_FOX_STAKING_REWARDS_V3 = "0x212ebf9FD3c10F371557b08E993eAaB385c3932b";
10
+ export declare const COWSWAP_CONTRACT_MAINNET = "0x9008D19f58AAbD9eD0D60971565AA8510560ab41";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UNI_V2_FOX_STAKING_REWARDS_V3 = exports.WETH_CONTRACT_ROPSTEN = exports.WETH_CONTRACT_MAINNET = exports.FOXY_STAKING_CONTRACT = exports.THOR_ROUTER_CONTRACT_ROPSTEN = exports.THOR_ROUTER_CONTRACT_MAINNET = exports.ZRX_PROXY_CONTRACT = exports.UNI_V2_ROUTER_CONTRACT = exports.SHAPE_SHIFT_ROUTER_CONTRACT = void 0;
3
+ exports.COWSWAP_CONTRACT_MAINNET = exports.UNI_V2_FOX_STAKING_REWARDS_V3 = exports.WETH_CONTRACT_ROPSTEN = exports.WETH_CONTRACT_MAINNET = exports.FOXY_STAKING_CONTRACT = exports.THOR_ROUTER_CONTRACT_ROPSTEN = exports.THOR_ROUTER_CONTRACT_MAINNET = exports.ZRX_PROXY_CONTRACT = exports.UNI_V2_ROUTER_CONTRACT = exports.SHAPE_SHIFT_ROUTER_CONTRACT = void 0;
4
4
  exports.SHAPE_SHIFT_ROUTER_CONTRACT = '0x6a1e73f12018D8e5f966ce794aa2921941feB17E';
5
5
  exports.UNI_V2_ROUTER_CONTRACT = '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D';
6
6
  exports.ZRX_PROXY_CONTRACT = '0xDef1C0ded9bec7F1a1670819833240f027b25EfF';
@@ -10,3 +10,4 @@ exports.FOXY_STAKING_CONTRACT = '0xee77aa3Fd23BbeBaf94386dD44b548e9a785ea4b';
10
10
  exports.WETH_CONTRACT_MAINNET = '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2';
11
11
  exports.WETH_CONTRACT_ROPSTEN = '0xc778417E063141139Fce010982780140Aa0cD5Ab';
12
12
  exports.UNI_V2_FOX_STAKING_REWARDS_V3 = '0x212ebf9FD3c10F371557b08E993eAaB385c3932b';
13
+ exports.COWSWAP_CONTRACT_MAINNET = '0x9008D19f58AAbD9eD0D60971565AA8510560ab41';
@@ -0,0 +1,5 @@
1
+ import { Tx } from '../../../generated/ethereum';
2
+ import { SubParser, TxSpecific } from '../../parser';
3
+ export declare class Parser implements SubParser<Tx> {
4
+ parse(tx: Tx): Promise<TxSpecific | undefined>;
5
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Parser = void 0;
4
+ const types_1 = require("../../../types");
5
+ const parser_1 = require("../../parser");
6
+ const constants_1 = require("./constants");
7
+ class Parser {
8
+ async parse(tx) {
9
+ if (!(0, parser_1.txInteractsWithContract)(tx, constants_1.COWSWAP_CONTRACT_MAINNET))
10
+ return;
11
+ if (!(tx.tokenTransfers && tx.tokenTransfers.length))
12
+ return;
13
+ const trade = {
14
+ dexName: types_1.Dex.CowSwap,
15
+ type: types_1.TradeType.Trade
16
+ };
17
+ const data = {
18
+ method: undefined,
19
+ parser: types_1.TxParser.CowSwap
20
+ };
21
+ return {
22
+ trade,
23
+ data
24
+ };
25
+ }
26
+ }
27
+ exports.Parser = Parser;
@@ -26,6 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.TransactionParser = void 0;
27
27
  const caip_1 = require("@shapeshiftoss/caip");
28
28
  const parser_1 = require("../../parser");
29
+ const cowswap = __importStar(require("./cowswap"));
29
30
  const foxy = __importStar(require("./foxy"));
30
31
  const thor = __importStar(require("./thor"));
31
32
  const uniV2 = __importStar(require("./uniV2"));
@@ -35,11 +36,7 @@ const zrx = __importStar(require("./zrx"));
35
36
  class TransactionParser extends parser_1.BaseTransactionParser {
36
37
  constructor(args) {
37
38
  super(args);
38
- this.assetId = (0, caip_1.toAssetId)({
39
- chainId: this.chainId,
40
- assetNamespace: 'slip44',
41
- assetReference: caip_1.ASSET_REFERENCE.Ethereum
42
- });
39
+ this.assetId = caip_1.ethAssetId;
43
40
  // due to the current parser logic, order here matters (register most generic first to most specific last)
44
41
  // weth and yearn have the same sigHash for deposit(), but the weth parser is stricter resulting in faster processing times
45
42
  this.registerParsers([
@@ -48,7 +45,8 @@ class TransactionParser extends parser_1.BaseTransactionParser {
48
45
  new weth.Parser({ chainId: this.chainId, provider: this.provider }),
49
46
  new uniV2.Parser({ chainId: this.chainId, provider: this.provider }),
50
47
  new thor.Parser({ chainId: this.chainId, rpcUrl: args.rpcUrl }),
51
- new zrx.Parser()
48
+ new zrx.Parser(),
49
+ new cowswap.Parser()
52
50
  ]);
53
51
  }
54
52
  }
@@ -76,12 +76,12 @@ class BaseTransactionParser {
76
76
  getStatus(tx) {
77
77
  const status = tx.status;
78
78
  if (status === -1 && tx.confirmations <= 0)
79
- return types_1.Status.Pending;
79
+ return types_1.TxStatus.Pending;
80
80
  if (status === 1 && tx.confirmations > 0)
81
- return types_1.Status.Confirmed;
81
+ return types_1.TxStatus.Confirmed;
82
82
  if (status === 0)
83
- return types_1.Status.Failed;
84
- return types_1.Status.Unknown;
83
+ return types_1.TxStatus.Failed;
84
+ return types_1.TxStatus.Unknown;
85
85
  }
86
86
  getParsedTxWithTransfers(tx, parsedTx, address) {
87
87
  var _a, _b;
@@ -2,7 +2,7 @@
2
2
  * @shapeshiftoss/avalanche-api
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: 7.2.0
5
+ * The version of the OpenAPI document: 8.0.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -5,7 +5,7 @@
5
5
  * @shapeshiftoss/avalanche-api
6
6
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
7
  *
8
- * The version of the OpenAPI document: 7.2.0
8
+ * The version of the OpenAPI document: 8.0.0
9
9
  *
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -2,7 +2,7 @@
2
2
  * @shapeshiftoss/avalanche-api
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: 7.2.0
5
+ * The version of the OpenAPI document: 8.0.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -5,7 +5,7 @@
5
5
  * @shapeshiftoss/avalanche-api
6
6
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
7
  *
8
- * The version of the OpenAPI document: 7.2.0
8
+ * The version of the OpenAPI document: 8.0.0
9
9
  *
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -2,7 +2,7 @@
2
2
  * @shapeshiftoss/avalanche-api
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: 7.2.0
5
+ * The version of the OpenAPI document: 8.0.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -5,7 +5,7 @@
5
5
  * @shapeshiftoss/avalanche-api
6
6
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
7
  *
8
- * The version of the OpenAPI document: 7.2.0
8
+ * The version of the OpenAPI document: 8.0.0
9
9
  *
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -2,7 +2,7 @@
2
2
  * @shapeshiftoss/avalanche-api
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: 7.2.0
5
+ * The version of the OpenAPI document: 8.0.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -5,7 +5,7 @@
5
5
  * @shapeshiftoss/avalanche-api
6
6
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
7
  *
8
- * The version of the OpenAPI document: 7.2.0
8
+ * The version of the OpenAPI document: 8.0.0
9
9
  *
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -2,7 +2,7 @@
2
2
  * @shapeshiftoss/avalanche-api
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: 7.2.0
5
+ * The version of the OpenAPI document: 8.0.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -5,7 +5,7 @@
5
5
  * @shapeshiftoss/avalanche-api
6
6
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
7
  *
8
- * The version of the OpenAPI document: 7.2.0
8
+ * The version of the OpenAPI document: 8.0.0
9
9
  *
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).