@continuumdao/ctm-mpc-defi 0.2.28 → 0.2.30
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 +1305 -21
- package/dist/agent/catalog.cjs.map +1 -1
- package/dist/agent/catalog.d.ts +1468 -1
- package/dist/agent/catalog.js +1236 -23
- package/dist/agent/catalog.js.map +1 -1
- package/dist/agent/skills/continuum-dao/SKILL.md +139 -0
- package/dist/agent/skills/ethena/SKILL.md +1 -1
- package/dist/agent/skills/lido/SKILL.md +4 -1
- package/dist/core/index.cjs +42 -39
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +42 -39
- package/dist/core/index.js.map +1 -1
- package/dist/{eip712Multisign-xhXpUYp3.d.ts → eip712Multisign-DCW7heqX.d.ts} +11 -8
- package/dist/index.cjs +64 -57
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +64 -57
- package/dist/index.js.map +1 -1
- package/dist/protocols/evm/arcus/index.cjs +62 -55
- package/dist/protocols/evm/arcus/index.cjs.map +1 -1
- package/dist/protocols/evm/arcus/index.js +62 -55
- package/dist/protocols/evm/arcus/index.js.map +1 -1
- package/dist/protocols/evm/continuum-dao/index.cjs +2237 -0
- package/dist/protocols/evm/continuum-dao/index.cjs.map +1 -0
- package/dist/protocols/evm/continuum-dao/index.d.ts +700 -0
- package/dist/protocols/evm/continuum-dao/index.js +2110 -0
- package/dist/protocols/evm/continuum-dao/index.js.map +1 -0
- package/dist/protocols/evm/ethena/index.cjs +41 -4
- package/dist/protocols/evm/ethena/index.cjs.map +1 -1
- package/dist/protocols/evm/ethena/index.d.ts +12 -2
- package/dist/protocols/evm/ethena/index.js +38 -5
- package/dist/protocols/evm/ethena/index.js.map +1 -1
- package/dist/protocols/evm/hyperliquid/index.cjs +125 -110
- package/dist/protocols/evm/hyperliquid/index.cjs.map +1 -1
- package/dist/protocols/evm/hyperliquid/index.js +125 -110
- package/dist/protocols/evm/hyperliquid/index.js.map +1 -1
- package/dist/protocols/evm/lido/index.cjs +66 -1
- package/dist/protocols/evm/lido/index.cjs.map +1 -1
- package/dist/protocols/evm/lido/index.d.ts +11 -1
- package/dist/protocols/evm/lido/index.js +60 -2
- package/dist/protocols/evm/lido/index.js.map +1 -1
- package/dist/protocols/evm/permit2/index.cjs +66 -59
- package/dist/protocols/evm/permit2/index.cjs.map +1 -1
- package/dist/protocols/evm/permit2/index.js +66 -59
- package/dist/protocols/evm/permit2/index.js.map +1 -1
- package/dist/protocols/evm/uniswap-v4/index.cjs +63 -56
- 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 +63 -56
- package/dist/protocols/evm/uniswap-v4/index.js.map +1 -1
- package/package.json +6 -1
|
@@ -1179,57 +1179,60 @@ function eip712SignatureText(domain, primaryType) {
|
|
|
1179
1179
|
function jsonStringifyForAudit(value) {
|
|
1180
1180
|
return JSON.stringify(value, (_, v) => typeof v === "bigint" ? v.toString() : v);
|
|
1181
1181
|
}
|
|
1182
|
-
function
|
|
1183
|
-
|
|
1182
|
+
function eip712LegEnvelope(typedData, delivery, digest) {
|
|
1183
|
+
return {
|
|
1184
1184
|
version: 1,
|
|
1185
|
-
|
|
1186
|
-
delivery
|
|
1187
|
-
};
|
|
1188
|
-
return viem.stringToHex(jsonStringifyForAudit(envelope));
|
|
1189
|
-
}
|
|
1190
|
-
function buildEip712MultisignBody(args) {
|
|
1191
|
-
const { typedData, delivery } = args;
|
|
1192
|
-
const digest = viem.hashTypedData({
|
|
1185
|
+
digest,
|
|
1193
1186
|
domain: typedData.domain,
|
|
1194
1187
|
types: typedData.types,
|
|
1195
1188
|
primaryType: typedData.primaryType,
|
|
1196
|
-
message: typedData.message
|
|
1197
|
-
});
|
|
1198
|
-
const extraJSON = {
|
|
1199
|
-
signRequestKind: EIP712_SIGN_REQUEST_KIND,
|
|
1200
|
-
eip712: {
|
|
1201
|
-
version: 1,
|
|
1202
|
-
digest,
|
|
1203
|
-
domain: typedData.domain,
|
|
1204
|
-
types: typedData.types,
|
|
1205
|
-
primaryType: typedData.primaryType,
|
|
1206
|
-
message: typedData.message
|
|
1207
|
-
},
|
|
1189
|
+
message: typedData.message,
|
|
1208
1190
|
delivery
|
|
1209
1191
|
};
|
|
1192
|
+
}
|
|
1193
|
+
function eip712MsgRawHex(envelope) {
|
|
1194
|
+
return viem.stringToHex(jsonStringifyForAudit(envelope));
|
|
1195
|
+
}
|
|
1196
|
+
function buildEip712Multisign(args) {
|
|
1197
|
+
if (args.legs.length < 1) {
|
|
1198
|
+
throw new Error("buildEip712Multisign requires at least one leg");
|
|
1199
|
+
}
|
|
1200
|
+
const eip712 = [];
|
|
1201
|
+
const legs = args.legs.map((leg) => {
|
|
1202
|
+
const digest = viem.hashTypedData({
|
|
1203
|
+
domain: leg.typedData.domain,
|
|
1204
|
+
types: leg.typedData.types,
|
|
1205
|
+
primaryType: leg.typedData.primaryType,
|
|
1206
|
+
message: leg.typedData.message
|
|
1207
|
+
});
|
|
1208
|
+
const envelope = eip712LegEnvelope(leg.typedData, leg.delivery, digest);
|
|
1209
|
+
eip712.push(envelope);
|
|
1210
|
+
return {
|
|
1211
|
+
msgHash: msgHashNo0x(digest),
|
|
1212
|
+
msgRaw: eip712MsgRawHex(envelope),
|
|
1213
|
+
destinationAddress: args.destinationAddress,
|
|
1214
|
+
signatureText: eip712SignatureText(leg.typedData.domain, leg.typedData.primaryType),
|
|
1215
|
+
audit: {
|
|
1216
|
+
kind: "EIP712",
|
|
1217
|
+
primaryType: leg.typedData.primaryType,
|
|
1218
|
+
deliveryKind: leg.delivery.kind,
|
|
1219
|
+
...leg.audit ?? {}
|
|
1220
|
+
},
|
|
1221
|
+
feeSnapshot: {}
|
|
1222
|
+
};
|
|
1223
|
+
});
|
|
1210
1224
|
return finalizeMultisign({
|
|
1211
1225
|
keyGen: args.keyGen,
|
|
1212
1226
|
purposeText: args.purposeText,
|
|
1213
1227
|
purposeSuffix: args.purposeSuffix,
|
|
1214
1228
|
destinationChainID: args.destinationChainID,
|
|
1215
1229
|
destinationAddress: args.destinationAddress,
|
|
1216
|
-
extraJSON
|
|
1230
|
+
extraJSON: {
|
|
1231
|
+
signRequestKind: EIP712_SIGN_REQUEST_KIND,
|
|
1232
|
+
eip712
|
|
1233
|
+
},
|
|
1217
1234
|
expiryDate: args.expiryDate,
|
|
1218
|
-
legs
|
|
1219
|
-
{
|
|
1220
|
-
msgHash: msgHashNo0x(digest),
|
|
1221
|
-
msgRaw: eip712MsgRawHex(typedData, delivery),
|
|
1222
|
-
destinationAddress: args.destinationAddress,
|
|
1223
|
-
signatureText: eip712SignatureText(typedData.domain, typedData.primaryType),
|
|
1224
|
-
audit: {
|
|
1225
|
-
kind: "EIP712",
|
|
1226
|
-
primaryType: typedData.primaryType,
|
|
1227
|
-
deliveryKind: delivery.kind,
|
|
1228
|
-
...args.audit ?? {}
|
|
1229
|
-
},
|
|
1230
|
-
feeSnapshot: {}
|
|
1231
|
-
}
|
|
1232
|
-
]
|
|
1235
|
+
legs
|
|
1233
1236
|
});
|
|
1234
1237
|
}
|
|
1235
1238
|
var EXCHANGE_DOMAIN = {
|
|
@@ -1475,40 +1478,44 @@ async function buildHyperliquidLimitOrderWithTpslMultisign(args) {
|
|
|
1475
1478
|
const nonce = args.nonce ?? Date.now();
|
|
1476
1479
|
const isTestnet = args.chainId === 998;
|
|
1477
1480
|
const typed = buildHyperliquidAgentTypedData({ action, nonce, isTestnet });
|
|
1478
|
-
return
|
|
1481
|
+
return buildEip712Multisign({
|
|
1479
1482
|
keyGen: args.keyGen,
|
|
1480
1483
|
purposeText: args.purposeText,
|
|
1481
1484
|
destinationChainID: String(args.chainId),
|
|
1482
1485
|
destinationAddress: ZERO_ADDRESS,
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1486
|
+
legs: [
|
|
1487
|
+
{
|
|
1488
|
+
typedData: {
|
|
1489
|
+
domain: typed.domain,
|
|
1490
|
+
types: typed.types,
|
|
1491
|
+
primaryType: typed.primaryType,
|
|
1492
|
+
message: typed.message
|
|
1493
|
+
},
|
|
1494
|
+
delivery: {
|
|
1495
|
+
kind: "hyperliquid_exchange",
|
|
1496
|
+
chainId: args.chainId,
|
|
1497
|
+
isTestnet,
|
|
1498
|
+
action,
|
|
1499
|
+
nonce
|
|
1500
|
+
},
|
|
1501
|
+
audit: {
|
|
1502
|
+
protocol: "hyperliquid",
|
|
1503
|
+
action: "limitOrderWithTpsl",
|
|
1504
|
+
coin: args.coin,
|
|
1505
|
+
marketKind,
|
|
1506
|
+
asset,
|
|
1507
|
+
isBuy: args.isBuy,
|
|
1508
|
+
limitPxHuman: args.limitPxHuman,
|
|
1509
|
+
szHuman: args.szHuman,
|
|
1510
|
+
takeProfitTriggerPxHuman: tp ?? null,
|
|
1511
|
+
stopLossTriggerPxHuman: sl ?? null,
|
|
1512
|
+
tpslExecMode: args.tpslExecMode ?? "limit_at_trigger",
|
|
1513
|
+
grouping: "normalTpsl",
|
|
1514
|
+
nonce,
|
|
1515
|
+
connectionId: typed.connectionId
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
]
|
|
1512
1519
|
});
|
|
1513
1520
|
}
|
|
1514
1521
|
async function buildHyperliquidUpdateLeverageMultisign(args) {
|
|
@@ -1527,35 +1534,39 @@ async function buildHyperliquidUpdateLeverageMultisign(args) {
|
|
|
1527
1534
|
const nonce = args.nonce ?? Date.now();
|
|
1528
1535
|
const isTestnet = args.chainId === 998;
|
|
1529
1536
|
const typed = buildHyperliquidAgentTypedData({ action, nonce, isTestnet });
|
|
1530
|
-
return
|
|
1537
|
+
return buildEip712Multisign({
|
|
1531
1538
|
keyGen: args.keyGen,
|
|
1532
1539
|
purposeText: args.purposeText,
|
|
1533
1540
|
destinationChainID: String(args.chainId),
|
|
1534
1541
|
destinationAddress: ZERO_ADDRESS,
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1542
|
+
legs: [
|
|
1543
|
+
{
|
|
1544
|
+
typedData: {
|
|
1545
|
+
domain: typed.domain,
|
|
1546
|
+
types: typed.types,
|
|
1547
|
+
primaryType: typed.primaryType,
|
|
1548
|
+
message: typed.message
|
|
1549
|
+
},
|
|
1550
|
+
delivery: {
|
|
1551
|
+
kind: "hyperliquid_exchange",
|
|
1552
|
+
chainId: args.chainId,
|
|
1553
|
+
isTestnet,
|
|
1554
|
+
action,
|
|
1555
|
+
nonce
|
|
1556
|
+
},
|
|
1557
|
+
audit: {
|
|
1558
|
+
protocol: "hyperliquid",
|
|
1559
|
+
action: "updateLeverage",
|
|
1560
|
+
coin: args.coin,
|
|
1561
|
+
marketKind,
|
|
1562
|
+
asset,
|
|
1563
|
+
leverage: action.leverage,
|
|
1564
|
+
isCross: action.isCross,
|
|
1565
|
+
nonce,
|
|
1566
|
+
connectionId: typed.connectionId
|
|
1567
|
+
}
|
|
1568
|
+
}
|
|
1569
|
+
]
|
|
1559
1570
|
});
|
|
1560
1571
|
}
|
|
1561
1572
|
|
|
@@ -1928,27 +1939,31 @@ async function buildHyperliquidBridgeWithdrawMultisign(args) {
|
|
|
1928
1939
|
isTestnet
|
|
1929
1940
|
});
|
|
1930
1941
|
const typed = buildHyperliquidWithdraw3TypedData({ action });
|
|
1931
|
-
return
|
|
1942
|
+
return buildEip712Multisign({
|
|
1932
1943
|
keyGen: args.keyGen,
|
|
1933
1944
|
purposeText: args.purposeText,
|
|
1934
1945
|
destinationChainID: String(args.chainId),
|
|
1935
1946
|
destinationAddress: ZERO_ADDRESS2,
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1947
|
+
legs: [
|
|
1948
|
+
{
|
|
1949
|
+
typedData: typed,
|
|
1950
|
+
delivery: {
|
|
1951
|
+
kind: "hyperliquid_exchange",
|
|
1952
|
+
chainId: args.chainId,
|
|
1953
|
+
isTestnet,
|
|
1954
|
+
action,
|
|
1955
|
+
nonce
|
|
1956
|
+
},
|
|
1957
|
+
audit: {
|
|
1958
|
+
protocol: "hyperliquid",
|
|
1959
|
+
action: "bridgeWithdraw",
|
|
1960
|
+
usdHuman: args.usdHuman,
|
|
1961
|
+
destination,
|
|
1962
|
+
nonce,
|
|
1963
|
+
hyperliquidChain: action.hyperliquidChain
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
]
|
|
1952
1967
|
});
|
|
1953
1968
|
}
|
|
1954
1969
|
|