@shapeshiftoss/unchained-client 10.10.0 → 10.12.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.
@@ -16,7 +16,9 @@ const getAssetIdByDenom = (denom, assetId) => {
16
16
  if (assetIdByDenom.has(denom))
17
17
  return assetIdByDenom.get(denom);
18
18
  const { chainId } = (0, caip_1.fromAssetId)(assetId);
19
- const [assetNamespace, assetReference] = denom.split('/');
19
+ const [assetNamespace, assetReference] = denom.includes('gamm/pool')
20
+ ? [caip_1.ASSET_NAMESPACE.ibc, denom]
21
+ : denom.split('/');
20
22
  if (assetNamespace === 'ibc' && assetReference) {
21
23
  return (0, caip_1.toAssetId)({ chainId, assetNamespace, assetReference });
22
24
  }
@@ -101,6 +103,18 @@ const metaData = (msg, event, assetId) => {
101
103
  parser: 'swap',
102
104
  method: msg.type,
103
105
  };
106
+ case 'join_pool':
107
+ return {
108
+ parser: 'lp',
109
+ method: msg.type,
110
+ pool: event['pool_joined']['pool_id'],
111
+ };
112
+ case 'exit_pool':
113
+ return {
114
+ parser: 'lp',
115
+ method: msg.type,
116
+ pool: event['pool_exited']['pool_id'],
117
+ };
104
118
  case 'send':
105
119
  // known message types with no applicable metadata
106
120
  return;
@@ -1,5 +1,6 @@
1
1
  import { Tx } from '../../../generated/avalanche';
2
2
  import { BaseTransactionParser, TransactionParserArgs } from '../../parser';
3
+ export declare const ZRX_AVALANCHE_PROXY_CONTRACT = "0xDef1C0ded9bec7F1a1670819833240f027b25EfF";
3
4
  export declare class TransactionParser extends BaseTransactionParser<Tx> {
4
5
  constructor(args: TransactionParserArgs);
5
6
  }
@@ -23,15 +23,16 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.TransactionParser = void 0;
26
+ exports.TransactionParser = exports.ZRX_AVALANCHE_PROXY_CONTRACT = void 0;
27
27
  const caip_1 = require("@shapeshiftoss/caip");
28
28
  const parser_1 = require("../../parser");
29
29
  const zrx = __importStar(require("../../parser/zrx"));
30
+ exports.ZRX_AVALANCHE_PROXY_CONTRACT = '0xDef1C0ded9bec7F1a1670819833240f027b25EfF';
30
31
  class TransactionParser extends parser_1.BaseTransactionParser {
31
32
  constructor(args) {
32
33
  super(args);
33
34
  this.assetId = caip_1.avalancheAssetId;
34
- this.registerParser(new zrx.Parser());
35
+ this.registerParser(new zrx.Parser({ proxyContract: exports.ZRX_AVALANCHE_PROXY_CONTRACT }));
35
36
  }
36
37
  }
37
38
  exports.TransactionParser = TransactionParser;
@@ -1,5 +1,6 @@
1
1
  import { Tx } from '../../../generated/ethereum';
2
2
  import { BaseTransactionParser, TransactionParserArgs } from '../../parser';
3
+ export declare const ZRX_ETHEREUM_PROXY_CONTRACT = "0xDef1C0ded9bec7F1a1670819833240f027b25EfF";
3
4
  export declare class TransactionParser extends BaseTransactionParser<Tx> {
4
5
  constructor(args: TransactionParserArgs);
5
6
  }
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.TransactionParser = void 0;
26
+ exports.TransactionParser = exports.ZRX_ETHEREUM_PROXY_CONTRACT = void 0;
27
27
  const caip_1 = require("@shapeshiftoss/caip");
28
28
  const parser_1 = require("../../parser");
29
29
  const zrx = __importStar(require("../../parser/zrx"));
@@ -33,6 +33,7 @@ const thor = __importStar(require("./thor"));
33
33
  const uniV2 = __importStar(require("./uniV2"));
34
34
  const weth = __importStar(require("./weth"));
35
35
  const yearn = __importStar(require("./yearn"));
36
+ exports.ZRX_ETHEREUM_PROXY_CONTRACT = '0xDef1C0ded9bec7F1a1670819833240f027b25EfF';
36
37
  class TransactionParser extends parser_1.BaseTransactionParser {
37
38
  constructor(args) {
38
39
  super(args);
@@ -45,7 +46,7 @@ class TransactionParser extends parser_1.BaseTransactionParser {
45
46
  new weth.Parser({ chainId: this.chainId, provider: this.provider }),
46
47
  new uniV2.Parser({ chainId: this.chainId, provider: this.provider }),
47
48
  new thor.Parser({ chainId: this.chainId, rpcUrl: args.rpcUrl }),
48
- new zrx.Parser(),
49
+ new zrx.Parser({ proxyContract: exports.ZRX_ETHEREUM_PROXY_CONTRACT }),
49
50
  new cowswap.Parser(),
50
51
  ]);
51
52
  }
@@ -1,5 +1,6 @@
1
1
  import { Tx } from '../../../generated/optimism';
2
2
  import { BaseTransactionParser, TransactionParserArgs } from '../../parser';
3
+ export declare const ZRX_OPTIMISM_PROXY_CONTRACT = "0xDEF1ABE32c034e558Cdd535791643C58a13aCC10";
3
4
  export declare class TransactionParser extends BaseTransactionParser<Tx> {
4
5
  constructor(args: TransactionParserArgs);
5
6
  }
@@ -1,12 +1,38 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = 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);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TransactionParser = void 0;
26
+ exports.TransactionParser = exports.ZRX_OPTIMISM_PROXY_CONTRACT = void 0;
4
27
  const caip_1 = require("@shapeshiftoss/caip");
