@continuumdao/ctm-mpc-defi 0.2.31 → 0.2.32

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.
@@ -5,6 +5,6 @@ description: Euler v2 isolated lend/borrow, vault withdraw, and collateral opera
5
5
 
6
6
  # Euler v2 (MCP)
7
7
 
8
- Supported chains from `get_defi_protocol_supported_chains` (subgraph map). Pass `vault` and asset addresses from Euler UI.
8
+ Supported chains from `get_defi_protocol_supported_chains` (Goldsky subgraph map). Underlyings from `get_defi_protocol_supported_tokens` pass `address` as `underlyingAddress` to `ctm_euler_v2_fetch_lend_vaults`, then use the returned `evaultAddress` on build tools.
9
9
 
10
10
  Tools include isolated lend/borrow, collateral deposit/withdraw, vault withdraw, borrow repay. All `ctm_euler_v2_build_*_multisign` tools return `{ requestId }` on success (shared gas/submit section appended by the server).
@@ -1927,12 +1927,12 @@ query E($first: Int!, $skip: Int!) {
1927
1927
  }
1928
1928
  }
1929
1929
  `;
1930
- async function paginateEulerVaultRows(endpoint) {
1930
+ async function paginateEulerVaultRows(chainId) {
1931
1931
  const out = [];
1932
1932
  let skip = 0;
1933
1933
  const first = 1e3;
1934
1934
  while (true) {
1935
- const d = await eulerSubgraphGql(endpoint, VAULT_PAGE, { first, skip });
1935
+ const d = await eulerV2QueryGraphQl(chainId, VAULT_PAGE, { first, skip });
1936
1936
  const rows = d.eulerVaults ?? [];
1937
1937
  if (!rows.length) break;
1938
1938
  for (const r of rows) {
@@ -1944,15 +1944,19 @@ async function paginateEulerVaultRows(endpoint) {
1944
1944
  }
1945
1945
  return out;
1946
1946
  }
1947
- async function paginateEulerEarnAssets(endpoint) {
1947
+ async function paginateEulerEarnAssets(chainId) {
1948
1948
  const assets = [];
1949
1949
  let skip = 0;
1950
1950
  const first = 1e3;
1951
1951
  while (true) {
1952
- const d = await eulerSubgraphGql(endpoint, EARN_PAGE, {
1953
- first,
1954
- skip
1955
- });
1952
+ const d = await eulerV2QueryGraphQl(
1953
+ chainId,
1954
+ EARN_PAGE,
1955
+ {
1956
+ first,
1957
+ skip
1958
+ }
1959
+ );
1956
1960
  const rows = d.eulerEarnVaults ?? [];
1957
1961
  if (!rows.length) break;
1958
1962
  for (const r of rows) {
@@ -1972,8 +1976,8 @@ async function fetchEulerV2ChainAssetCache(chainId) {
1972
1976
  }
1973
1977
  const [nativeWrapped, vaultRows, earnAssets] = await Promise.all([
1974
1978
  resolveEulerWrappedNativeToken(chainId),
1975
- paginateEulerVaultRows(endpoint),
1976
- paginateEulerEarnAssets(endpoint)
1979
+ paginateEulerVaultRows(chainId),
1980
+ paginateEulerEarnAssets(chainId)
1977
1981
  ]);
1978
1982
  const modes = /* @__PURE__ */ new Map();
1979
1983
  const bump = (addr, patch) => {
@@ -1998,7 +2002,10 @@ async function fetchEulerV2ChainAssetCache(chainId) {
1998
2002
  function ensureEulerV2ChainAssetCache(chainId) {
1999
2003
  const hit = eulerV2ChainAssetCache.get(chainId);
2000
2004
  if (hit) return hit;
2001
- const p = fetchEulerV2ChainAssetCache(chainId);
2005
+ const p = fetchEulerV2ChainAssetCache(chainId).catch((e) => {
2006
+ eulerV2ChainAssetCache.delete(chainId);
2007
+ throw e;
2008
+ });
2002
2009
  eulerV2ChainAssetCache.set(chainId, p);
2003
2010
  return p;
2004
2011
  }