@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.
- package/dist/agent/catalog.cjs +219 -27
- package/dist/agent/catalog.cjs.map +1 -1
- package/dist/agent/catalog.d.ts +914 -197
- package/dist/agent/catalog.js +214 -28
- package/dist/agent/catalog.js.map +1 -1
- package/dist/agent/skills/aerodrome/SKILL.md +1 -1
- package/dist/agent/skills/arcus/SKILL.md +1 -1
- package/dist/agent/skills/morpho/SKILL.md +32 -5
- package/dist/agent/skills/yield-compare/SKILL.md +6 -2
- package/dist/chains/evm/index.cjs +6 -2
- package/dist/chains/evm/index.cjs.map +1 -1
- package/dist/chains/evm/index.js +7 -3
- package/dist/chains/evm/index.js.map +1 -1
- package/dist/core/index.cjs +14 -0
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.ts +7 -2
- package/dist/core/index.js +13 -2
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +45 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +44 -8
- package/dist/index.js.map +1 -1
- package/dist/protocols/evm/aave-v4/index.cjs +11 -7
- package/dist/protocols/evm/aave-v4/index.cjs.map +1 -1
- package/dist/protocols/evm/aave-v4/index.js +12 -8
- package/dist/protocols/evm/aave-v4/index.js.map +1 -1
- package/dist/protocols/evm/aerodrome/index.cjs +81 -50
- package/dist/protocols/evm/aerodrome/index.cjs.map +1 -1
- package/dist/protocols/evm/aerodrome/index.d.ts +8 -8
- package/dist/protocols/evm/aerodrome/index.js +96 -65
- package/dist/protocols/evm/aerodrome/index.js.map +1 -1
- package/dist/protocols/evm/arcus/index.cjs +6 -2
- package/dist/protocols/evm/arcus/index.cjs.map +1 -1
- package/dist/protocols/evm/arcus/index.js +7 -3
- package/dist/protocols/evm/arcus/index.js.map +1 -1
- package/dist/protocols/evm/circle-cctp/index.cjs +7 -3
- package/dist/protocols/evm/circle-cctp/index.cjs.map +1 -1
- package/dist/protocols/evm/circle-cctp/index.js +8 -4
- package/dist/protocols/evm/circle-cctp/index.js.map +1 -1
- package/dist/protocols/evm/compound-v3/index.cjs +9 -3
- package/dist/protocols/evm/compound-v3/index.cjs.map +1 -1
- package/dist/protocols/evm/compound-v3/index.js +10 -4
- package/dist/protocols/evm/compound-v3/index.js.map +1 -1
- package/dist/protocols/evm/continuum-dao/index.cjs +11 -5
- package/dist/protocols/evm/continuum-dao/index.cjs.map +1 -1
- package/dist/protocols/evm/continuum-dao/index.js +12 -6
- package/dist/protocols/evm/continuum-dao/index.js.map +1 -1
- package/dist/protocols/evm/curve-dao/index.cjs +8 -4
- package/dist/protocols/evm/curve-dao/index.cjs.map +1 -1
- package/dist/protocols/evm/curve-dao/index.js +9 -5
- package/dist/protocols/evm/curve-dao/index.js.map +1 -1
- package/dist/protocols/evm/ethena/index.cjs +13 -9
- package/dist/protocols/evm/ethena/index.cjs.map +1 -1
- package/dist/protocols/evm/ethena/index.js +14 -10
- package/dist/protocols/evm/ethena/index.js.map +1 -1
- package/dist/protocols/evm/euler-v2/index.cjs +20 -16
- package/dist/protocols/evm/euler-v2/index.cjs.map +1 -1
- package/dist/protocols/evm/euler-v2/index.js +21 -17
- package/dist/protocols/evm/euler-v2/index.js.map +1 -1
- package/dist/protocols/evm/gmx/index.cjs +12 -8
- package/dist/protocols/evm/gmx/index.cjs.map +1 -1
- package/dist/protocols/evm/gmx/index.js +13 -9
- package/dist/protocols/evm/gmx/index.js.map +1 -1
- package/dist/protocols/evm/hyperliquid/index.cjs +5 -1
- package/dist/protocols/evm/hyperliquid/index.cjs.map +1 -1
- package/dist/protocols/evm/hyperliquid/index.js +6 -2
- package/dist/protocols/evm/hyperliquid/index.js.map +1 -1
- package/dist/protocols/evm/lido/index.cjs +7 -3
- package/dist/protocols/evm/lido/index.cjs.map +1 -1
- package/dist/protocols/evm/lido/index.js +8 -4
- package/dist/protocols/evm/lido/index.js.map +1 -1
- package/dist/protocols/evm/maple/index.cjs +7 -3
- package/dist/protocols/evm/maple/index.cjs.map +1 -1
- package/dist/protocols/evm/maple/index.js +8 -4
- package/dist/protocols/evm/maple/index.js.map +1 -1
- package/dist/protocols/evm/morpho/index.cjs +454 -64
- package/dist/protocols/evm/morpho/index.cjs.map +1 -1
- package/dist/protocols/evm/morpho/index.d.ts +123 -2
- package/dist/protocols/evm/morpho/index.js +432 -66
- package/dist/protocols/evm/morpho/index.js.map +1 -1
- package/dist/protocols/evm/pendle/index.cjs +9 -3
- package/dist/protocols/evm/pendle/index.cjs.map +1 -1
- package/dist/protocols/evm/pendle/index.js +10 -4
- package/dist/protocols/evm/pendle/index.js.map +1 -1
- package/dist/protocols/evm/sky/index.cjs +17 -13
- package/dist/protocols/evm/sky/index.cjs.map +1 -1
- package/dist/protocols/evm/sky/index.js +18 -14
- package/dist/protocols/evm/sky/index.js.map +1 -1
- package/dist/protocols/evm/uniswap-v4/index.cjs +13 -7
- package/dist/protocols/evm/uniswap-v4/index.cjs.map +1 -1
- package/dist/protocols/evm/uniswap-v4/index.js +14 -8
- package/dist/protocols/evm/uniswap-v4/index.js.map +1 -1
- package/dist/protocols/evm/venice/index.cjs +10 -4
- package/dist/protocols/evm/venice/index.cjs.map +1 -1
- package/dist/protocols/evm/venice/index.js +10 -4
- package/dist/protocols/evm/venice/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getAddress, parseAbi, zeroAddress, parseUnits, encodeFunctionData, createPublicClient,
|
|
1
|
+
import { getAddress, parseAbi, zeroAddress, parseUnits, encodeFunctionData, createPublicClient, defineChain, keccak256, encodePacked, padHex, toHex, http, hashTypedData, parseGwei, serializeTransaction, stringToHex } from 'viem';
|
|
2
2
|
import { fetchChainFeeParams, gasLimitFromEstimateAndChainConfig, gweiToDecimalString, proposalTxParamsToFeeSnapshot, alignEip1559FeesWithLatestBase, getClientIdFromKeyGenResult } from '@continuumdao/continuum-node-sdk';
|
|
3
3
|
|
|
4
4
|
// src/core/registry.ts
|
|
@@ -356,6 +356,12 @@ function formatCtmWei(wei) {
|
|
|
356
356
|
const fracStr = frac.toString().padStart(18, "0").replace(/0+$/, "");
|
|
357
357
|
return `${whole.toString()}.${fracStr}`;
|
|
358
358
|
}
|
|
359
|
+
function defiEvmTransport(rpcUrl, opts) {
|
|
360
|
+
const url = rpcUrl.trim();
|
|
361
|
+
return http(url, opts);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
// src/protocols/evm/continuum-dao/escrowPreflight.ts
|
|
359
365
|
var veReadAbi = parseAbi([
|
|
360
366
|
"function minimumLock() view returns (uint256)",
|
|
361
367
|
"function locked(uint256 tokenId) view returns (int128 amount, uint256 end)",
|
|
@@ -388,7 +394,7 @@ function publicClient(rpcUrl, chainId) {
|
|
|
388
394
|
nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
|
|
389
395
|
rpcUrls: { default: { http: [rpcUrl.trim()] } }
|
|
390
396
|
}),
|
|
391
|
-
transport:
|
|
397
|
+
transport: defiEvmTransport(rpcUrl.trim())
|
|
392
398
|
});
|
|
393
399
|
}
|
|
394
400
|
async function readMinimumLockWei(args) {
|
|
@@ -791,7 +797,7 @@ async function buildEvmMultisignBatch(args) {
|
|
|
791
797
|
nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
|
|
792
798
|
rpcUrls: { default: { http: [rpcUrl] } }
|
|
793
799
|
});
|
|
794
|
-
const publicClient3 = createPublicClient({ chain: ch, transport:
|
|
800
|
+
const publicClient3 = createPublicClient({ chain: ch, transport: defiEvmTransport(rpcUrl) });
|
|
795
801
|
const feeParams = await fetchChainFeeParams(rpcUrl, chainId);
|
|
796
802
|
const legacy = Boolean(chainDetail?.legacy) || !feeParams.isEip1559;
|
|
797
803
|
const latestBaseFeeWei = !legacy ? (await publicClient3.getBlock({ blockTag: "latest" })).baseFeePerGas ?? 0n : 0n;
|
|
@@ -1054,7 +1060,7 @@ async function maybeApproveCtmStep(args) {
|
|
|
1054
1060
|
nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
|
|
1055
1061
|
rpcUrls: { default: { http: [args.rpcUrl.trim()] } }
|
|
1056
1062
|
});
|
|
1057
|
-
const client = createPublicClient({ chain: ch, transport:
|
|
1063
|
+
const client = createPublicClient({ chain: ch, transport: defiEvmTransport(args.rpcUrl.trim()) });
|
|
1058
1064
|
let allowance = 0n;
|
|
1059
1065
|
try {
|
|
1060
1066
|
allowance = await client.readContract({
|
|
@@ -1363,7 +1369,7 @@ async function continuumDaoFetchDelegates(args) {
|
|
|
1363
1369
|
nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
|
|
1364
1370
|
rpcUrls: { default: { http: [args.rpcUrl.trim()] } }
|
|
1365
1371
|
}),
|
|
1366
|
-
transport:
|
|
1372
|
+
transport: defiEvmTransport(args.rpcUrl.trim())
|
|
1367
1373
|
});
|
|
1368
1374
|
const delegatee = getAddress(
|
|
1369
1375
|
await client.readContract({ address: ve, abi: veReadAbi2, functionName: "delegates", args: [account] })
|
|
@@ -2445,7 +2451,7 @@ function publicClient2(rpcUrl, chainId) {
|
|
|
2445
2451
|
nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
|
|
2446
2452
|
rpcUrls: { default: { http: [rpcUrl.trim()] } }
|
|
2447
2453
|
}),
|
|
2448
|
-
transport:
|
|
2454
|
+
transport: defiEvmTransport(rpcUrl.trim())
|
|
2449
2455
|
});
|
|
2450
2456
|
}
|
|
2451
2457
|
async function continuumDaoHashProposal(args) {
|