@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
|
@@ -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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
3588
|
+
return viem.createPublicClient({ chain: ch, transport: defiEvmTransport(rpcUrl) });
|
|
3584
3589
|
}
|
|
3585
3590
|
async function gqlTrackingAccount(chainId, mainLower) {
|
|
3586
3591
|
if (!eulerV2GoldskyUrlForChain(chainId)) {
|