@gearbox-protocol/sdk 6.0.0 → 6.0.2
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.
|
@@ -158,11 +158,10 @@ class RedstoneUpdater extends import_base.SDKConstruct {
|
|
|
158
158
|
uncached.push(dataFeedId);
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
|
-
const
|
|
162
|
-
dataServiceId,
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
);
|
|
161
|
+
const [fromRedstoneResp] = await Promise.allSettled([
|
|
162
|
+
this.#fetchPayloads(dataServiceId, new Set(uncached), uniqueSignersCount)
|
|
163
|
+
]);
|
|
164
|
+
const fromRedstone = fromRedstoneResp.status === "fulfilled" ? fromRedstoneResp.value : [];
|
|
166
165
|
if (this.#historicalTimestampMs) {
|
|
167
166
|
for (const resp of fromRedstone) {
|
|
168
167
|
const key = cacheKey(
|
|
@@ -177,6 +176,9 @@ class RedstoneUpdater extends import_base.SDKConstruct {
|
|
|
177
176
|
this.#logger?.debug(
|
|
178
177
|
`got ${fromRedstone.length} new redstone updates and ${fromCache.length} from cache`
|
|
179
178
|
);
|
|
179
|
+
if (fromRedstoneResp.status === "rejected") {
|
|
180
|
+
this.#logger?.error(fromRedstoneResp.reason);
|
|
181
|
+
}
|
|
180
182
|
return [...fromCache, ...fromRedstone];
|
|
181
183
|
}
|
|
182
184
|
/**
|
|
@@ -98,11 +98,11 @@ class GearboxBackendApi {
|
|
|
98
98
|
static getStaticTokenUrl = () => STATIC_TOKEN;
|
|
99
99
|
static getRewardsMerkleUrl = (network, root, account) => {
|
|
100
100
|
const path = `${network}_${root.slice(2)}/${account.slice(2, 4)}`;
|
|
101
|
-
const url = `https://am.gearbox.
|
|
101
|
+
const url = `https://am.gearbox.fi/${path.toLowerCase()}.json`;
|
|
102
102
|
return url;
|
|
103
103
|
};
|
|
104
104
|
static getNFTMerkleUrl = (network, root) => {
|
|
105
|
-
const url = `https://dm.gearbox.
|
|
105
|
+
const url = `https://dm.gearbox.fi/${network.toLowerCase()}_${root}.json`;
|
|
106
106
|
return url;
|
|
107
107
|
};
|
|
108
108
|
static getLeaderboardUrl = (url, chainId) => {
|
|
@@ -134,11 +134,10 @@ class RedstoneUpdater extends SDKConstruct {
|
|
|
134
134
|
uncached.push(dataFeedId);
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
-
const
|
|
138
|
-
dataServiceId,
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
);
|
|
137
|
+
const [fromRedstoneResp] = await Promise.allSettled([
|
|
138
|
+
this.#fetchPayloads(dataServiceId, new Set(uncached), uniqueSignersCount)
|
|
139
|
+
]);
|
|
140
|
+
const fromRedstone = fromRedstoneResp.status === "fulfilled" ? fromRedstoneResp.value : [];
|
|
142
141
|
if (this.#historicalTimestampMs) {
|
|
143
142
|
for (const resp of fromRedstone) {
|
|
144
143
|
const key = cacheKey(
|
|
@@ -153,6 +152,9 @@ class RedstoneUpdater extends SDKConstruct {
|
|
|
153
152
|
this.#logger?.debug(
|
|
154
153
|
`got ${fromRedstone.length} new redstone updates and ${fromCache.length} from cache`
|
|
155
154
|
);
|
|
155
|
+
if (fromRedstoneResp.status === "rejected") {
|
|
156
|
+
this.#logger?.error(fromRedstoneResp.reason);
|
|
157
|
+
}
|
|
156
158
|
return [...fromCache, ...fromRedstone];
|
|
157
159
|
}
|
|
158
160
|
/**
|
|
@@ -69,11 +69,11 @@ class GearboxBackendApi {
|
|
|
69
69
|
static getStaticTokenUrl = () => STATIC_TOKEN;
|
|
70
70
|
static getRewardsMerkleUrl = (network, root, account) => {
|
|
71
71
|
const path = `${network}_${root.slice(2)}/${account.slice(2, 4)}`;
|
|
72
|
-
const url = `https://am.gearbox.
|
|
72
|
+
const url = `https://am.gearbox.fi/${path.toLowerCase()}.json`;
|
|
73
73
|
return url;
|
|
74
74
|
};
|
|
75
75
|
static getNFTMerkleUrl = (network, root) => {
|
|
76
|
-
const url = `https://dm.gearbox.
|
|
76
|
+
const url = `https://dm.gearbox.fi/${network.toLowerCase()}_${root}.json`;
|
|
77
77
|
return url;
|
|
78
78
|
};
|
|
79
79
|
static getLeaderboardUrl = (url, chainId) => {
|