@gearbox-protocol/sdk 16.6.0 → 16.6.1

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.
@@ -188,12 +188,15 @@ async function discoverMidasGateways(sdk) {
188
188
  return new require_onchain_utils_AddressSet.AddressSet(suites.map((suite) => suite.gateway)).asArray();
189
189
  }
190
190
  /**
191
- * mTokens of all Midas gateway adapters of the loaded credit managers
191
+ * mTokens of the Midas credit suites of the loaded credit managers.
192
+ *
193
+ * A manager with a gateway adapter contributes that adapter's mToken, so its
194
+ * degen NFT is not consulted. Suites that only have a Midas degen NFT
195
+ * contribute the mToken read from the gateway.
192
196
  */
193
- function discoverMidasMTokens(sdk) {
194
- const mTokens = new require_onchain_utils_AddressSet.AddressSet();
195
- for (const cm of sdk.marketRegister.creditManagers) for (const adapter of cm.creditManager.adapters.values()) if (adapter instanceof require_onchain_market_adapters_contracts_MidasGatewayAdapterContract.MidasGatewayAdapterContract) mTokens.add(adapter.mToken);
196
- return mTokens.asArray();
197
+ async function discoverMidasMTokens(sdk) {
198
+ const suites = await discoverMidasCreditSuites(sdk);
199
+ return new require_onchain_utils_AddressSet.AddressSet(suites.map((suite) => suite.mToken)).asArray();
197
200
  }
198
201
  //#endregion
199
202
  exports.discoverMidasCreditSuites = discoverMidasCreditSuites;
@@ -187,12 +187,15 @@ async function discoverMidasGateways(sdk) {
187
187
  return new AddressSet(suites.map((suite) => suite.gateway)).asArray();
188
188
  }
189
189
  /**
190
- * mTokens of all Midas gateway adapters of the loaded credit managers
190
+ * mTokens of the Midas credit suites of the loaded credit managers.
191
+ *
192
+ * A manager with a gateway adapter contributes that adapter's mToken, so its
193
+ * degen NFT is not consulted. Suites that only have a Midas degen NFT
194
+ * contribute the mToken read from the gateway.
191
195
  */
192
- function discoverMidasMTokens(sdk) {
193
- const mTokens = new AddressSet();
194
- for (const cm of sdk.marketRegister.creditManagers) for (const adapter of cm.creditManager.adapters.values()) if (adapter instanceof MidasGatewayAdapterContract) mTokens.add(adapter.mToken);
195
- return mTokens.asArray();
196
+ async function discoverMidasMTokens(sdk) {
197
+ const suites = await discoverMidasCreditSuites(sdk);
198
+ return new AddressSet(suites.map((suite) => suite.mToken)).asArray();
196
199
  }
197
200
  //#endregion
198
201
  export { discoverMidasCreditSuites, discoverMidasGateways, discoverMidasMTokens, unpauseMidasIssuanceVault };
@@ -55,8 +55,12 @@ declare function discoverMidasCreditSuites(sdk: OnchainSDK): Promise<MidasCredit
55
55
  */
56
56
  declare function discoverMidasGateways(sdk: OnchainSDK): Promise<Address[]>;
57
57
  /**
58
- * mTokens of all Midas gateway adapters of the loaded credit managers
58
+ * mTokens of the Midas credit suites of the loaded credit managers.
59
+ *
60
+ * A manager with a gateway adapter contributes that adapter's mToken, so its
61
+ * degen NFT is not consulted. Suites that only have a Midas degen NFT
62
+ * contribute the mToken read from the gateway.
59
63
  */
60
- declare function discoverMidasMTokens(sdk: OnchainSDK): Address[];
64
+ declare function discoverMidasMTokens(sdk: OnchainSDK): Promise<Address[]>;
61
65
  //#endregion
62
66
  export { MidasCreditSuite, RestoreMidasIssuanceVaultPause, UnpauseMidasIssuanceVaultProps, discoverMidasCreditSuites, discoverMidasGateways, discoverMidasMTokens, unpauseMidasIssuanceVault };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "16.6.0",
3
+ "version": "16.6.1",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "repository": {