@gearbox-protocol/sdk 8.26.2 → 8.26.4

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.
@@ -91,22 +91,32 @@ class PythUpdater extends import_base.SDKConstruct {
91
91
  feeds.filter(isPyth).map((f) => [f.priceFeedId, f])
92
92
  );
93
93
  const payloads = await this.#getPayloads(new Set(pythFeeds.keys()));
94
- const results = payloads.map((p) => {
94
+ let [minTimestamp, maxTimestamp] = [Number.POSITIVE_INFINITY, 0];
95
+ const results = [];
96
+ for (const p of payloads) {
95
97
  const priceFeed = pythFeeds.get(p.dataFeedId);
96
98
  if (!priceFeed) {
97
99
  throw new Error(`cannot find price feed for ${p.dataFeedId}`);
98
100
  }
99
101
  const { dataFeedId, timestamp, cached, data } = p;
100
- return new PythUpdateTx(priceFeed.createPriceUpdateTx(data), {
101
- dataFeedId,
102
- priceFeed: priceFeed.address,
103
- timestamp,
104
- cached
105
- });
106
- });
102
+ minTimestamp = Math.min(minTimestamp, timestamp);
103
+ maxTimestamp = Math.max(maxTimestamp, timestamp);
104
+ results.push(
105
+ new PythUpdateTx(priceFeed.createPriceUpdateTx(data), {
106
+ dataFeedId,
107
+ priceFeed: priceFeed.address,
108
+ timestamp,
109
+ cached
110
+ })
111
+ );
112
+ }
113
+ let tsRange = "";
114
+ if (results.length) {
115
+ tsRange = `, timestamp range: ${minTimestamp} - ${maxTimestamp}`;
116
+ }
107
117
  this.#logger?.debug(
108
118
  logContext,
109
- `generated ${results.length} update transactions for pyth price feeds: ${Array.from(pythFeeds.keys()).join(", ")}`
119
+ `generated ${results.length} update transactions for pyth price feeds: ${Array.from(pythFeeds.keys()).join(", ")}${tsRange}`
110
120
  );
111
121
  return results;
112
122
  }
@@ -109,6 +109,7 @@ class RedstoneUpdater extends import_base.SDKConstruct {
109
109
  priceFeeds.set(feed.dataId, pfsForDataId);
110
110
  }
111
111
  const results = [];
112
+ let [minTimestamp, maxTimestamp] = [Number.POSITIVE_INFINITY, 0];
112
113
  for (const [key, group] of Object.entries(groupedFeeds)) {
113
114
  const [dataServiceId, signersStr] = key.split(":");
114
115
  const uniqueSignersCount = parseInt(signersStr, 10);
@@ -123,6 +124,8 @@ class RedstoneUpdater extends import_base.SDKConstruct {
123
124
  throw new Error(`cannot get price feed addresses for ${dataFeedId}`);
124
125
  }
125
126
  for (const priceFeed of pfsForDataId.values()) {
127
+ minTimestamp = Math.min(minTimestamp, timestamp);
128
+ maxTimestamp = Math.max(maxTimestamp, timestamp);
126
129
  results.push(
127
130
  new RedstoneUpdateTx(priceFeed.createPriceUpdateTx(data), {
128
131
  dataFeedId,
@@ -135,9 +138,13 @@ class RedstoneUpdater extends import_base.SDKConstruct {
135
138
  }
136
139
  }
137
140
  }
141
+ let tsRange = "";
142
+ if (results.length) {
143
+ tsRange = `, timestamp range: ${minTimestamp} - ${maxTimestamp}`;
144
+ }
138
145
  this.#logger?.debug(
139
146
  logContext,
140
- `generated ${results.length} update transactions for redstone price feeds: ${Array.from(priceFeeds.keys()).join(", ")}`
147
+ `generated ${results.length} update transactions for redstone price feeds: ${Array.from(priceFeeds.keys()).join(", ")}${tsRange}`
141
148
  );
142
149
  return results;
143
150
  }
@@ -41,7 +41,7 @@ const HUMAN_READABLE_SYMBOLS = {
41
41
  PT_beraSTONE_10APR2025: "pt.beraSTONE(10.04.25)",
42
42
  PT_uptBTC_14AUG2025: "pt.uptBTC(14.08.25)",
43
43
  PT_sUSDX_1SEP2025: "pt.sUSDX(1.09.25)",
44
- PT_sUSDf_25SEP2025: "pt.sUSDf(1.09.25)",
44
+ PT_sUSDf_25SEP2025: "pt.sUSDf(25.09.25)",
45
45
  PT_USDf_29JAN2026: "pt.USDf(29.01.26)",
46
46
  ["PT-wstUSR-25SEP2025"]: "pt.wstUSR(25.09.25)",
47
47
  ["PT-yUSD-27NOV2025"]: "pt.yUSD(27.11.25)",
@@ -71,22 +71,32 @@ class PythUpdater extends SDKConstruct {
71
71
  feeds.filter(isPyth).map((f) => [f.priceFeedId, f])
72
72
  );
73
73
  const payloads = await this.#getPayloads(new Set(pythFeeds.keys()));
74
- const results = payloads.map((p) => {
74
+ let [minTimestamp, maxTimestamp] = [Number.POSITIVE_INFINITY, 0];
75
+ const results = [];
76
+ for (const p of payloads) {
75
77
  const priceFeed = pythFeeds.get(p.dataFeedId);
76
78
  if (!priceFeed) {
77
79
  throw new Error(`cannot find price feed for ${p.dataFeedId}`);
78
80
  }
79
81
  const { dataFeedId, timestamp, cached, data } = p;
80
- return new PythUpdateTx(priceFeed.createPriceUpdateTx(data), {
81
- dataFeedId,
82
- priceFeed: priceFeed.address,
83
- timestamp,
84
- cached
85
- });
86
- });
82
+ minTimestamp = Math.min(minTimestamp, timestamp);
83
+ maxTimestamp = Math.max(maxTimestamp, timestamp);
84
+ results.push(
85
+ new PythUpdateTx(priceFeed.createPriceUpdateTx(data), {
86
+ dataFeedId,
87
+ priceFeed: priceFeed.address,
88
+ timestamp,
89
+ cached
90
+ })
91
+ );
92
+ }
93
+ let tsRange = "";
94
+ if (results.length) {
95
+ tsRange = `, timestamp range: ${minTimestamp} - ${maxTimestamp}`;
96
+ }
87
97
  this.#logger?.debug(
88
98
  logContext,
89
- `generated ${results.length} update transactions for pyth price feeds: ${Array.from(pythFeeds.keys()).join(", ")}`
99
+ `generated ${results.length} update transactions for pyth price feeds: ${Array.from(pythFeeds.keys()).join(", ")}${tsRange}`
90
100
  );
91
101
  return results;
92
102
  }
