@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
@@ -87,6 +87,10 @@ function eulerSameAssetApproveAmountWithBuffer(args) {
87
87
  const extra = args.totalPullWei * EULER_SAME_ASSET_BORROW_APPROVAL_BUFFER_BPS / 10000n;
88
88
  return args.totalPullWei + extra + 1n;
89
89
  }
90
+ function defiEvmTransport(rpcUrl, opts) {
91
+ const url = rpcUrl.trim();
92
+ return viem.http(url, opts);
93
+ }
90
94
 
91
95
  // src/core/purpose.ts
92
96
  function mergePurposeText(purposeText, purposeSuffix) {
@@ -178,7 +182,7 @@ async function buildEvmMultisignBatch(args) {
178
182
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
179
183
  rpcUrls: { default: { http: [rpcUrl] } }
180
184
  });
181
- const publicClient2 = viem.createPublicClient({ chain: ch, transport: viem.http(rpcUrl) });
185
+ const publicClient2 = viem.createPublicClient({ chain: ch, transport: defiEvmTransport(rpcUrl) });
182
186
  const feeParams = await continuumNodeSdk.fetchChainFeeParams(rpcUrl, chainId);
183
187
  const legacy = Boolean(chainDetail?.legacy) || !feeParams.isEip1559;
184
188
  const latestBaseFeeWei = !legacy ? (await publicClient2.getBlock({ blockTag: "latest" })).baseFeePerGas ?? 0n : 0n;
@@ -337,7 +341,7 @@ async function fetchEulerVaultUnderlyingMeta(args) {
337
341
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
338
342
  rpcUrls: { default: { http: [args.rpcUrl] } }
339
343
  });
