@continuumdao/ctm-mpc-defi 0.2.41 → 0.2.43

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.
Files changed (98) hide show
  1. package/dist/agent/catalog.cjs +219 -27
  2. package/dist/agent/catalog.cjs.map +1 -1
  3. package/dist/agent/catalog.d.ts +914 -197
  4. package/dist/agent/catalog.js +214 -28
  5. package/dist/agent/catalog.js.map +1 -1
  6. package/dist/agent/skills/aerodrome/SKILL.md +1 -1
  7. package/dist/agent/skills/arcus/SKILL.md +1 -1
  8. package/dist/agent/skills/morpho/SKILL.md +32 -5
  9. package/dist/agent/skills/yield-compare/SKILL.md +6 -2
  10. package/dist/chains/evm/index.cjs +6 -2
  11. package/dist/chains/evm/index.cjs.map +1 -1
  12. package/dist/chains/evm/index.js +7 -3
  13. package/dist/chains/evm/index.js.map +1 -1
  14. package/dist/core/index.cjs +14 -0
  15. package/dist/core/index.cjs.map +1 -1
  16. package/dist/core/index.d.ts +7 -2
  17. package/dist/core/index.js +13 -2
  18. package/dist/core/index.js.map +1 -1
  19. package/dist/index.cjs +45 -6
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.d.ts +1 -1
  22. package/dist/index.js +44 -8
  23. package/dist/index.js.map +1 -1
  24. package/dist/protocols/evm/aave-v4/index.cjs +11 -7
  25. package/dist/protocols/evm/aave-v4/index.cjs.map +1 -1
  26. package/dist/protocols/evm/aave-v4/index.js +12 -8
  27. package/dist/protocols/evm/aave-v4/index.js.map +1 -1
  28. package/dist/protocols/evm/aerodrome/index.cjs +81 -50
  29. package/dist/protocols/evm/aerodrome/index.cjs.map +1 -1
  30. package/dist/protocols/evm/aerodrome/index.d.ts +8 -8
  31. package/dist/protocols/evm/aerodrome/index.js +96 -65
  32. package/dist/protocols/evm/aerodrome/index.js.map +1 -1
  33. package/dist/protocols/evm/arcus/index.cjs +6 -2
  34. package/dist/protocols/evm/arcus/index.cjs.map +1 -1
  35. package/dist/protocols/evm/arcus/index.js +7 -3
  36. package/dist/protocols/evm/arcus/index.js.map +1 -1
  37. package/dist/protocols/evm/circle-cctp/index.cjs +7 -3
  38. package/dist/protocols/evm/circle-cctp/index.cjs.map +1 -1
  39. package/dist/protocols/evm/circle-cctp/index.js +8 -4
  40. package/dist/protocols/evm/circle-cctp/index.js.map +1 -1
  41. package/dist/protocols/evm/compound-v3/index.cjs +9 -3
  42. package/dist/protocols/evm/compound-v3/index.cjs.map +1 -1
  43. package/dist/protocols/evm/compound-v3/index.js +10 -4
  44. package/dist/protocols/evm/compound-v3/index.js.map +1 -1
  45. package/dist/protocols/evm/continuum-dao/index.cjs +11 -5
  46. package/dist/protocols/evm/continuum-dao/index.cjs.map +1 -1
  47. package/dist/protocols/evm/continuum-dao/index.js +12 -6
  48. package/dist/protocols/evm/continuum-dao/index.js.map +1 -1
  49. package/dist/protocols/evm/curve-dao/index.cjs +8 -4
  50. package/dist/protocols/evm/curve-dao/index.cjs.map +1 -1
  51. package/dist/protocols/evm/curve-dao/index.js +9 -5
  52. package/dist/protocols/evm/curve-dao/index.js.map +1 -1
  53. package/dist/protocols/evm/ethena/index.cjs +13 -9
  54. package/dist/protocols/evm/ethena/index.cjs.map +1 -1
  55. package/dist/protocols/evm/ethena/index.js +14 -10
  56. package/dist/protocols/evm/ethena/index.js.map +1 -1
  57. package/dist/protocols/evm/euler-v2/index.cjs +20 -16
  58. package/dist/protocols/evm/euler-v2/index.cjs.map +1 -1
  59. package/dist/protocols/evm/euler-v2/index.js +21 -17
  60. package/dist/protocols/evm/euler-v2/index.js.map +1 -1
  61. package/dist/protocols/evm/gmx/index.cjs +12 -8
  62. package/dist/protocols/evm/gmx/index.cjs.map +1 -1
  63. package/dist/protocols/evm/gmx/index.js +13 -9
  64. package/dist/protocols/evm/gmx/index.js.map +1 -1
  65. package/dist/protocols/evm/hyperliquid/index.cjs +5 -1
  66. package/dist/protocols/evm/hyperliquid/index.cjs.map +1 -1
  67. package/dist/protocols/evm/hyperliquid/index.js +6 -2
  68. package/dist/protocols/evm/hyperliquid/index.js.map +1 -1
  69. package/dist/protocols/evm/lido/index.cjs +7 -3
  70. package/dist/protocols/evm/lido/index.cjs.map +1 -1
  71. package/dist/protocols/evm/lido/index.js +8 -4
  72. package/dist/protocols/evm/lido/index.js.map +1 -1
  73. package/dist/protocols/evm/maple/index.cjs +7 -3
  74. package/dist/protocols/evm/maple/index.cjs.map +1 -1
  75. package/dist/protocols/evm/maple/index.js +8 -4
  76. package/dist/protocols/evm/maple/index.js.map +1 -1
  77. package/dist/protocols/evm/morpho/index.cjs +454 -64
  78. package/dist/protocols/evm/morpho/index.cjs.map +1 -1
  79. package/dist/protocols/evm/morpho/index.d.ts +123 -2
  80. package/dist/protocols/evm/morpho/index.js +432 -66
  81. package/dist/protocols/evm/morpho/index.js.map +1 -1
  82. package/dist/protocols/evm/pendle/index.cjs +9 -3
  83. package/dist/protocols/evm/pendle/index.cjs.map +1 -1
  84. package/dist/protocols/evm/pendle/index.js +10 -4
  85. package/dist/protocols/evm/pendle/index.js.map +1 -1
  86. package/dist/protocols/evm/sky/index.cjs +17 -13
  87. package/dist/protocols/evm/sky/index.cjs.map +1 -1
  88. package/dist/protocols/evm/sky/index.js +18 -14
  89. package/dist/protocols/evm/sky/index.js.map +1 -1
  90. package/dist/protocols/evm/uniswap-v4/index.cjs +13 -7
  91. package/dist/protocols/evm/uniswap-v4/index.cjs.map +1 -1
  92. package/dist/protocols/evm/uniswap-v4/index.js +14 -8
  93. package/dist/protocols/evm/uniswap-v4/index.js.map +1 -1
  94. package/dist/protocols/evm/venice/index.cjs +10 -4
  95. package/dist/protocols/evm/venice/index.cjs.map +1 -1
  96. package/dist/protocols/evm/venice/index.js +10 -4
  97. package/dist/protocols/evm/venice/index.js.map +1 -1
  98. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { parseAbi, isAddress, getAddress, defineChain, createPublicClient, http, parseUnits, encodeFunctionData, formatUnits, zeroAddress, parseGwei, serializeTransaction, keccak256 } from 'viem';