@@ -85,6 +85,7 @@ class RedstoneUpdater extends SDKConstruct {
85
85
  priceFeeds.set(feed.dataId, pfsForDataId);
86
86
  }
87
87
  const results = [];
88
+ let [minTimestamp, maxTimestamp] = [Number.POSITIVE_INFINITY, 0];
88
89
  for (const [key, group] of Object.entries(groupedFeeds)) {
89
90
  const [dataServiceId, signersStr] = key.split(":");
90
91
  const uniqueSignersCount = parseInt(signersStr, 10);
@@ -99,6 +100,8 @@ class RedstoneUpdater extends SDKConstruct {
99
100
  throw new Error(`cannot get price feed addresses for ${dataFeedId}`);
100
101
  }
101
102
  for (const priceFeed of pfsForDataId.values()) {
103
+ minTimestamp = Math.min(minTimestamp, timestamp);
104
+ maxTimestamp = Math.max(maxTimestamp, timestamp);
102
105
  results.push(
103
106
  new RedstoneUpdateTx(priceFeed.createPriceUpdateTx(data), {
104
107
  dataFeedId,
@@ -111,9 +114,13 @@ class RedstoneUpdater extends SDKConstruct {
111
114
  }
112
115
  }
113
116
  }
117
+ let tsRange = "";
118
+ if (results.length) {
119
+ tsRange = `, timestamp range: ${minTimestamp} - ${maxTimestamp}`;
120
+ }
114
121
  this.#logger?.debug(
115
122
  logContext,
116
- `generated ${results.length} update transactions for redstone price feeds: ${Array.from(priceFeeds.keys()).join(", ")}`
123
+ `generated ${results.length} update transactions for redstone price feeds: ${Array.from(priceFeeds.keys()).join(", ")}${tsRange}`
117
124
  );
118
125
  return results;
119
126
  }
@@ -18,7 +18,7 @@ const HUMAN_READABLE_SYMBOLS = {
18
18
  PT_beraSTONE_10APR2025: "pt.beraSTONE(10.04.25)",
19
19
  PT_uptBTC_14AUG2025: "pt.uptBTC(14.08.25)",
20
20
  PT_sUSDX_1SEP2025: "pt.sUSDX(1.09.25)",
21
- PT_sUSDf_25SEP2025: "pt.sUSDf(1.09.25)",
21
+ PT_sUSDf_25SEP2025: "pt.sUSDf(25.09.25)",
22
22
  PT_USDf_29JAN2026: "pt.USDf(29.01.26)",
23
23
  ["PT-wstUSR-25SEP2025"]: "pt.wstUSR(25.09.25)",
24
24
  ["PT-yUSD-27NOV2025"]: "pt.yUSD(27.11.25)",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "8.26.2",
3
+ "version": "8.26.4",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",