@continuumdao/ctm-mpc-defi 0.2.65 → 0.2.66
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 +1227 -2928
- package/dist/agent/catalog.cjs.map +1 -1
- package/dist/agent/catalog.d.ts +1620 -1631
- package/dist/agent/catalog.js +1226 -2929
- package/dist/agent/catalog.js.map +1 -1
- package/dist/chains/evm/index.cjs +15 -11
- package/dist/chains/evm/index.cjs.map +1 -1
- package/dist/chains/evm/index.js +5 -1
- package/dist/chains/evm/index.js.map +1 -1
- package/dist/core/index.cjs +3 -3
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +2 -2
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +18 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/protocols/evm/aave-v4/index.cjs +16 -12
- package/dist/protocols/evm/aave-v4/index.cjs.map +1 -1
- package/dist/protocols/evm/aave-v4/index.js +5 -1
- package/dist/protocols/evm/aave-v4/index.js.map +1 -1
- package/dist/protocols/evm/aerodrome/index.cjs +15 -11
- package/dist/protocols/evm/aerodrome/index.cjs.map +1 -1
- package/dist/protocols/evm/aerodrome/index.js +5 -1
- package/dist/protocols/evm/aerodrome/index.js.map +1 -1
- package/dist/protocols/evm/arcus/index.cjs +15 -11
- package/dist/protocols/evm/arcus/index.cjs.map +1 -1
- package/dist/protocols/evm/arcus/index.js +5 -1
- package/dist/protocols/evm/arcus/index.js.map +1 -1
- package/dist/protocols/evm/circle-cctp/index.cjs +15 -11
- package/dist/protocols/evm/circle-cctp/index.cjs.map +1 -1
- package/dist/protocols/evm/circle-cctp/index.js +5 -1
- package/dist/protocols/evm/circle-cctp/index.js.map +1 -1
- package/dist/protocols/evm/compound-v3/index.cjs +15 -11
- package/dist/protocols/evm/compound-v3/index.cjs.map +1 -1
- package/dist/protocols/evm/compound-v3/index.js +5 -1
- package/dist/protocols/evm/compound-v3/index.js.map +1 -1
- package/dist/protocols/evm/continuum-dao/index.cjs +26 -14
- package/dist/protocols/evm/continuum-dao/index.cjs.map +1 -1
- package/dist/protocols/evm/continuum-dao/index.d.ts +3 -1
- package/dist/protocols/evm/continuum-dao/index.js +16 -5
- package/dist/protocols/evm/continuum-dao/index.js.map +1 -1
- package/dist/protocols/evm/curve-dao/index.cjs +15 -11
- package/dist/protocols/evm/curve-dao/index.cjs.map +1 -1
- package/dist/protocols/evm/curve-dao/index.d.ts +1 -1
- package/dist/protocols/evm/curve-dao/index.js +5 -1
- package/dist/protocols/evm/curve-dao/index.js.map +1 -1
- package/dist/protocols/evm/derive/index.cjs +18 -14
- package/dist/protocols/evm/derive/index.cjs.map +1 -1
- package/dist/protocols/evm/derive/index.js +5 -1
- package/dist/protocols/evm/derive/index.js.map +1 -1
- package/dist/protocols/evm/ethena/index.cjs +16 -12
- package/dist/protocols/evm/ethena/index.cjs.map +1 -1
- package/dist/protocols/evm/ethena/index.js +5 -1
- package/dist/protocols/evm/ethena/index.js.map +1 -1
- package/dist/protocols/evm/euler-v2/index.cjs +15 -11
- package/dist/protocols/evm/euler-v2/index.cjs.map +1 -1
- package/dist/protocols/evm/euler-v2/index.js +5 -1
- package/dist/protocols/evm/euler-v2/index.js.map +1 -1
- package/dist/protocols/evm/gmx/index.cjs +15 -11
- package/dist/protocols/evm/gmx/index.cjs.map +1 -1
- package/dist/protocols/evm/gmx/index.js +5 -1
- package/dist/protocols/evm/gmx/index.js.map +1 -1
- package/dist/protocols/evm/hyperliquid/index.cjs +15 -11
- package/dist/protocols/evm/hyperliquid/index.cjs.map +1 -1
- package/dist/protocols/evm/hyperliquid/index.js +5 -1
- package/dist/protocols/evm/hyperliquid/index.js.map +1 -1
- package/dist/protocols/evm/hyperliquidOutcome/index.cjs +2 -2
- package/dist/protocols/evm/hyperliquidOutcome/index.cjs.map +1 -1
- package/dist/protocols/evm/hyperliquidOutcome/index.js +1 -1
- package/dist/protocols/evm/hyperliquidOutcome/index.js.map +1 -1
- package/dist/protocols/evm/lido/index.cjs +15 -11
- package/dist/protocols/evm/lido/index.cjs.map +1 -1
- package/dist/protocols/evm/lido/index.js +5 -1
- package/dist/protocols/evm/lido/index.js.map +1 -1
- package/dist/protocols/evm/maple/index.cjs +15 -11
- package/dist/protocols/evm/maple/index.cjs.map +1 -1
- package/dist/protocols/evm/maple/index.js +5 -1
- package/dist/protocols/evm/maple/index.js.map +1 -1
- package/dist/protocols/evm/morpho/index.cjs +15 -11
- package/dist/protocols/evm/morpho/index.cjs.map +1 -1
- package/dist/protocols/evm/morpho/index.js +5 -1
- package/dist/protocols/evm/morpho/index.js.map +1 -1
- package/dist/protocols/evm/pendle/index.cjs +15 -11
- package/dist/protocols/evm/pendle/index.cjs.map +1 -1
- package/dist/protocols/evm/pendle/index.js +5 -1
- package/dist/protocols/evm/pendle/index.js.map +1 -1
- package/dist/protocols/evm/permit2/index.cjs +2 -2
- package/dist/protocols/evm/permit2/index.cjs.map +1 -1
- package/dist/protocols/evm/permit2/index.js +1 -1
- package/dist/protocols/evm/permit2/index.js.map +1 -1
- package/dist/protocols/evm/railgun/index.cjs +15 -11
- package/dist/protocols/evm/railgun/index.cjs.map +1 -1
- package/dist/protocols/evm/railgun/index.js +5 -1
- package/dist/protocols/evm/railgun/index.js.map +1 -1
- package/dist/protocols/evm/sky/index.cjs +15 -11
- package/dist/protocols/evm/sky/index.cjs.map +1 -1
- package/dist/protocols/evm/sky/index.js +5 -1
- package/dist/protocols/evm/sky/index.js.map +1 -1
- package/dist/protocols/evm/trueo/index.cjs +15 -11
- package/dist/protocols/evm/trueo/index.cjs.map +1 -1
- package/dist/protocols/evm/trueo/index.js +5 -1
- package/dist/protocols/evm/trueo/index.js.map +1 -1
- package/dist/protocols/evm/uniswap-v4/index.cjs +17 -12
- package/dist/protocols/evm/uniswap-v4/index.cjs.map +1 -1
- package/dist/protocols/evm/uniswap-v4/index.d.ts +1 -1
- package/dist/protocols/evm/uniswap-v4/index.js +6 -1
- package/dist/protocols/evm/uniswap-v4/index.js.map +1 -1
- package/dist/protocols/evm/venice/index.cjs +16 -12
- package/dist/protocols/evm/venice/index.cjs.map +1 -1
- package/dist/protocols/evm/venice/index.js +5 -1
- package/dist/protocols/evm/venice/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var viem = require('viem');
|
|
4
|
-
var
|
|
4
|
+
var rpcUtils_js = require('@continuumdao/continuum-node-sdk/dist/evm/rpc-utils.js');
|
|
5
|
+
var txParams_js = require('@continuumdao/continuum-node-sdk/dist/evm/tx-params.js');
|
|
6
|
+
var chainFees_js = require('@continuumdao/continuum-node-sdk/dist/evm/chain-fees.js');
|
|
7
|
+
var getSigFeeSpeed_js = require('@continuumdao/continuum-node-sdk/dist/evm/get-sig-fee-speed.js');
|
|
8
|
+
var gwei_js = require('@continuumdao/continuum-node-sdk/dist/evm/gwei.js');
|
|
5
9
|
|
|
6
10
|
var __defProp = Object.defineProperty;
|
|
7
11
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -370,7 +374,7 @@ function finalizeMultisign(input) {
|
|
|
370
374
|
const ph = (keyGen.pubkeyhex ?? "").trim();
|
|
371
375
|
if (!ph) throw new Error("keyGen pubKey (pubkeyhex) is required");
|
|
372
376
|
const keyList = keyGen.keylist ?? [];
|
|
373
|
-
const clientId =
|
|
377
|
+
const clientId = rpcUtils_js.getClientIdFromKeyGenResult(keyGen);
|
|
374
378
|
const first = legs[0];
|
|
375
379
|
const messageHashes = legs.map((l) => l.msgHash);
|
|
376
380
|
const messageRawBatch = legs.map((l) => l.msgRaw);
|
|
@@ -421,7 +425,7 @@ var init_envelope = __esm({
|
|
|
421
425
|
});
|
|
422
426
|
function routerSwapGasLimitFromEstimate(estimatedGas, chainGasLimit) {
|
|
423
427
|
if (chainGasLimit != null && Number.isFinite(chainGasLimit) && chainGasLimit > 0) {
|
|
424
|
-
return
|
|
428
|
+
return txParams_js.gasLimitFromEstimateAndChainConfig(estimatedGas, chainGasLimit);
|
|
425
429
|
}
|
|
426
430
|
return (estimatedGas * 12n + 9n) / 10n;
|
|
427
431
|
}
|
|
@@ -458,7 +462,7 @@ async function buildEvmMultisignBatch(args) {
|
|
|
458
462
|
rpcUrls: { default: { http: [rpcUrl] } }
|
|
459
463
|
});
|
|
460
464
|
const publicClient3 = viem.createPublicClient({ chain: ch, transport: defiEvmTransport(rpcUrl) });
|
|
461
|
-
const feeParams = await
|
|
465
|
+
const feeParams = await chainFees_js.fetchChainFeeParams(rpcUrl, chainId);
|
|
462
466
|
const legacy = Boolean(chainDetail?.legacy) || !feeParams.isEip1559;
|
|
463
467
|
const latestBaseFeeWei = !legacy ? (await publicClient3.getBlock({ blockTag: "latest" })).baseFeePerGas ?? 0n : 0n;
|
|
464
468
|
const gasLimitConfig = useCustomGas && chainDetail?.gasLimit != null ? Number(chainDetail.gasLimit) : void 0;
|
|
@@ -491,7 +495,7 @@ async function buildEvmMultisignBatch(args) {
|
|
|
491
495
|
} else if (step.routerSwap) {
|
|
492
496
|
gasLimitI = routerSwapGasLimitFromEstimate(estimatedGas, chainGasLimitRouter);
|
|
493
497
|
} else {
|
|
494
|
-
gasLimitI = useCustomGas ?
|
|
498
|
+
gasLimitI = useCustomGas ? txParams_js.gasLimitFromEstimateAndChainConfig(estimatedGas, gasLimitConfig) : estimatedGas;
|
|
495
499
|
}
|
|
496
500
|
let proposalTxParams;
|
|
497
501
|
let feeSnapshot;
|
|
@@ -502,7 +506,7 @@ async function buildEvmMultisignBatch(args) {
|
|
|
502
506
|
gasPriceWei = gasPriceWei * BigInt(100 + gasFeeMultiplier) / 100n;
|
|
503
507
|
}
|
|
504
508
|
if (useCustomGas && chainDetail?.gasPrice != null && chainDetail.gasPrice > 0) {
|
|
505
|
-
const configured = viem.parseGwei(
|
|
509
|
+
const configured = viem.parseGwei(gwei_js.gweiToDecimalString(Number(chainDetail.gasPrice)));
|
|
506
510
|
if (configured > gasPriceWei) gasPriceWei = configured;
|
|
507
511
|
}
|
|
508
512
|
serialized = viem.serializeTransaction({
|
|
@@ -521,7 +525,7 @@ async function buildEvmMultisignBatch(args) {
|
|
|
521
525
|
txType: "legacy",
|
|
522
526
|
gasPrice: gasPriceWei.toString()
|
|
523
527
|
};
|
|
524
|
-
feeSnapshot =
|
|
528
|
+
feeSnapshot = txParams_js.proposalTxParamsToFeeSnapshot(proposalTxParams);
|
|
525
529
|
} else {
|
|
526
530
|
const fetchedBase = feeParams.baseFeeGwei ?? 0;
|
|
527
531
|
const fetchedPriority = feeParams.priorityFeeGwei ?? 0;
|
|
@@ -532,13 +536,13 @@ async function buildEvmMultisignBatch(args) {
|
|
|
532
536
|
const baseFeeMultiplierPct = useCustomGas && chainDetail?.baseFeeMultiplier != null ? Math.max(100, Number(chainDetail.baseFeeMultiplier)) : 100;
|
|
533
537
|
const baseComponentGwei = effectiveBaseFeeGwei * baseFeeMultiplierPct / 100;
|
|
534
538
|
const maxFeePerGasGwei = baseComponentGwei + effectivePriorityFeeGwei;
|
|
535
|
-
let maxPriorityFeePerGas = effectivePriorityFeeGwei > 0 ? viem.parseGwei(
|
|
536
|
-
let maxFeePerGas = viem.parseGwei(
|
|
539
|
+
let maxPriorityFeePerGas = effectivePriorityFeeGwei > 0 ? viem.parseGwei(gwei_js.gweiToDecimalString(effectivePriorityFeeGwei)) : viem.parseGwei("1");
|
|
540
|
+
let maxFeePerGas = viem.parseGwei(gwei_js.gweiToDecimalString(maxFeePerGasGwei));
|
|
537
541
|
if (useCustomGas && gasFeeMultiplier != null && gasFeeMultiplier > 0) {
|
|
538
542
|
maxPriorityFeePerGas = maxPriorityFeePerGas * BigInt(100 + gasFeeMultiplier) / 100n;
|
|
539
543
|
maxFeePerGas = maxFeePerGas * BigInt(100 + gasFeeMultiplier) / 100n;
|
|
540
544
|
}
|
|
541
|
-
({ maxFeePerGas, maxPriorityFeePerGas } =
|
|
545
|
+
({ maxFeePerGas, maxPriorityFeePerGas } = getSigFeeSpeed_js.alignEip1559FeesWithLatestBase(
|
|
542
546
|
maxFeePerGas,
|
|
543
547
|
maxPriorityFeePerGas,
|
|
544
548
|
latestBaseFeeWei
|
|
@@ -561,7 +565,7 @@ async function buildEvmMultisignBatch(args) {
|
|
|
561
565
|
maxFeePerGas: maxFeePerGas.toString(),
|
|
562
566
|
maxPriorityFeePerGas: maxPriorityFeePerGas.toString()
|
|
563
567
|
};
|
|
564
|
-
feeSnapshot = i === 0 ?
|
|
568
|
+
feeSnapshot = i === 0 ? txParams_js.proposalTxParamsToFeeSnapshot(proposalTxParams) : {};
|
|
565
569
|
}
|
|
566
570
|
const h = viem.keccak256(serialized);
|
|
567
571
|
const msgHash = h.startsWith("0x") ? h.slice(2) : h;
|
|
@@ -738,6 +742,10 @@ function assertContinuumDaoForumTopicKey(forumKey, forumUrl) {
|
|
|
738
742
|
}
|
|
739
743
|
return raw.replace(/\/+$/, "");
|
|
740
744
|
}
|
|
745
|
+
function continuumDaoForumTopicCatalogKey(forumKey, forumUrl) {
|
|
746
|
+
const absolute = assertContinuumDaoForumTopicKey(forumKey, forumUrl);
|
|
747
|
+
return new URL(absolute).pathname.replace(/^\/+/, "");
|
|
748
|
+
}
|
|
741
749
|
function forumError(body, status) {
|
|
742
750
|
const o = body && typeof body === "object" ? body : {};
|
|
743
751
|
const st = o.status && typeof o.status === "object" ? o.status : null;
|
|
@@ -2432,6 +2440,7 @@ async function buildProposeCatalog(args) {
|
|
|
2432
2440
|
throw new Error("type must be 0\u20134 (Admin, Constitution, Decision, Election, Treasury).");
|
|
2433
2441
|
}
|
|
2434
2442
|
await assertProposalTypeMatchesForum(args.forumKey, args.type, args.forumUrl);
|
|
2443
|
+
const catalogForumKey = continuumDaoForumTopicCatalogKey(args.forumKey, args.forumUrl);
|
|
2435
2444
|
const hashed = await continuumDaoHashProposal({
|
|
2436
2445
|
chainId: args.chainId,
|
|
2437
2446
|
rpcUrl: args.rpcUrl,
|
|
@@ -2446,7 +2455,7 @@ async function buildProposeCatalog(args) {
|
|
|
2446
2455
|
title: args.title.trim(),
|
|
2447
2456
|
description: args.description,
|
|
2448
2457
|
proposer: args.proposer,
|
|
2449
|
-
forumKey:
|
|
2458
|
+
forumKey: catalogForumKey,
|
|
2450
2459
|
type: args.type,
|
|
2451
2460
|
configuration: args.configuration,
|
|
2452
2461
|
pendingOnChain: true,
|
|
@@ -3018,8 +3027,10 @@ async function buildEvmMultisignBodyContinuumDaoCastVoteBravoFromMcp(args) {
|
|
|
3018
3027
|
return buildEvmMultisignBodyContinuumDaoCastVoteBravo({ ...args, support });
|
|
3019
3028
|
}
|
|
3020
3029
|
async function continuumDaoRegisterProposal(payload) {
|
|
3021
|
-
|
|
3022
|
-
|
|
3030
|
+
const body = JSON.stringify({
|
|
3031
|
+
...payload,
|
|
3032
|
+
forumKey: continuumDaoForumTopicCatalogKey(payload.forumKey)
|
|
3033
|
+
});
|
|
3023
3034
|
const res = await fetch(`${exports.CONTINUUM_DAO_GOVERNANCE_API}/proposals/create`, {
|
|
3024
3035
|
method: "POST",
|
|
3025
3036
|
headers: { "Content-Type": "application/json" },
|
|
@@ -7938,6 +7949,7 @@ exports.continuumDaoForumSections = continuumDaoForumSections;
|
|
|
7938
7949
|
exports.continuumDaoForumSignInEligible = continuumDaoForumSignInEligible;
|
|
7939
7950
|
exports.continuumDaoForumSignInNonce = continuumDaoForumSignInNonce;
|
|
7940
7951
|
exports.continuumDaoForumSignOut = continuumDaoForumSignOut;
|
|
7952
|
+
exports.continuumDaoForumTopicCatalogKey = continuumDaoForumTopicCatalogKey;
|
|
7941
7953
|
exports.continuumDaoForumUnread = continuumDaoForumUnread;
|
|
7942
7954
|
exports.continuumDaoForumUrl = continuumDaoForumUrl;
|
|
7943
7955
|
exports.continuumDaoForumUserPostIds = continuumDaoForumUserPostIds;
|