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