@gearbox-protocol/sdk 10.2.7 → 10.2.9
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.
- package/dist/cjs/plugins/adapters/contracts/MidasRedemptionVaultAdapterContract.js +6 -2
- package/dist/cjs/sdk/market/pricefeeds/updates/PythUpdater.js +10 -1
- package/dist/esm/plugins/adapters/contracts/MidasRedemptionVaultAdapterContract.js +6 -2
- package/dist/esm/sdk/market/pricefeeds/updates/PythUpdater.js +10 -1
- package/dist/types/permissionless/core/bytecode.d.ts +1 -0
- package/dist/types/plugins/adapters/contracts/MidasRedemptionVaultAdapterContract.d.ts +4 -1
- package/package.json +1 -1
|
@@ -36,13 +36,17 @@ class MidasRedemptionVaultAdapterContract extends import_AbstractAdapter.Abstrac
|
|
|
36
36
|
{ type: "address", name: "targetContract" },
|
|
37
37
|
{ type: "address", name: "gateway" },
|
|
38
38
|
{ type: "address", name: "mToken" },
|
|
39
|
-
{ type: "address[]", name: "allowedTokens" }
|
|
39
|
+
{ type: "address[]", name: "allowedTokens" },
|
|
40
|
+
{ type: "address[]", name: "allowedPhantomTokens" }
|
|
40
41
|
],
|
|
41
42
|
args.baseParams.serializedParams
|
|
42
43
|
);
|
|
43
44
|
this.gateway = decoded[2];
|
|
44
45
|
this.mToken = decoded[3];
|
|
45
|
-
this.allowedTokens =
|
|
46
|
+
this.allowedTokens = decoded[4].map((token, index) => ({
|
|
47
|
+
token,
|
|
48
|
+
phantomToken: decoded[5][index]
|
|
49
|
+
}));
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
52
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -191,13 +191,22 @@ class PythUpdater extends import_base.SDKConstruct {
|
|
|
191
191
|
},
|
|
192
192
|
{ attempts: 3, exponent: 2, interval: 200 }
|
|
193
193
|
);
|
|
194
|
-
|
|
194
|
+
const result = respToCalldata(resp);
|
|
195
|
+
if (!this.#ignoreMissingFeeds && result.length !== dataFeedsIds.size) {
|
|
196
|
+
throw new Error(
|
|
197
|
+
`expected ${dataFeedsIds.size} price feeds, got ${result.length}`
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
return result;
|
|
195
201
|
}
|
|
196
202
|
}
|
|
197
203
|
function isPyth(pf) {
|
|
198
204
|
return pf.contractType === "PRICE_FEED::PYTH";
|
|
199
205
|
}
|
|
200
206
|
function respToCalldata(resp) {
|
|
207
|
+
if (resp.binary.data.length === 0) {
|
|
208
|
+
return [];
|
|
209
|
+
}
|
|
201
210
|
const updates = splitAccumulatorUpdates(resp.binary.data[0]);
|
|
202
211
|
return updates.map(({ data, dataFeedId, timestamp }) => {
|
|
203
212
|
return {
|
|
@@ -13,13 +13,17 @@ class MidasRedemptionVaultAdapterContract extends AbstractAdapterContract {
|
|
|
13
13
|
{ type: "address", name: "targetContract" },
|
|
14
14
|
{ type: "address", name: "gateway" },
|
|
15
15
|
{ type: "address", name: "mToken" },
|
|
16
|
-
{ type: "address[]", name: "allowedTokens" }
|
|
16
|
+
{ type: "address[]", name: "allowedTokens" },
|
|
17
|
+
{ type: "address[]", name: "allowedPhantomTokens" }
|
|
17
18
|
],
|
|
18
19
|
args.baseParams.serializedParams
|
|
19
20
|
);
|
|
20
21
|
this.gateway = decoded[2];
|
|
21
22
|
this.mToken = decoded[3];
|
|
22
|
-
this.allowedTokens =
|
|
23
|
+
this.allowedTokens = decoded[4].map((token, index) => ({
|
|
24
|
+
token,
|
|
25
|
+
phantomToken: decoded[5][index]
|
|
26
|
+
}));
|
|
23
27
|
}
|
|
24
28
|
}
|
|
25
29
|
export {
|
|
@@ -171,13 +171,22 @@ class PythUpdater extends SDKConstruct {
|
|
|
171
171
|
},
|
|
172
172
|
{ attempts: 3, exponent: 2, interval: 200 }
|
|
173
173
|
);
|
|
174
|
-
|
|
174
|
+
const result = respToCalldata(resp);
|
|
175
|
+
if (!this.#ignoreMissingFeeds && result.length !== dataFeedsIds.size) {
|
|
176
|
+
throw new Error(
|
|
177
|
+
`expected ${dataFeedsIds.size} price feeds, got ${result.length}`
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
return result;
|
|
175
181
|
}
|
|
176
182
|
}
|
|
177
183
|
function isPyth(pf) {
|
|
178
184
|
return pf.contractType === "PRICE_FEED::PYTH";
|
|
179
185
|
}
|
|
180
186
|
function respToCalldata(resp) {
|
|
187
|
+
if (resp.binary.data.length === 0) {
|
|
188
|
+
return [];
|
|
189
|
+
}
|
|
181
190
|
const updates = splitAccumulatorUpdates(resp.binary.data[0]);
|
|
182
191
|
return updates.map(({ data, dataFeedId, timestamp }) => {
|
|
183
192
|
return {
|
|
@@ -7,7 +7,10 @@ type abi = typeof abi;
|
|
|
7
7
|
export declare class MidasRedemptionVaultAdapterContract extends AbstractAdapterContract<abi> {
|
|
8
8
|
readonly gateway: Address;
|
|
9
9
|
readonly mToken: Address;
|
|
10
|
-
readonly allowedTokens:
|
|
10
|
+
readonly allowedTokens: {
|
|
11
|
+
token: Address;
|
|
12
|
+
phantomToken: Address;
|
|
13
|
+
}[];
|
|
11
14
|
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<abi>, "abi">);
|
|
12
15
|
}
|
|
13
16
|
export {};
|