5
28
  const parser_1 = require("../../parser");
29
+ const zrx = __importStar(require("../../parser/zrx"));
30
+ exports.ZRX_OPTIMISM_PROXY_CONTRACT = '0xDEF1ABE32c034e558Cdd535791643C58a13aCC10';
6
31
  class TransactionParser extends parser_1.BaseTransactionParser {
7
32
  constructor(args) {
8
33
  super(args);
9
34
  this.assetId = caip_1.optimismAssetId;
35
+ this.registerParser(new zrx.Parser({ proxyContract: exports.ZRX_OPTIMISM_PROXY_CONTRACT }));
10
36
  }
11
37
  }
12
38
  exports.TransactionParser = TransactionParser;
@@ -1,9 +1,14 @@
1
1
  import { BaseTxMetadata } from '../../types';
2
- import { type SubParser, type TxSpecific } from '.';
3
- import { type Tx } from './types';
2
+ import type { SubParser, TxSpecific } from '.';
3
+ import type { Tx } from './types';
4
4
  export interface TxMetadata extends BaseTxMetadata {
5
5
  parser: 'zrx';
6
6
  }
7
+ export interface ParserArgs {
8
+ proxyContract: string;
9
+ }
7
10
  export declare class Parser implements SubParser<Tx> {
11
+ private readonly proxyContract;
12
+ constructor(args: ParserArgs);
8
13
  parse(tx: Tx): Promise<TxSpecific | undefined>;
9
14
  }
@@ -3,10 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Parser = void 0;
4
4
  const types_1 = require("../../types");
5
5
  const _1 = require(".");
6
- const constants_1 = require("./constants");
7
6
  class Parser {
7
+ constructor(args) {
8
+ this.proxyContract = args.proxyContract;
9
+ }
8
10
  async parse(tx) {
9
- if (!(0, _1.txInteractsWithContract)(tx, constants_1.ZRX_PROXY_CONTRACT))
11
+ if (!(0, _1.txInteractsWithContract)(tx, this.proxyContract))
10
12
  return;
11
13
  if (!(tx.tokenTransfers && tx.tokenTransfers.length))
12
14
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshiftoss/unchained-client",
3
- "version": "10.10.0",
3
+ "version": "10.12.0",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "source": "src/index.ts",
@@ -1 +0,0 @@
1
- export declare const ZRX_PROXY_CONTRACT = "0xDef1C0ded9bec7F1a1670819833240f027b25EfF";
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ZRX_PROXY_CONTRACT = void 0;
4
- exports.ZRX_PROXY_CONTRACT = '0xDef1C0ded9bec7F1a1670819833240f027b25EfF';