@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
|
@@ -2,7 +2,7 @@ import { b as KeyGenSubsetForPermit, M as MultisignBuildResult, e as ProtocolMod
|
|
|
2
2
|
import { Address, createPublicClient, TransactionReceipt, PublicClient } from 'viem';
|
|
3
3
|
import { NodeReadAuth } from '@continuumdao/continuum-node-sdk';
|
|
4
4
|
import { E as EvmChainDetail } from '../../../types-RZWOTm8c.js';
|
|
5
|
-
import {
|
|
5
|
+
import { d as Eip712TypedDataPayload } from '../../../eip712Multisign-DCW7heqX.js';
|
|
6
6
|
|
|
7
7
|
/** Canonical Uniswap token-allowance contract on most EVM chains. */
|
|
8
8
|
declare const PERMIT2_ADDRESS: Address;
|
|
@@ -4604,57 +4604,60 @@ function eip712SignatureText(domain, primaryType) {
|
|
|
4604
4604
|
function jsonStringifyForAudit(value) {
|
|
4605
4605
|
return JSON.stringify(value, (_, v) => typeof v === "bigint" ? v.toString() : v);
|
|
4606
4606
|
}
|
|
4607
|
-
function
|
|
4608
|
-
|
|
4607
|
+
function eip712LegEnvelope(typedData, delivery, digest) {
|
|
4608
|
+
return {
|
|
4609
4609
|
version: 1,
|
|
4610
|
-
|
|
4611
|
-
delivery
|
|
4612
|
-
};
|
|
4613
|
-
return stringToHex(jsonStringifyForAudit(envelope));
|
|
4614
|
-
}
|
|
4615
|
-
function buildEip712MultisignBody(args) {
|
|
4616
|
-
const { typedData, delivery } = args;
|
|
4617
|
-
const digest = hashTypedData({
|
|
4610
|
+
digest,
|
|
4618
4611
|
domain: typedData.domain,
|
|
4619
4612
|
types: typedData.types,
|
|
4620
4613
|
primaryType: typedData.primaryType,
|
|
4621
|
-
message: typedData.message
|
|
4622
|
-
});
|
|
4623
|
-
const extraJSON = {
|
|
4624
|
-
signRequestKind: EIP712_SIGN_REQUEST_KIND,
|
|
4625
|
-
eip712: {
|
|
4626
|
-
version: 1,
|
|
4627
|
-
digest,
|
|
4628
|
-
domain: typedData.domain,
|
|
4629
|
-
types: typedData.types,
|
|
4630
|
-
primaryType: typedData.primaryType,
|
|
4631
|
-
message: typedData.message
|
|
4632
|
-
},
|
|
4614
|
+
message: typedData.message,
|
|
4633
4615
|
delivery
|
|
4634
4616
|
};
|
|
4617
|
+
}
|
|
4618
|
+
function eip712MsgRawHex(envelope) {
|
|
4619
|
+
return stringToHex(jsonStringifyForAudit(envelope));
|
|
4620
|
+
}
|
|
4621
|
+
function buildEip712Multisign(args) {
|
|
4622
|
+
if (args.legs.length < 1) {
|
|
4623
|
+
throw new Error("buildEip712Multisign requires at least one leg");
|
|
4624
|
+
}
|
|
4625
|
+
const eip712 = [];
|
|
4626
|
+
const legs = args.legs.map((leg) => {
|
|
4627
|
+
const digest = hashTypedData({
|
|
4628
|
+
domain: leg.typedData.domain,
|
|
4629
|
+
types: leg.typedData.types,
|
|
4630
|
+
primaryType: leg.typedData.primaryType,
|
|
4631
|
+
message: leg.typedData.message
|
|
4632
|
+
});
|
|
4633
|
+
const envelope = eip712LegEnvelope(leg.typedData, leg.delivery, digest);
|
|
4634
|
+
eip712.push(envelope);
|
|
4635
|
+
return {
|
|
4636
|
+
msgHash: msgHashNo0x(digest),
|
|
4637
|
+
msgRaw: eip712MsgRawHex(envelope),
|
|
4638
|
+
destinationAddress: args.destinationAddress,
|
|
4639
|
+
signatureText: eip712SignatureText(leg.typedData.domain, leg.typedData.primaryType),
|
|
4640
|
+
audit: {
|
|
4641
|
+
kind: "EIP712",
|
|
4642
|
+
primaryType: leg.typedData.primaryType,
|
|
4643
|
+
deliveryKind: leg.delivery.kind,
|
|
4644
|
+
...leg.audit ?? {}
|
|
4645
|
+
},
|
|
4646
|
+
feeSnapshot: {}
|
|
4647
|
+
};
|
|
4648
|
+
});
|
|
4635
4649
|
return finalizeMultisign({
|
|
4636
4650
|
keyGen: args.keyGen,
|
|
4637
4651
|
purposeText: args.purposeText,
|
|
4638
4652
|
purposeSuffix: args.purposeSuffix,
|
|
4639
4653
|
destinationChainID: args.destinationChainID,
|
|
4640
4654
|
destinationAddress: args.destinationAddress,
|
|
4641
|
-
extraJSON
|
|
4655
|
+
extraJSON: {
|
|
4656
|
+
signRequestKind: EIP712_SIGN_REQUEST_KIND,
|
|
4657
|
+
eip712
|
|
4658
|
+
},
|
|
4642
4659
|
expiryDate: args.expiryDate,
|
|
4643
|
-
legs
|
|
4644
|
-
{
|
|
4645
|
-
msgHash: msgHashNo0x(digest),
|
|
4646
|
-
msgRaw: eip712MsgRawHex(typedData, delivery),
|
|
4647
|
-
destinationAddress: args.destinationAddress,
|
|
4648
|
-
signatureText: eip712SignatureText(typedData.domain, typedData.primaryType),
|
|
4649
|
-
audit: {
|
|
4650
|
-
kind: "EIP712",
|
|
4651
|
-
primaryType: typedData.primaryType,
|
|
4652
|
-
deliveryKind: delivery.kind,
|
|
4653
|
-
...args.audit ?? {}
|
|
4654
|
-
},
|
|
4655
|
-
feeSnapshot: {}
|
|
4656
|
-
}
|
|
4657
|
-
]
|
|
4660
|
+
legs
|
|
4658
4661
|
});
|
|
4659
4662
|
}
|
|
4660
4663
|
|
|
@@ -4672,28 +4675,32 @@ async function buildEvmMultisignBodyUniswapV4LimitOrderBatch(args) {
|
|
|
4672
4675
|
quoteResponse: args.fullLimitQuote,
|
|
4673
4676
|
signatureHex: "0x"
|
|
4674
4677
|
});
|
|
4675
|
-
return
|
|
4678
|
+
return buildEip712Multisign({
|
|
4676
4679
|
keyGen: args.keyGen,
|
|
4677
4680
|
purposeText: args.purposeText,
|
|
4678
4681
|
destinationChainID: String(UNISWAP_LIMIT_ORDER_CHAIN_ID),
|
|
4679
4682
|
destinationAddress: PERMIT2_ADDRESS,
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4683
|
+
legs: [
|
|
4684
|
+
{
|
|
4685
|
+
typedData,
|
|
4686
|
+
delivery: {
|
|
4687
|
+
kind: "uniswapx_limit_order",
|
|
4688
|
+
chainId: UNISWAP_LIMIT_ORDER_CHAIN_ID,
|
|
4689
|
+
swapper: getAddress(args.swapper),
|
|
4690
|
+
submitBodyTemplate: submitTemplate,
|
|
4691
|
+
quoteResponse: args.fullLimitQuote,
|
|
4692
|
+
uniswapApiKey: args.uniswapApiKey,
|
|
4693
|
+
tradeApiBaseUrl: args.tradeApiBaseUrl ?? "https://trade-api.gateway.uniswap.org/v1"
|
|
4694
|
+
},
|
|
4695
|
+
audit: {
|
|
4696
|
+
protocol: "uniswap-v4",
|
|
4697
|
+
action: "limitOrder",
|
|
4698
|
+
routing: args.fullLimitQuote.routing ?? "LIMIT_ORDER",
|
|
4699
|
+
orderType: "Limit",
|
|
4700
|
+
primaryType: typedData.primaryType
|
|
4701
|
+
}
|
|
4702
|
+
}
|
|
4703
|
+
],
|
|
4697
4704
|
expiryDate: args.expiryDate
|
|
4698
4705
|
});
|
|
4699
4706
|
}
|