@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 { getAddress, parseAbi, stringToHex, zeroAddress, formatUnits, defineChain, createPublicClient,
|
|
1
|
+
import { getAddress, parseAbi, stringToHex, zeroAddress, formatUnits, defineChain, createPublicClient, encodeFunctionData, maxUint256, encodeAbiParameters, parseUnits, http, parseGwei, serializeTransaction, keccak256 } from 'viem';
|
|
2
2
|
import { fetchChainFeeParams, gasLimitFromEstimateAndChainConfig, gweiToDecimalString, proposalTxParamsToFeeSnapshot, alignEip1559FeesWithLatestBase, getClientIdFromKeyGenResult } from '@continuumdao/continuum-node-sdk';
|
|
3
3
|
|
|
4
4
|
// src/core/registry.ts
|
|
@@ -525,6 +525,12 @@ async function fetchCompoundV3SubgraphMarkets(args) {
|
|
|
525
525
|
return null;
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
|
+
function defiEvmTransport(rpcUrl, opts) {
|
|
529
|
+
const url = rpcUrl.trim();
|
|
530
|
+
return http(url, opts);
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
// src/protocols/evm/compound-v3/reads.ts
|
|
528
534
|
function publicClient(rpcUrl, chainId) {
|
|
529
535
|
const chain = defineChain({
|
|
530
536
|
id: chainId,
|
|
@@ -532,7 +538,7 @@ function publicClient(rpcUrl, chainId) {
|
|
|
532
538
|
nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
|
|
533
539
|
rpcUrls: { default: { http: [rpcUrl] } }
|
|
534
540
|
});
|
|
535
|
-
return createPublicClient({ chain, transport:
|
|
541
|
+
return createPublicClient({ chain, transport: defiEvmTransport(rpcUrl) });
|
|
536
542
|
}
|
|
537
543
|
async function readTokenMeta(client, asset) {
|
|
538
544
|
const [symbol, decimals] = await Promise.all([
|
|
@@ -958,7 +964,7 @@ async function buildEvmMultisignBatch(args) {
|
|
|
958
964
|
nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
|
|
959
965
|
rpcUrls: { default: { http: [rpcUrl] } }
|
|
960
966
|
});
|
|
961
|
-
const publicClient2 = createPublicClient({ chain: ch, transport:
|
|
967
|
+
const publicClient2 = createPublicClient({ chain: ch, transport: defiEvmTransport(rpcUrl) });
|
|
962
968
|
const feeParams = await fetchChainFeeParams(rpcUrl, chainId);
|
|
963
969
|
const legacy = Boolean(chainDetail?.legacy) || !feeParams.isEip1559;
|
|
964
970
|
const latestBaseFeeWei = !legacy ? (await publicClient2.getBlock({ blockTag: "latest" })).baseFeePerGas ?? 0n : 0n;
|
|
@@ -1108,7 +1114,7 @@ function createCompoundV3PublicClient(rpcUrl, chainId) {
|
|
|
1108
1114
|
nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
|
|
1109
1115
|
rpcUrls: { default: { http: [rpcUrl] } }
|
|
1110
1116
|
});
|
|
1111
|
-
return createPublicClient({ chain, transport:
|
|
1117
|
+
return createPublicClient({ chain, transport: defiEvmTransport(rpcUrl) });
|
|
1112
1118
|
}
|
|
1113
1119
|
async function pushApproveIfNeeded(args) {
|
|
1114
1120
|
const current = await args.client.readContract({
|