@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, parseAbiParameters, parseAbiItem, getAddress, createPublicClient, http, defineChain, zeroAddress, formatUnits, parseUnits, encodeFunctionData, keccak256, encodeAbiParameters, decodeEventLog, decodeFunctionData, parseGwei, serializeTransaction, erc20Abi, hashTypedData, stringToHex } from 'viem';
1
+ import { parseAbi, parseAbiParameters, parseAbiItem, getAddress, createPublicClient, defineChain, zeroAddress, formatUnits, parseUnits, encodeFunctionData, keccak256, encodeAbiParameters, decodeEventLog, http, decodeFunctionData, parseGwei, serializeTransaction, erc20Abi, hashTypedData, stringToHex } from 'viem';
2
2
  import { nodeFetchWithReadAuth, fetchChainFeeParams, gasLimitFromEstimateAndChainConfig, gweiToDecimalString, proposalTxParamsToFeeSnapshot, alignEip1559FeesWithLatestBase, getClientIdFromKeyGenResult } from '@continuumdao/continuum-node-sdk';
3
3
 
4
4
  // src/core/registry.ts
@@ -260,6 +260,12 @@ var UNISWAP_V4_LP_WETH_DEPOSIT_FALLBACK = 120000n;
260
260
  var UNISWAP_V4_LP_PERMIT2_APPROVE_FALLBACK = 100000n;
261
261
  var UNISWAP_V4_PERMISSION_FLAG_SWAP = 1;
262
262
  var UNISWAP_V4_PERMISSION_FLAG_LIQUIDITY = 2;
263
+ function defiEvmTransport(rpcUrl, opts) {
264
+ const url = rpcUrl.trim();
265
+ return http(url, opts);
266
+ }
267
+
268
+ // src/protocols/evm/uniswap-v4/permissions.ts
263
269
  var permissionsAdapterAbi = parseAbi([
264
270
  "function isAllowed(address account, uint8 permission) view returns (bool)",
265
271
  "function PERMISSIONED_TOKEN() view returns (address)"
@@ -413,7 +419,7 @@ async function readUniswapV4OnChainPermissionFlags(args) {
413
419
  nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18 },
414
420
  rpcUrls: { default: { http: [args.rpcUrl] } }
415
421
  }),
416
- transport: http(args.rpcUrl)
422
+ transport: defiEvmTransport(args.rpcUrl)
417
423
  });
418
424
  const wallet = getAddress(args.walletAddress);
419
425
  const out = [];
@@ -1048,7 +1054,7 @@ async function buildEvmMultisignBatch(args) {
1048
1054
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
1049
1055
  rpcUrls: { default: { http: [rpcUrl] } }
1050
1056
  });
1051
- const publicClient = createPublicClient({ chain: ch, transport: http(rpcUrl) });
1057
+ const publicClient = createPublicClient({ chain: ch, transport: defiEvmTransport(rpcUrl) });
1052
1058
  const feeParams = await fetchChainFeeParams(rpcUrl, chainId);
1053
1059
  const legacy = Boolean(chainDetail?.legacy) || !feeParams.isEip1559;
1054
1060
  const latestBaseFeeWei = !legacy ? (await publicClient.getBlock({ blockTag: "latest" })).baseFeePerGas ?? 0n : 0n;
@@ -1683,7 +1689,7 @@ async function buildEvmMultisignBodyUniswapV4SkipPermit2Batch(args) {
1683
1689
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
1684
1690
  rpcUrls: { default: { http: [args.rpcUrl] } }
1685
1691
  }),
1686
- transport: http(args.rpcUrl)
1692
+ transport: defiEvmTransport(args.rpcUrl)
1687
1693
  });
1688
1694
  const erc20ApproveSteps = await buildConditionalErc20ApproveSteps({
1689
1695
  publicClient,
@@ -2538,7 +2544,7 @@ async function resolveUniswapV4PositionScanFromDate(args) {
2538
2544
  nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18 },
2539
2545
  rpcUrls: { default: { http: [args.rpcUrl] } }
2540
2546
  });
2541
- const client = createPublicClient({ chain, transport: http(args.rpcUrl) });
2547
+ const client = createPublicClient({ chain, transport: defiEvmTransport(args.rpcUrl) });
2542
2548
  const latest = await client.getBlockNumber();
2543
2549
  const deploy = getUniswapV4PositionManagerDeployBlock(args.chainId) ?? 0n;
2544
2550
  const resolved = await resolveBlockAtOrAfterUnixTime(client, unixTime, {
@@ -2565,7 +2571,7 @@ async function listUniswapV4PositionsForWallet(args) {
2565
2571
  nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18 },
2566
2572
  rpcUrls: { default: { http: [args.rpcUrl] } }
2567
2573
  });
2568
- const client = createPublicClient({ chain, transport: http(args.rpcUrl) });
2574
+ const client = createPublicClient({ chain, transport: defiEvmTransport(args.rpcUrl) });
2569
2575
  const latest = await client.getBlockNumber();
2570
2576
  const maxScan = args.maxBlocksToScan ?? 500000n;
2571
2577
  const chunkSize = args.chunkSize ?? UNISWAP_V4_LP_LOG_CHUNK_SIZE_DEFAULT;
@@ -2653,7 +2659,7 @@ async function readUniswapV4PositionInfoRaw(args) {
2653
2659
  nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18 },
2654
2660
  rpcUrls: { default: { http: [args.rpcUrl] } }
2655
2661
  });
2656
- const client = createPublicClient({ chain, transport: http(args.rpcUrl) });
2662
+ const client = createPublicClient({ chain, transport: defiEvmTransport(args.rpcUrl) });
2657
2663
  const info = await client.readContract({
2658
2664
  address: pm,
2659
2665
  abi: positionInfoAbi,
@@ -2843,7 +2849,7 @@ async function buildEvmMultisignBodyUniswapV4LiquidityBatchInternal(args) {
2843
2849
  nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18 },
2844
2850
  rpcUrls: { default: { http: [args.rpcUrl] } }
2845
2851
  });
2846
- const publicClient = createPublicClient({ chain, transport: http(args.rpcUrl) });
2852
+ const publicClient = createPublicClient({ chain, transport: defiEvmTransport(args.rpcUrl) });
2847
2853
  const needsTokenApproves = args.action === "mint" || args.action === "increase";
2848
2854
  const approveTargets = needsTokenApproves ? await resolveApproveTargets({
2849
2855
  publicClient,