@gearbox-protocol/sdk 8.19.4 → 8.19.5

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.
@@ -21,7 +21,9 @@ __export(PriceFeedsRegister_exports, {
21
21
  PriceFeedRegister: () => PriceFeedRegister
22
22
  });
23
23
  module.exports = __toCommonJS(PriceFeedsRegister_exports);
24
+ var import_viem = require("viem");
24
25
  var import_compressors = require("../../../abi/compressors.js");
26
+ var import_iUpdatablePriceFeed = require("../../../abi/iUpdatablePriceFeed.js");
25
27
  var import_base = require("../../base/index.js");
26
28
  var import_constants = require("../../constants/index.js");
27
29
  var import_utils = require("../../utils/index.js");
@@ -135,10 +137,16 @@ class PriceFeedRegister extends import_base.SDKConstruct {
135
137
  feeds,
136
138
  block
137
139
  );
138
- return txs.map((tx) => ({
139
- priceFeed: tx.data.priceFeed,
140
- data: tx.raw.callData
141
- }));
140
+ return txs.map((tx) => {
141
+ const data = (0, import_viem.decodeFunctionData)({
142
+ abi: import_iUpdatablePriceFeed.iUpdatablePriceFeedAbi,
143
+ data: tx.raw.callData
144
+ });
145
+ return {
146
+ priceFeed: tx.raw.to,
147
+ data: data.args[0]
148
+ };
149
+ });
142
150
  }
143
151
  has(address) {
144
152
  return this.#feeds.has(address);
@@ -1,4 +1,8 @@
1
+ import {
2
+ decodeFunctionData
3
+ } from "viem";
1
4
  import { iPriceFeedCompressorAbi } from "../../../abi/compressors.js";
5
+ import { iUpdatablePriceFeedAbi } from "../../../abi/iUpdatablePriceFeed.js";
2
6
  import { SDKConstruct } from "../../base/index.js";
3
7
  import {
4
8
  ADDRESS_0X0,
@@ -118,10 +122,16 @@ class PriceFeedRegister extends SDKConstruct {
118
122
  feeds,
119
123
  block
120
124
  );
121
- return txs.map((tx) => ({
122
- priceFeed: tx.data.priceFeed,
123
- data: tx.raw.callData
124
- }));
125
+ return txs.map((tx) => {
126
+ const data = decodeFunctionData({
127
+ abi: iUpdatablePriceFeedAbi,
128
+ data: tx.raw.callData
129
+ });
130
+ return {
131
+ priceFeed: tx.raw.to,
132
+ data: data.args[0]
133
+ };
134
+ });
125
135
  }
126
136
  has(address) {
127
137
  return this.#feeds.has(address);
@@ -1,4 +1,4 @@
1
- import type { Address, BlockTag, Hex } from "viem";
1
+ import { type Address, type BlockTag, type Hex } from "viem";
2
2
  import type { PriceFeedTreeNode } from "../../base/index.js";
3
3
  import { SDKConstruct } from "../../base/index.js";
4
4
  import type { GearboxSDK } from "../../GearboxSDK.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "8.19.4",
3
+ "version": "8.19.5",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",