@gearbox-protocol/sdk 1.20.15 → 1.20.16

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.
@@ -0,0 +1,6 @@
1
+ import { AbstractParser } from "./abstractParser";
2
+ import { IParser } from "./iParser";
3
+ export declare class PoolParser extends AbstractParser implements IParser {
4
+ constructor(version: number);
5
+ parse(calldata: string): string;
6
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.PoolParser = void 0;
19
+ var types_1 = require("../types");
20
+ var abstractParser_1 = require("./abstractParser");
21
+ var PoolParser = /** @class */ (function (_super) {
22
+ __extends(PoolParser, _super);
23
+ function PoolParser(version) {
24
+ var _this = _super.call(this, "Pool_V".concat(version)) || this;
25
+ _this.ifc = types_1.PoolService__factory.createInterface();
26
+ return _this;
27
+ }
28
+ PoolParser.prototype.parse = function (calldata) {
29
+ var _a = this.parseSelector(calldata), functionFragment = _a.functionFragment, functionName = _a.functionName;
30
+ switch (functionFragment.name) {
31
+ default:
32
+ return "".concat(functionName, ": Unknown operation ").concat(functionFragment.name, " with calldata ").concat(calldata);
33
+ }
34
+ };
35
+ return PoolParser;
36
+ }(abstractParser_1.AbstractParser));
37
+ exports.PoolParser = PoolParser;
@@ -38,6 +38,7 @@ export declare class TxParser {
38
38
  static addMulticall(address: string): void;
39
39
  static addAirdropDistributor(address: string): void;
40
40
  static addCreditManager(address: string, version: number): void;
41
+ static addPool(address: string, version: number): void;
41
42
  static getParser(address: string): IParser & AbstractParser;
42
43
  protected static chooseContractParser(address: string, contract: SupportedContract, adapterType: number, isContract: boolean): void;
43
44
  protected static _addParser(address: string, parser: IParser & AbstractParser): void;
@@ -20,6 +20,7 @@ var lidoOracleParser_1 = require("./lidoOracleParser");
20
20
  var lidoSTETHParser_1 = require("./lidoSTETHParser");
21
21
  var multicallParser_1 = require("./multicallParser");
22
22
  var offchainOracleParser_1 = require("./offchainOracleParser");
23
+ var poolParser_1 = require("./poolParser");
23
24
  var priceOracleParser_1 = require("./priceOracleParser");
24
25
  var uniV2AdapterParser_1 = require("./uniV2AdapterParser");
25
26
  var uniV3AdapterParser_1 = require("./uniV3AdapterParser");
@@ -120,6 +121,9 @@ var TxParser = /** @class */ (function () {
120
121
  TxParser.addCreditManager = function (address, version) {
121
122
  TxParser._addParser(address, new creditManagerParser_1.CreditManagerParser(version));
122
123
  };
124
+ TxParser.addPool = function (address, version) {
125
+ TxParser._addParser(address, new poolParser_1.PoolParser(version));
126
+ };
123
127
  TxParser.getParser = function (address) {
124
128
  var parser = TxParser.parsers[address.toLowerCase()];
125
129
  if (!parser)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "1.20.15",
3
+ "version": "1.20.16",
4
4
  "description": "Gearbox SDK",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",