340
- const publicClient2 = viem.createPublicClient({ chain: ch, transport: viem.http(args.rpcUrl) });
344
+ const publicClient2 = viem.createPublicClient({ chain: ch, transport: defiEvmTransport(args.rpcUrl) });
341
345
  const assetAddrRaw = await publicClient2.readContract({
342
346
  address: args.evault,
343
347
  abi: erc4626AssetAbi,
@@ -376,7 +380,7 @@ async function fetchEulerVaultMaxWithdrawWei(args) {
376
380
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
377
381
  rpcUrls: { default: { http: [args.rpcUrl] } }
378
382
  });
379
- const publicClient2 = viem.createPublicClient({ chain: ch, transport: viem.http(args.rpcUrl) });
383
+ const publicClient2 = viem.createPublicClient({ chain: ch, transport: defiEvmTransport(args.rpcUrl) });
380
384
  return publicClient2.readContract({
381
385
  address: args.evault,
382
386
  abi: erc4626MaxWithdrawAbi,
@@ -414,7 +418,7 @@ async function eulerLendEarnEffectiveMaxWeiBySimulation(args) {
414
418
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
415
419
  rpcUrls: { default: { http: [args.rpcUrl] } }
416
420
  });
417
- const publicClient2 = viem.createPublicClient({ chain: ch, transport: viem.http(args.rpcUrl) });
421
+ const publicClient2 = viem.createPublicClient({ chain: ch, transport: defiEvmTransport(args.rpcUrl) });
418
422
  let shareBal;
419
423
  let vaultCash;
420
424
  try {
@@ -618,7 +622,7 @@ async function collateralMaxWithdrawBySimulation(args) {
618
622
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
619
623
  rpcUrls: { default: { http: [args.rpcUrl] } }
620
624
  });
621
- const publicClient2 = viem.createPublicClient({ chain: ch, transport: viem.http(args.rpcUrl) });
625
+ const publicClient2 = viem.createPublicClient({ chain: ch, transport: defiEvmTransport(args.rpcUrl) });
622
626
  let shareBal;
623
627
  let assetsOwned;
624
628
  let vaultCash;
@@ -726,7 +730,7 @@ async function buildEvmMultisignBodyEulerV2IsolatedLendDepositBatch(args) {
726
730
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
727
731
  rpcUrls: { default: { http: [args.rpcUrl] } }
728
732
  });
729
- const publicClient2 = viem.createPublicClient({ chain: ch, transport: viem.http(args.rpcUrl) });
733
+ const publicClient2 = viem.createPublicClient({ chain: ch, transport: defiEvmTransport(args.rpcUrl) });
730
734
  typeof args._registryUnderlyingDecimals === "number" ? args._registryUnderlyingDecimals : void 0;
731
735
  const onChainDec = await publicClient2.readContract({
732
736
  address: asset,
@@ -923,7 +927,7 @@ async function buildEvmMultisignBodyEulerV2IsolatedBorrowBatch(args) {
923
927
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
924
928
  rpcUrls: { default: { http: [args.rpcUrl] } }
925
929
  });
926
- const publicClient2 = viem.createPublicClient({ chain: ch, transport: viem.http(args.rpcUrl) });
930
+ const publicClient2 = viem.createPublicClient({ chain: ch, transport: defiEvmTransport(args.rpcUrl) });
927
931
  const cDecRaw = await publicClient2.readContract({
928
932
  address: collateralAsset,
929
933
  abi: erc20AllowanceAbi2,
@@ -1175,7 +1179,7 @@ async function buildEvmMultisignBodyEulerV2BorrowRepayBatch(args) {
1175
1179
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
1176
1180
  rpcUrls: { default: { http: [args.rpcUrl] } }
1177
1181
  });
1178
- const publicClient2 = viem.createPublicClient({ chain: ch, transport: viem.http(args.rpcUrl) });
1182
+ const publicClient2 = viem.createPublicClient({ chain: ch, transport: defiEvmTransport(args.rpcUrl) });
1179
1183
  const bDecRaw = await publicClient2.readContract({
1180
1184
  address: borrowAsset,
1181
1185
  abi: erc20AllowanceAbi3,
@@ -1329,7 +1333,7 @@ async function buildEvmMultisignBodyEulerV2BorrowCollateralDepositBatch(args) {
1329
1333
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
1330
1334
  rpcUrls: { default: { http: [args.rpcUrl] } }
1331
1335
  });
1332
- const publicClient2 = viem.createPublicClient({ chain: ch, transport: viem.http(args.rpcUrl) });
1336
+ const publicClient2 = viem.createPublicClient({ chain: ch, transport: defiEvmTransport(args.rpcUrl) });
1333
1337
  const dec = await fetchEulerVaultAssetDecimals({
1334
1338
  rpcUrl: args.rpcUrl,
1335
1339
  chainId: args.chainId,
@@ -2011,7 +2015,7 @@ async function fetchEulerVaultOnChainLendMetrics(args) {
2011
2015
  nativeCurrency: { decimals: 18, name: "x", symbol: "x" },
2012
2016
  rpcUrls: { default: { http: [args.rpcUrl] } }
2013
2017
  });
2014
- const client = viem.createPublicClient({ chain: ch, transport: viem.http(args.rpcUrl) });
2018
+ const client = viem.createPublicClient({ chain: ch, transport: defiEvmTransport(args.rpcUrl) });
2015
2019
  const addr = viem.getAddress(args.evault);
2016
2020
  const [[supplyRaw, borrowRaw], cashWei, totalBorrowsWei, totalAssetsWei] = await Promise.all([
2017
2021
  client.readContract({
@@ -2123,7 +2127,7 @@ function eulerMetaPublicClient(chainId, rpcUrl) {
2123
2127
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
2124
2128
  rpcUrls: { default: { http: [rpcUrl] } }
2125
2129
  });
2126
- return viem.createPublicClient({ chain, transport: viem.http(rpcUrl) });
2130
+ return viem.createPublicClient({ chain, transport: defiEvmTransport(rpcUrl) });
2127
2131
  }
2128
2132
  async function readErc20StringMeta(client, addrLower) {
2129
2133
  try {
@@ -2875,7 +2879,7 @@ function metaClient(chainId, rpcUrl) {
2875
2879
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
2876
2880
  rpcUrls: { default: { http: [rpcUrl] } }
2877
2881
  });
2878
- return viem.createPublicClient({ chain, transport: viem.http(rpcUrl) });
2882
+ return viem.createPublicClient({ chain, transport: defiEvmTransport(rpcUrl) });
2879
2883
  }
2880
2884
  async function fetchEulerV2BorrowPairLtvs(args) {
2881
2885
  const rpc = (args.rpcUrl ?? "").trim();
@@ -2980,7 +2984,7 @@ function metaClient2(chainId, rpcUrl) {
2980
2984
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
2981
2985
  rpcUrls: { default: { http: [rpcUrl] } }
2982
2986
  });
2983
- return viem.createPublicClient({ chain, transport: viem.http(rpcUrl) });
2987
+ return viem.createPublicClient({ chain, transport: defiEvmTransport(rpcUrl) });
2984
2988
  }
2985
2989
  function parseEulerTrackingBorrowEntry(entry) {
2986
2990
  const s = (entry ?? "").trim().toLowerCase();
@@ -3316,7 +3320,7 @@ function metaClient3(chainId, rpcUrl) {
3316
3320
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
3317
3321
  rpcUrls: { default: { http: [rpcUrl] } }
3318
3322
  });
3319
- return viem.createPublicClient({ chain, transport: viem.http(rpcUrl) });
3323
+ return viem.createPublicClient({ chain, transport: defiEvmTransport(rpcUrl) });
3320
3324
  }
3321
3325
  async function readSupplyUnderlyingWei(client, vault, shareOwner) {
3322
3326
  try {
@@ -3469,7 +3473,7 @@ async function fetchEulerReulVestingTranches(args) {
3469
3473
  nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
3470
3474
  rpcUrls: { default: { http: [rpc] } }
3471
3475
  });
3472
- const client = viem.createPublicClient({ chain: ch, transport: viem.http(rpc) });
3476
+ const client = viem.createPublicClient({ chain: ch, transport: defiEvmTransport(rpc) });
3473
3477
  const [timestamps, amounts] = await client.readContract({
3474
3478
  address: reul,
3475
3479
  abi: rewardTokenReadAbi,
@@ -3543,6 +3547,7 @@ var COINGECKO_PLATFORM_BY_CHAIN_ID = {
3543
3547
  "42220": "celo",
3544
3548
  "43114": "avalanche",
3545
3549
  "4663": "robinhood",
3550
+ "5042": "arc",
3546
3551
  "48900": "zircuit",
3547
3552
  "5000": "mantle",
3548
3553
  "534352": "scroll",
@@ -3580,7 +3585,7 @@ function publicClient(chainId, rpcUrl) {
3580
3585
  nativeCurrency: { decimals: 18, name: "x", symbol: "x" },
3581
3586
  rpcUrls: { default: { http: [rpcUrl] } }
3582
3587
  });
3583
- return viem.createPublicClient({ chain: ch, transport: viem.http(rpcUrl) });
3588
+ return viem.createPublicClient({ chain: ch, transport: defiEvmTransport(rpcUrl) });
3584
3589
  }
3585
3590
  async function gqlTrackingAccount(chainId, mainLower) {
3586
3591
  if (!eulerV2GoldskyUrlForChain(chainId)) {