1
+ import { parseAbi, isAddress, getAddress, defineChain, createPublicClient, parseUnits, encodeFunctionData, formatUnits, zeroAddress, http, parseGwei, serializeTransaction, keccak256 } from 'viem';
2
2
  import { isValidRpcUrl, fetchChainFeeParams, gasLimitFromEstimateAndChainConfig, gweiToDecimalString, proposalTxParamsToFeeSnapshot, alignEip1559FeesWithLatestBase, getClientIdFromKeyGenResult } from '@continuumdao/continuum-node-sdk';
3
3
 
4
4
  // src/core/registry.ts
@@ -569,6 +569,10 @@ function buildAaveV4BorrowTableRowsFromHub(borrowable, hubReserves, debtByUnderl
569
569
  };
570
570
  });
571
571
  }
572
+ function defiEvmTransport(rpcUrl, opts) {
573
+ const url = rpcUrl.trim();
574
+ return http(url, opts);
575
+ }
572
576
  var spokeStaticAbi = [
573
577
  {
574
578
  name: "getReserveCount",
@@ -630,7 +634,7 @@ async function fetchAaveV4SpokeReserveIdForUnderlying(args) {
630
634
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
631
635
  rpcUrls: { default: { http: [url] } }
632
636
  });
633
- const client = createPublicClient({ chain, transport: http(url) });
637
+ const client = createPublicClient({ chain, transport: defiEvmTransport(url) });
634
638
  const count = await client.readContract({
635
639
  address: spoke,
636
640
  abi: spokeStaticAbi,
@@ -660,7 +664,7 @@ async function fetchAaveV4SpokeReserveStatusForUnderlying(args) {
660
664
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
661
665
  rpcUrls: { default: { http: [url] } }
662
666
  });
663
- const client = createPublicClient({ chain, transport: http(url) });
667
+ const client = createPublicClient({ chain, transport: defiEvmTransport(url) });
664
668
  const cfg = await client.readContract({
665
669
  address: spoke,
666
670
  abi: spokeStaticAbi,
@@ -767,7 +771,7 @@ async function buildEvmMultisignBatch(args) {
767
771
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
768
772
  rpcUrls: { default: { http: [rpcUrl] } }
769
773
  });
770
- const publicClient = createPublicClient({ chain: ch, transport: http(rpcUrl) });
774
+ const publicClient = createPublicClient({ chain: ch, transport: defiEvmTransport(rpcUrl) });
771
775
  const feeParams = await fetchChainFeeParams(rpcUrl, chainId);
772
776
  const legacy = Boolean(chainDetail?.legacy) || !feeParams.isEip1559;
773
777
  const latestBaseFeeWei = !legacy ? (await publicClient.getBlock({ blockTag: "latest" })).baseFeePerGas ?? 0n : 0n;
@@ -953,7 +957,7 @@ async function buildEvmMultisignBodyAaveV4DepositBatch(args) {
953
957
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
954
958
  rpcUrls: { default: { http: [args.rpcUrl] } }
955
959
  });
956
- const publicClient = createPublicClient({ chain: ch, transport: http(args.rpcUrl) });
960
+ const publicClient = createPublicClient({ chain: ch, transport: defiEvmTransport(args.rpcUrl) });
957
961
  const dec = await publicClient.readContract({
958
962
  address: asset,
959
963
  abi: erc20AllowanceAbi,
@@ -1166,7 +1170,7 @@ async function buildEvmMultisignBodyAaveV4SpokeWithdraw(args) {
1166
1170
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
1167
1171
  rpcUrls: { default: { http: [args.rpcUrl] } }
1168
1172
  });
1169
- const publicClient = createPublicClient({ chain: ch, transport: http(args.rpcUrl) });
1173
+ const publicClient = createPublicClient({ chain: ch, transport: defiEvmTransport(args.rpcUrl) });
1170
1174
  const dec = await publicClient.readContract({
1171
1175
  address: asset,
1172
1176
  abi: erc20AllowanceAbi,
@@ -1242,7 +1246,7 @@ async function buildEvmMultisignBodyAaveV4SpokeBorrow(args) {
1242
1246
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
1243
1247
  rpcUrls: { default: { http: [args.rpcUrl] } }
1244
1248
  });
1245
- const publicClient = createPublicClient({ chain: ch, transport: http(args.rpcUrl) });
1249
+ const publicClient = createPublicClient({ chain: ch, transport: defiEvmTransport(args.rpcUrl) });
1246
1250
  const dec = await publicClient.readContract({
1247
1251
  address: asset,
1248
1252
  abi: erc20AllowanceAbi,
@@ -1318,7 +1322,7 @@ async function buildEvmMultisignBodyAaveV4SpokeRepay(args) {
1318
1322
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
1319
1323
  rpcUrls: { default: { http: [args.rpcUrl] } }
1320
1324
  });
1321
- const publicClient = createPublicClient({ chain: ch, transport: http(args.rpcUrl) });
1325
+ const publicClient = createPublicClient({ chain: ch, transport: defiEvmTransport(args.rpcUrl) });
1322
1326
  const dec = await publicClient.readContract({
1323
1327
  address: asset,
1324
1328
  abi: erc20AllowanceAbi,