@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.
- package/dist/agent/catalog.cjs +50 -6
- package/dist/agent/catalog.cjs.map +1 -1
- package/dist/agent/catalog.js +50 -6
- package/dist/agent/catalog.js.map +1 -1
- package/dist/agent/skills/aave-v4/SKILL.md +1 -1
- package/dist/agent/skills/circle-cctp/SKILL.md +1 -0
- package/dist/agent/skills/morpho/SKILL.md +11 -0
- package/dist/agent/skills/uniswap-v4/SKILL.md +1 -1
- package/dist/chains/evm/index.cjs +7 -2
- package/dist/chains/evm/index.cjs.map +1 -1
- package/dist/chains/evm/index.js +8 -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 +52 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +51 -10
- 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 +14 -2
- package/dist/protocols/evm/aerodrome/index.cjs.map +1 -1
- package/dist/protocols/evm/aerodrome/index.js +14 -2
- 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 +23 -3
- package/dist/protocols/evm/circle-cctp/index.cjs.map +1 -1
- package/dist/protocols/evm/circle-cctp/index.js +24 -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 +21 -16
- package/dist/protocols/evm/euler-v2/index.cjs.map +1 -1
- package/dist/protocols/evm/euler-v2/index.js +22 -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 +34 -11
- package/dist/protocols/evm/morpho/index.cjs.map +1 -1
- package/dist/protocols/evm/morpho/index.d.ts +12 -1
- package/dist/protocols/evm/morpho/index.js +31 -13
- 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/permit2/index.cjs.map +1 -1
- package/dist/protocols/evm/permit2/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 +19 -9
- package/dist/protocols/evm/uniswap-v4/index.cjs.map +1 -1
- package/dist/protocols/evm/uniswap-v4/index.js +20 -10
- 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 { parseAbi, parseAbiParameters, parseAbiItem, getAddress, createPublicClient,
|
|
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
|
|
@@ -68,7 +68,9 @@ var UNIVERSAL_ROUTER_SPENDER = {
|
|
|
68
68
|
4217: "0x1febb76be10aaf3a1402f04e8e835f2c382f7914",
|
|
69
69
|
196: "0x5507749f2c558bb3e162c6e90c314c092e7372ff",
|
|
70
70
|
/** Robinhood Chain mainnet — Universal Router v2.1.1 (Trade API / interface) */
|
|
71
|
-
4663: "0x8876789976decbfcbbbe364623c63652db8c0904"
|
|
71
|
+
4663: "0x8876789976decbfcbbbe364623c63652db8c0904",
|
|
72
|
+
/** Circle Arc mainnet — official Uniswap v4 deployments */
|
|
73
|
+
5042: "0x4fcA4a51Ab4F23A7447b3284fBd7D73289A89Fb1"
|
|
72
74
|
};
|
|
73
75
|
var UNIVERSAL_ROUTER_V2_2_SPENDER = {
|
|
74
76
|
1: "0xCb640A86855f1A828c27241bA364348de28abe66",
|
|
@@ -136,7 +138,9 @@ var POSITION_MANAGER_BY_CHAIN = {
|
|
|
136
138
|
1868: "0x0e2850543f69f678257266e0907ff9a58b3f13de",
|
|
137
139
|
59144: "0x661e93cca42afacb172121ef892830ca3b70f08d",
|
|
138
140
|
/** Robinhood Chain mainnet */
|
|
139
|
-
4663: "0x58daec3116aae6D93017bAAea7749052E8a04fA7"
|
|
141
|
+
4663: "0x58daec3116aae6D93017bAAea7749052E8a04fA7",
|
|
142
|
+
/** Circle Arc mainnet */
|
|
143
|
+
5042: "0x6049c9a0e26405C0985f9E3685C87d0aE917f82B"
|
|
140
144
|
};
|
|
141
145
|
var PERMISSIONED_POSITION_MANAGER_BY_CHAIN = {
|
|
142
146
|
1: "0x89628C9B4CE81951a9BC1F36F0688Fad6A6ee248",
|
|
@@ -256,6 +260,12 @@ var UNISWAP_V4_LP_WETH_DEPOSIT_FALLBACK = 120000n;
|
|
|
256
260
|
var UNISWAP_V4_LP_PERMIT2_APPROVE_FALLBACK = 100000n;
|
|
257
261
|
var UNISWAP_V4_PERMISSION_FLAG_SWAP = 1;
|
|
258
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
|
|
259
269
|
var permissionsAdapterAbi = parseAbi([
|
|
260
270
|
"function isAllowed(address account, uint8 permission) view returns (bool)",
|
|
261
271
|
"function PERMISSIONED_TOKEN() view returns (address)"
|
|
@@ -409,7 +419,7 @@ async function readUniswapV4OnChainPermissionFlags(args) {
|
|
|
409
419
|
nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18 },
|
|
410
420
|
rpcUrls: { default: { http: [args.rpcUrl] } }
|
|
411
421
|
}),
|
|
412
|
-
transport:
|
|
422
|
+
transport: defiEvmTransport(args.rpcUrl)
|
|
413
423
|
});
|
|
414
424
|
const wallet = getAddress(args.walletAddress);
|
|
415
425
|
const out = [];
|
|
@@ -1044,7 +1054,7 @@ async function buildEvmMultisignBatch(args) {
|
|
|
1044
1054
|
nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
|
|
1045
1055
|
rpcUrls: { default: { http: [rpcUrl] } }
|
|
1046
1056
|
});
|
|
1047
|
-
const publicClient = createPublicClient({ chain: ch, transport:
|
|
1057
|
+
const publicClient = createPublicClient({ chain: ch, transport: defiEvmTransport(rpcUrl) });
|
|
1048
1058
|
const feeParams = await fetchChainFeeParams(rpcUrl, chainId);
|
|
1049
1059
|
const legacy = Boolean(chainDetail?.legacy) || !feeParams.isEip1559;
|
|
1050
1060
|
const latestBaseFeeWei = !legacy ? (await publicClient.getBlock({ blockTag: "latest" })).baseFeePerGas ?? 0n : 0n;
|
|
@@ -1679,7 +1689,7 @@ async function buildEvmMultisignBodyUniswapV4SkipPermit2Batch(args) {
|
|
|
1679
1689
|
nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
|
|
1680
1690
|
rpcUrls: { default: { http: [args.rpcUrl] } }
|
|
1681
1691
|
}),
|
|
1682
|
-
transport:
|
|
1692
|
+
transport: defiEvmTransport(args.rpcUrl)
|
|
1683
1693
|
});
|
|
1684
1694
|
const erc20ApproveSteps = await buildConditionalErc20ApproveSteps({
|
|
1685
1695
|
publicClient,
|
|
@@ -2534,7 +2544,7 @@ async function resolveUniswapV4PositionScanFromDate(args) {
|
|
|
2534
2544
|
nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18 },
|
|
2535
2545
|
rpcUrls: { default: { http: [args.rpcUrl] } }
|
|
2536
2546
|
});
|
|
2537
|
-
const client = createPublicClient({ chain, transport:
|
|
2547
|
+
const client = createPublicClient({ chain, transport: defiEvmTransport(args.rpcUrl) });
|
|
2538
2548
|
const latest = await client.getBlockNumber();
|
|
2539
2549
|
const deploy = getUniswapV4PositionManagerDeployBlock(args.chainId) ?? 0n;
|
|
2540
2550
|
const resolved = await resolveBlockAtOrAfterUnixTime(client, unixTime, {
|
|
@@ -2561,7 +2571,7 @@ async function listUniswapV4PositionsForWallet(args) {
|
|
|
2561
2571
|
nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18 },
|
|
2562
2572
|
rpcUrls: { default: { http: [args.rpcUrl] } }
|
|
2563
2573
|
});
|
|
2564
|
-
const client = createPublicClient({ chain, transport:
|
|
2574
|
+
const client = createPublicClient({ chain, transport: defiEvmTransport(args.rpcUrl) });
|
|
2565
2575
|
const latest = await client.getBlockNumber();
|
|
2566
2576
|
const maxScan = args.maxBlocksToScan ?? 500000n;
|
|
2567
2577
|
const chunkSize = args.chunkSize ?? UNISWAP_V4_LP_LOG_CHUNK_SIZE_DEFAULT;
|
|
@@ -2649,7 +2659,7 @@ async function readUniswapV4PositionInfoRaw(args) {
|
|
|
2649
2659
|
nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18 },
|
|
2650
2660
|
rpcUrls: { default: { http: [args.rpcUrl] } }
|
|
2651
2661
|
});
|
|
2652
|
-
const client = createPublicClient({ chain, transport:
|
|
2662
|
+
const client = createPublicClient({ chain, transport: defiEvmTransport(args.rpcUrl) });
|
|
2653
2663
|
const info = await client.readContract({
|
|
2654
2664
|
address: pm,
|
|
2655
2665
|
abi: positionInfoAbi,
|
|
@@ -2839,7 +2849,7 @@ async function buildEvmMultisignBodyUniswapV4LiquidityBatchInternal(args) {
|
|
|
2839
2849
|
nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18 },
|
|
2840
2850
|
rpcUrls: { default: { http: [args.rpcUrl] } }
|
|
2841
2851
|
});
|
|
2842
|
-
const publicClient = createPublicClient({ chain, transport:
|
|
2852
|
+
const publicClient = createPublicClient({ chain, transport: defiEvmTransport(args.rpcUrl) });
|
|
2843
2853
|
const needsTokenApproves = args.action === "mint" || args.action === "increase";
|
|
2844
2854
|
const approveTargets = needsTokenApproves ? await resolveApproveTargets({
|
|
2845
2855
|
publicClient,
|