@continuumdao/ctm-mpc-defi 0.2.41 → 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 +12 -1
- package/dist/agent/catalog.cjs.map +1 -1
- package/dist/agent/catalog.js +12 -1
- package/dist/agent/catalog.js.map +1 -1
- 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 +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 +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 +13 -9
- package/dist/protocols/evm/morpho/index.cjs.map +1 -1
- package/dist/protocols/evm/morpho/index.js +14 -10
- 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 { parseAbi, isAddress, getAddress, defineChain, createPublicClient,
|
|
1
|
+
import { parseAbi, isAddress, getAddress, defineChain, createPublicClient, parseUnits, encodeFunctionData, formatUnits, zeroAddress, http, parseGwei, serializeTransaction, keccak256 } from 'viem';
|
|
2
2
|
import { isValidRpcUrl, fetchChainFeeParams, gasLimitFromEstimateAndChainConfig, gweiToDecimalString, proposalTxParamsToFeeSnapshot, alignEip1559FeesWithLatestBase, getClientIdFromKeyGenResult } from '@continuumdao/continuum-node-sdk';
|
|
3
3
|
|
|
4
4
|
// src/core/registry.ts
|
|
@@ -569,6 +569,10 @@ function buildAaveV4BorrowTableRowsFromHub(borrowable, hubReserves, debtByUnderl
|
|
|
569
569
|
};
|
|
570
570
|
});
|
|
571
571
|
}
|
|
572
|
+
function defiEvmTransport(rpcUrl, opts) {
|
|
573
|
+
const url = rpcUrl.trim();
|
|
574
|
+
return http(url, opts);
|
|
575
|
+
}
|
|
572
576
|
var spokeStaticAbi = [
|
|
573
577
|
{
|
|
574
578
|
name: "getReserveCount",
|
|
@@ -630,7 +634,7 @@ async function fetchAaveV4SpokeReserveIdForUnderlying(args) {
|
|
|
630
634
|
nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
|
|
631
635
|
rpcUrls: { default: { http: [url] } }
|
|
632
636
|
});
|
|
633
|
-
const client = createPublicClient({ chain, transport:
|
|
637
|
+
const client = createPublicClient({ chain, transport: defiEvmTransport(url) });
|
|
634
638
|
const count = await client.readContract({
|
|
635
639
|
address: spoke,
|
|
636
640
|
abi: spokeStaticAbi,
|
|
@@ -660,7 +664,7 @@ async function fetchAaveV4SpokeReserveStatusForUnderlying(args) {
|
|
|
660
664
|
nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
|
|
661
665
|
rpcUrls: { default: { http: [url] } }
|
|
662
666
|
});
|
|
663
|
-
const client = createPublicClient({ chain, transport:
|
|
667
|
+
const client = createPublicClient({ chain, transport: defiEvmTransport(url) });
|
|
664
668
|
const cfg = await client.readContract({
|
|
665
669
|
address: spoke,
|
|
666
670
|
abi: spokeStaticAbi,
|
|
@@ -767,7 +771,7 @@ async function buildEvmMultisignBatch(args) {
|
|
|
767
771
|
nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
|
|
768
772
|
rpcUrls: { default: { http: [rpcUrl] } }
|
|
769
773
|
});
|
|
770
|
-
const publicClient = createPublicClient({ chain: ch, transport:
|
|
774
|
+
const publicClient = createPublicClient({ chain: ch, transport: defiEvmTransport(rpcUrl) });
|
|
771
775
|
const feeParams = await fetchChainFeeParams(rpcUrl, chainId);
|
|
772
776
|
const legacy = Boolean(chainDetail?.legacy) || !feeParams.isEip1559;
|
|
773
777
|
const latestBaseFeeWei = !legacy ? (await publicClient.getBlock({ blockTag: "latest" })).baseFeePerGas ?? 0n : 0n;
|
|
@@ -953,7 +957,7 @@ async function buildEvmMultisignBodyAaveV4DepositBatch(args) {
|
|
|
953
957
|
nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
|
|
954
958
|
rpcUrls: { default: { http: [args.rpcUrl] } }
|
|
955
959
|
});
|
|
956
|
-
const publicClient = createPublicClient({ chain: ch, transport:
|
|
960
|
+
const publicClient = createPublicClient({ chain: ch, transport: defiEvmTransport(args.rpcUrl) });
|
|
957
961
|
const dec = await publicClient.readContract({
|
|
958
962
|
address: asset,
|
|
959
963
|
abi: erc20AllowanceAbi,
|
|
@@ -1166,7 +1170,7 @@ async function buildEvmMultisignBodyAaveV4SpokeWithdraw(args) {
|
|
|
1166
1170
|
nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
|
|
1167
1171
|
rpcUrls: { default: { http: [args.rpcUrl] } }
|
|
1168
1172
|
});
|
|
1169
|
-
const publicClient = createPublicClient({ chain: ch, transport:
|
|
1173
|
+
const publicClient = createPublicClient({ chain: ch, transport: defiEvmTransport(args.rpcUrl) });
|
|
1170
1174
|
const dec = await publicClient.readContract({
|
|
1171
1175
|
address: asset,
|
|
1172
1176
|
abi: erc20AllowanceAbi,
|
|
@@ -1242,7 +1246,7 @@ async function buildEvmMultisignBodyAaveV4SpokeBorrow(args) {
|
|
|
1242
1246
|
nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
|
|
1243
1247
|
rpcUrls: { default: { http: [args.rpcUrl] } }
|
|
1244
1248
|
});
|
|
1245
|
-
const publicClient = createPublicClient({ chain: ch, transport:
|
|
1249
|
+
const publicClient = createPublicClient({ chain: ch, transport: defiEvmTransport(args.rpcUrl) });
|
|
1246
1250
|
const dec = await publicClient.readContract({
|
|
1247
1251
|
address: asset,
|
|
1248
1252
|
abi: erc20AllowanceAbi,
|
|
@@ -1318,7 +1322,7 @@ async function buildEvmMultisignBodyAaveV4SpokeRepay(args) {
|
|
|
1318
1322
|
nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
|
|
1319
1323
|
rpcUrls: { default: { http: [args.rpcUrl] } }
|
|
1320
1324
|
});
|
|
1321
|
-
const publicClient = createPublicClient({ chain: ch, transport:
|
|
1325
|
+
const publicClient = createPublicClient({ chain: ch, transport: defiEvmTransport(args.rpcUrl) });
|
|
1322
1326
|
const dec = await publicClient.readContract({
|
|
1323
1327
|
address: asset,
|
|
1324
1328
|
abi: erc20AllowanceAbi,
|