@continuumdao/ctm-mpc-defi 0.2.40 → 0.2.42

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 +50 -6
  2. package/dist/agent/catalog.cjs.map +1 -1
  3. package/dist/agent/catalog.js +50 -6
  4. package/dist/agent/catalog.js.map +1 -1
  5. package/dist/agent/skills/aave-v4/SKILL.md +1 -1
  6. package/dist/agent/skills/circle-cctp/SKILL.md +1 -0
  7. package/dist/agent/skills/morpho/SKILL.md +11 -0
  8. package/dist/agent/skills/uniswap-v4/SKILL.md +1 -1
  9. package/dist/chains/evm/index.cjs +7 -2
  10. package/dist/chains/evm/index.cjs.map +1 -1
  11. package/dist/chains/evm/index.js +8 -3
  12. package/dist/chains/evm/index.js.map +1 -1
  13. package/dist/core/index.cjs +14 -0
  14. package/dist/core/index.cjs.map +1 -1
  15. package/dist/core/index.d.ts +7 -2
  16. package/dist/core/index.js +13 -2
  17. package/dist/core/index.js.map +1 -1
  18. package/dist/index.cjs +52 -8
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.ts +1 -1
  21. package/dist/index.js +51 -10
  22. package/dist/index.js.map +1 -1
  23. package/dist/protocols/evm/aave-v4/index.cjs +11 -7
  24. package/dist/protocols/evm/aave-v4/index.cjs.map +1 -1
  25. package/dist/protocols/evm/aave-v4/index.js +12 -8
  26. package/dist/protocols/evm/aave-v4/index.js.map +1 -1
  27. package/dist/protocols/evm/aerodrome/index.cjs +14 -2
  28. package/dist/protocols/evm/aerodrome/index.cjs.map +1 -1
  29. package/dist/protocols/evm/aerodrome/index.js +14 -2
  30. package/dist/protocols/evm/aerodrome/index.js.map +1 -1
  31. package/dist/protocols/evm/arcus/index.cjs +6 -2
  32. package/dist/protocols/evm/arcus/index.cjs.map +1 -1
  33. package/dist/protocols/evm/arcus/index.js +7 -3
  34. package/dist/protocols/evm/arcus/index.js.map +1 -1
  35. package/dist/protocols/evm/circle-cctp/index.cjs +23 -3
  36. package/dist/protocols/evm/circle-cctp/index.cjs.map +1 -1
  37. package/dist/protocols/evm/circle-cctp/index.js +24 -4
  38. package/dist/protocols/evm/circle-cctp/index.js.map +1 -1
  39. package/dist/protocols/evm/compound-v3/index.cjs +9 -3
  40. package/dist/protocols/evm/compound-v3/index.cjs.map +1 -1
  41. package/dist/protocols/evm/compound-v3/index.js +10 -4
  42. package/dist/protocols/evm/compound-v3/index.js.map +1 -1
  43. package/dist/protocols/evm/continuum-dao/index.cjs +11 -5
  44. package/dist/protocols/evm/continuum-dao/index.cjs.map +1 -1
  45. package/dist/protocols/evm/continuum-dao/index.js +12 -6
  46. package/dist/protocols/evm/continuum-dao/index.js.map +1 -1
  47. package/dist/protocols/evm/curve-dao/index.cjs +8 -4
  48. package/dist/protocols/evm/curve-dao/index.cjs.map +1 -1
  49. package/dist/protocols/evm/curve-dao/index.js +9 -5
  50. package/dist/protocols/evm/curve-dao/index.js.map +1 -1
  51. package/dist/protocols/evm/ethena/index.cjs +13 -9
  52. package/dist/protocols/evm/ethena/index.cjs.map +1 -1
  53. package/dist/protocols/evm/ethena/index.js +14 -10
  54. package/dist/protocols/evm/ethena/index.js.map +1 -1
  55. package/dist/protocols/evm/euler-v2/index.cjs +21 -16
  56. package/dist/protocols/evm/euler-v2/index.cjs.map +1 -1
  57. package/dist/protocols/evm/euler-v2/index.js +22 -17
  58. package/dist/protocols/evm/euler-v2/index.js.map +1 -1
  59. package/dist/protocols/evm/gmx/index.cjs +12 -8
  60. package/dist/protocols/evm/gmx/index.cjs.map +1 -1
  61. package/dist/protocols/evm/gmx/index.js +13 -9
  62. package/dist/protocols/evm/gmx/index.js.map +1 -1
  63. package/dist/protocols/evm/hyperliquid/index.cjs +5 -1
  64. package/dist/protocols/evm/hyperliquid/index.cjs.map +1 -1
  65. package/dist/protocols/evm/hyperliquid/index.js +6 -2
  66. package/dist/protocols/evm/hyperliquid/index.js.map +1 -1
  67. package/dist/protocols/evm/lido/index.cjs +7 -3
  68. package/dist/protocols/evm/lido/index.cjs.map +1 -1
  69. package/dist/protocols/evm/lido/index.js +8 -4
  70. package/dist/protocols/evm/lido/index.js.map +1 -1
  71. package/dist/protocols/evm/maple/index.cjs +7 -3
  72. package/dist/protocols/evm/maple/index.cjs.map +1 -1
  73. package/dist/protocols/evm/maple/index.js +8 -4
  74. package/dist/protocols/evm/maple/index.js.map +1 -1
  75. package/dist/protocols/evm/morpho/index.cjs +34 -11
  76. package/dist/protocols/evm/morpho/index.cjs.map +1 -1
  77. package/dist/protocols/evm/morpho/index.d.ts +12 -1
  78. package/dist/protocols/evm/morpho/index.js +31 -13
  79. package/dist/protocols/evm/morpho/index.js.map +1 -1
  80. package/dist/protocols/evm/pendle/index.cjs +9 -3
  81. package/dist/protocols/evm/pendle/index.cjs.map +1 -1
  82. package/dist/protocols/evm/pendle/index.js +10 -4
  83. package/dist/protocols/evm/pendle/index.js.map +1 -1
  84. package/dist/protocols/evm/permit2/index.cjs.map +1 -1
  85. package/dist/protocols/evm/permit2/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 +19 -9
  91. package/dist/protocols/evm/uniswap-v4/index.cjs.map +1 -1
  92. package/dist/protocols/evm/uniswap-v4/index.js +20 -10
  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, getAddress, defineChain, createPublicClient, http, parseUnits, encodeFunctionData, zeroAddress, maxUint256, isAddress, formatUnits, parseGwei, serializeTransaction, keccak256 } from 'viem';
