@shapeshiftoss/unchained-client 10.2.0 → 10.2.1

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.
@@ -40,8 +40,6 @@ class Parser {
40
40
  async parseUniV2(tx) {
41
41
  if (!tx.inputData)
42
42
  return;
43
- if (tx.confirmations)
44
- return;
45
43
  const txSigHash = (0, parser_1.getSigHash)(tx.inputData);
46
44
  if (!Object.values(this.supportedFunctions).some((hash) => hash === txSigHash))
47
45
  return;
@@ -49,6 +47,15 @@ class Parser {
49
47
  // failed to decode input data
50
48
  if (!decoded)
51
49
  return;
50
+ // Unconfirmed Txs are the edge case here, we augment them with transfers
51
+ // For confirmed Tx, the metadata is all we actually need
52
+ if (tx.confirmations)
53
+ return {
54
+ data: {
55
+ parser: 'uniV2',
56
+ method: decoded.name,
57
+ },
58
+ };
52
59
  const tokenAddress = ethers_1.ethers.utils.getAddress(decoded.args.token.toLowerCase());
53
60
  const lpTokenAddress = Parser.pairFor(tokenAddress, this.wethContract);
54
61
  const transfers = await (async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshiftoss/unchained-client",
3
- "version": "10.2.0",
3
+ "version": "10.2.1",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "source": "src/index.ts",