1
+ import { parseAbi, getAddress, defineChain, createPublicClient, parseUnits, encodeFunctionData, zeroAddress, maxUint256, isAddress, formatUnits, http, parseGwei, serializeTransaction, keccak256 } from 'viem';
2
2
  import { fetchChainFeeParams, gasLimitFromEstimateAndChainConfig, gweiToDecimalString, proposalTxParamsToFeeSnapshot, alignEip1559FeesWithLatestBase, getClientIdFromKeyGenResult } from '@continuumdao/continuum-node-sdk';
3
3
 
4
4
  // src/core/registry.ts
@@ -85,6 +85,10 @@ function eulerSameAssetApproveAmountWithBuffer(args) {
85
85
  const extra = args.totalPullWei * EULER_SAME_ASSET_BORROW_APPROVAL_BUFFER_BPS / 10000n;
86
86
  return args.totalPullWei + extra + 1n;
87
87
  }
88
+ function defiEvmTransport(rpcUrl, opts) {
89
+ const url = rpcUrl.trim();
90
+ return http(url, opts);
91
+ }
88
92
 
89
93
  // src/core/purpose.ts
90
94
  function mergePurposeText(purposeText, purposeSuffix) {
@@ -176,7 +180,7 @@ async function buildEvmMultisignBatch(args) {
176
180
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
177
181
  rpcUrls: { default: { http: [rpcUrl] } }
178
182
  });
179
- const publicClient2 = createPublicClient({ chain: ch, transport: http(rpcUrl) });
183
+ const publicClient2 = createPublicClient({ chain: ch, transport: defiEvmTransport(rpcUrl) });
180
184
  const feeParams = await fetchChainFeeParams(rpcUrl, chainId);
181
185
  const legacy = Boolean(chainDetail?.legacy) || !feeParams.isEip1559;
182
186
  const latestBaseFeeWei = !legacy ? (await publicClient2.getBlock({ blockTag: "latest" })).baseFeePerGas ?? 0n : 0n;
@@ -335,7 +339,7 @@ async function fetchEulerVaultUnderlyingMeta(args) {
335
339
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
336
340
  rpcUrls: { default: { http: [args.rpcUrl] } }
337
341
  });
338
- const publicClient2 = createPublicClient({ chain: ch, transport: http(args.rpcUrl) });
342
+ const publicClient2 = createPublicClient({ chain: ch, transport: defiEvmTransport(args.rpcUrl) });
339
343
  const assetAddrRaw = await publicClient2.readContract({
340
344
  address: args.evault,
341
345
  abi: erc4626AssetAbi,
@@ -374,7 +378,7 @@ async function fetchEulerVaultMaxWithdrawWei(args) {
374
378
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
375
379
  rpcUrls: { default: { http: [args.rpcUrl] } }
376
380
  });
377
- const publicClient2 = createPublicClient({ chain: ch, transport: http(args.rpcUrl) });
381
+ const publicClient2 = createPublicClient({ chain: ch, transport: defiEvmTransport(args.rpcUrl) });
378
382
  return publicClient2.readContract({
379
383
  address: args.evault,
380
384
  abi: erc4626MaxWithdrawAbi,
@@ -412,7 +416,7 @@ async function eulerLendEarnEffectiveMaxWeiBySimulation(args) {
412
416
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
413
417
  rpcUrls: { default: { http: [args.rpcUrl] } }
414
418
  });
415
- const publicClient2 = createPublicClient({ chain: ch, transport: http(args.rpcUrl) });
419
+ const publicClient2 = createPublicClient({ chain: ch, transport: defiEvmTransport(args.rpcUrl) });
416
420
  let shareBal;
417
421
  let vaultCash;
418
422
  try {
@@ -616,7 +620,7 @@ async function collateralMaxWithdrawBySimulation(args) {
616
620
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
617
621
  rpcUrls: { default: { http: [args.rpcUrl] } }
618
622
  });
619
- const publicClient2 = createPublicClient({ chain: ch, transport: http(args.rpcUrl) });
623
+ const publicClient2 = createPublicClient({ chain: ch, transport: defiEvmTransport(args.rpcUrl) });
620
624
  let shareBal;
621
625
  let assetsOwned;
622
626
  let vaultCash;
@@ -724,7 +728,7 @@ async function buildEvmMultisignBodyEulerV2IsolatedLendDepositBatch(args) {
724
728
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
725
729
  rpcUrls: { default: { http: [args.rpcUrl] } }
726
730
  });
727
- const publicClient2 = createPublicClient({ chain: ch, transport: http(args.rpcUrl) });
731
+ const publicClient2 = createPublicClient({ chain: ch, transport: defiEvmTransport(args.rpcUrl) });
728
732
  typeof args._registryUnderlyingDecimals === "number" ? args._registryUnderlyingDecimals : void 0;
729
733
  const onChainDec = await publicClient2.readContract({
730
734
  address: asset,
@@ -921,7 +925,7 @@ async function buildEvmMultisignBodyEulerV2IsolatedBorrowBatch(args) {
921
925
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
922
926
  rpcUrls: { default: { http: [args.rpcUrl] } }
923
927
  });
924
- const publicClient2 = createPublicClient({ chain: ch, transport: http(args.rpcUrl) });
928
+ const publicClient2 = createPublicClient({ chain: ch, transport: defiEvmTransport(args.rpcUrl) });
925
929
  const cDecRaw = await publicClient2.readContract({
926
930
  address: collateralAsset,
927
931
  abi: erc20AllowanceAbi2,
@@ -1173,7 +1177,7 @@ async function buildEvmMultisignBodyEulerV2BorrowRepayBatch(args) {
1173
1177
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
1174
1178
  rpcUrls: { default: { http: [args.rpcUrl] } }
1175
1179
  });
1176
- const publicClient2 = createPublicClient({ chain: ch, transport: http(args.rpcUrl) });
1180
+ const publicClient2 = createPublicClient({ chain: ch, transport: defiEvmTransport(args.rpcUrl) });
1177
1181
  const bDecRaw = await publicClient2.readContract({
1178
1182
  address: borrowAsset,
1179
1183
  abi: erc20AllowanceAbi3,
@@ -1327,7 +1331,7 @@ async function buildEvmMultisignBodyEulerV2BorrowCollateralDepositBatch(args) {
1327
1331
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
1328
1332
  rpcUrls: { default: { http: [args.rpcUrl] } }
1329
1333
  });
1330
- const publicClient2 = createPublicClient({ chain: ch, transport: http(args.rpcUrl) });
1334
+ const publicClient2 = createPublicClient({ chain: ch, transport: defiEvmTransport(args.rpcUrl) });
1331
1335
  const dec = await fetchEulerVaultAssetDecimals({
1332
1336
  rpcUrl: args.rpcUrl,
1333
1337
  chainId: args.chainId,
@@ -2009,7 +2013,7 @@ async function fetchEulerVaultOnChainLendMetrics(args) {
2009
2013
  nativeCurrency: { decimals: 18, name: "x", symbol: "x" },
2010
2014
  rpcUrls: { default: { http: [args.rpcUrl] } }
2011
2015
  });
2012
- const client = createPublicClient({ chain: ch, transport: http(args.rpcUrl) });
2016
+ const client = createPublicClient({ chain: ch, transport: defiEvmTransport(args.rpcUrl) });
2013
2017
  const addr = getAddress(args.evault);
2014
2018
  const [[supplyRaw, borrowRaw], cashWei, totalBorrowsWei, totalAssetsWei] = await Promise.all([
2015
2019
  client.readContract({
@@ -2121,7 +2125,7 @@ function eulerMetaPublicClient(chainId, rpcUrl) {
2121
2125
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
2122
2126
  rpcUrls: { default: { http: [rpcUrl] } }
2123
2127
  });
2124
- return createPublicClient({ chain, transport: http(rpcUrl) });
2128
+ return createPublicClient({ chain, transport: defiEvmTransport(rpcUrl) });
2125
2129
  }
2126
2130
  async function readErc20StringMeta(client, addrLower) {
2127
2131
  try {
@@ -2873,7 +2877,7 @@ function metaClient(chainId, rpcUrl) {
2873
2877
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
2874
2878
  rpcUrls: { default: { http: [rpcUrl] } }
2875
2879
  });
2876
- return createPublicClient({ chain, transport: http(rpcUrl) });
2880
+ return createPublicClient({ chain, transport: defiEvmTransport(rpcUrl) });
2877
2881
  }
2878
2882
  async function fetchEulerV2BorrowPairLtvs(args) {
2879
2883
  const rpc = (args.rpcUrl ?? "").trim();
@@ -2978,7 +2982,7 @@ function metaClient2(chainId, rpcUrl) {
2978
2982
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
2979
2983
  rpcUrls: { default: { http: [rpcUrl] } }
2980
2984
  });
2981
- return createPublicClient({ chain, transport: http(rpcUrl) });
2985
+ return createPublicClient({ chain, transport: defiEvmTransport(rpcUrl) });
2982
2986
  }
2983
2987
  function parseEulerTrackingBorrowEntry(entry) {
2984
2988
  const s = (entry ?? "").trim().toLowerCase();
@@ -3314,7 +3318,7 @@ function metaClient3(chainId, rpcUrl) {
3314
3318
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
3315
3319
  rpcUrls: { default: { http: [rpcUrl] } }
3316
3320
  });
3317
- return createPublicClient({ chain, transport: http(rpcUrl) });
3321
+ return createPublicClient({ chain, transport: defiEvmTransport(rpcUrl) });
3318
3322
  }
3319
3323
  async function readSupplyUnderlyingWei(client, vault, shareOwner) {
3320
3324
  try {
@@ -3467,7 +3471,7 @@ async function fetchEulerReulVestingTranches(args) {
3467
3471
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
3468
3472
  rpcUrls: { default: { http: [rpc] } }
3469
3473
  });
3470
- const client = createPublicClient({ chain: ch, transport: http(rpc) });
3474
+ const client = createPublicClient({ chain: ch, transport: defiEvmTransport(rpc) });
3471
3475
  const [timestamps, amounts] = await client.readContract({
3472
3476
  address: reul,
3473
3477
  abi: rewardTokenReadAbi,
@@ -3541,6 +3545,7 @@ var COINGECKO_PLATFORM_BY_CHAIN_ID = {
3541
3545
  "42220": "celo",
3542
3546
  "43114": "avalanche",
3543
3547
  "4663": "robinhood",
3548
+ "5042": "arc",
3544
3549
  "48900": "zircuit",
3545
3550
  "5000": "mantle",
3546
3551
  "534352": "scroll",
@@ -3578,7 +3583,7 @@ function publicClient(chainId, rpcUrl) {
3578
3583
  nativeCurrency: { decimals: 18, name: "x", symbol: "x" },
3579
3584
  rpcUrls: { default: { http: [rpcUrl] } }
3580
3585
  });
3581
- return createPublicClient({ chain: ch, transport: http(rpcUrl) });
3586
+ return createPublicClient({ chain: ch, transport: defiEvmTransport(rpcUrl) });
3582
3587
  }
3583
3588
  async function gqlTrackingAccount(chainId, mainLower) {
3584
3589
  if (!eulerV2GoldskyUrlForChain(chainId)) {