@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.
Files changed (52) hide show
  1. package/dist/agent/catalog.cjs +1305 -21
  2. package/dist/agent/catalog.cjs.map +1 -1
  3. package/dist/agent/catalog.d.ts +1468 -1
  4. package/dist/agent/catalog.js +1236 -23
  5. package/dist/agent/catalog.js.map +1 -1
  6. package/dist/agent/skills/continuum-dao/SKILL.md +139 -0
  7. package/dist/agent/skills/ethena/SKILL.md +1 -1
  8. package/dist/agent/skills/lido/SKILL.md +4 -1
  9. package/dist/core/index.cjs +42 -39
  10. package/dist/core/index.cjs.map +1 -1
  11. package/dist/core/index.d.ts +1 -1
  12. package/dist/core/index.js +42 -39
  13. package/dist/core/index.js.map +1 -1
  14. package/dist/{eip712Multisign-xhXpUYp3.d.ts → eip712Multisign-DCW7heqX.d.ts} +11 -8
  15. package/dist/index.cjs +64 -57
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.d.ts +1 -1
  18. package/dist/index.js +64 -57
  19. package/dist/index.js.map +1 -1
  20. package/dist/protocols/evm/arcus/index.cjs +62 -55
  21. package/dist/protocols/evm/arcus/index.cjs.map +1 -1
  22. package/dist/protocols/evm/arcus/index.js +62 -55
  23. package/dist/protocols/evm/arcus/index.js.map +1 -1
  24. package/dist/protocols/evm/continuum-dao/index.cjs +2237 -0
  25. package/dist/protocols/evm/continuum-dao/index.cjs.map +1 -0
  26. package/dist/protocols/evm/continuum-dao/index.d.ts +700 -0
  27. package/dist/protocols/evm/continuum-dao/index.js +2110 -0
  28. package/dist/protocols/evm/continuum-dao/index.js.map +1 -0
  29. package/dist/protocols/evm/ethena/index.cjs +41 -4
  30. package/dist/protocols/evm/ethena/index.cjs.map +1 -1
  31. package/dist/protocols/evm/ethena/index.d.ts +12 -2
  32. package/dist/protocols/evm/ethena/index.js +38 -5
  33. package/dist/protocols/evm/ethena/index.js.map +1 -1
  34. package/dist/protocols/evm/hyperliquid/index.cjs +125 -110
  35. package/dist/protocols/evm/hyperliquid/index.cjs.map +1 -1
  36. package/dist/protocols/evm/hyperliquid/index.js +125 -110
  37. package/dist/protocols/evm/hyperliquid/index.js.map +1 -1
  38. package/dist/protocols/evm/lido/index.cjs +66 -1
  39. package/dist/protocols/evm/lido/index.cjs.map +1 -1
  40. package/dist/protocols/evm/lido/index.d.ts +11 -1
  41. package/dist/protocols/evm/lido/index.js +60 -2
  42. package/dist/protocols/evm/lido/index.js.map +1 -1
  43. package/dist/protocols/evm/permit2/index.cjs +66 -59
  44. package/dist/protocols/evm/permit2/index.cjs.map +1 -1
  45. package/dist/protocols/evm/permit2/index.js +66 -59
  46. package/dist/protocols/evm/permit2/index.js.map +1 -1
  47. package/dist/protocols/evm/uniswap-v4/index.cjs +63 -56
  48. package/dist/protocols/evm/uniswap-v4/index.cjs.map +1 -1
  49. package/dist/protocols/evm/uniswap-v4/index.d.ts +1 -1
  50. package/dist/protocols/evm/uniswap-v4/index.js +63 -56
  51. package/dist/protocols/evm/uniswap-v4/index.js.map +1 -1
  52. package/package.json +6 -1
@@ -4606,57 +4606,60 @@ function eip712SignatureText(domain, primaryType) {
4606
4606
  function jsonStringifyForAudit(value) {
4607
4607
  return JSON.stringify(value, (_, v) => typeof v === "bigint" ? v.toString() : v);
4608
4608
  }
4609
- function eip712MsgRawHex(typedData, delivery) {
4610
- const envelope = {
4609
+ function eip712LegEnvelope(typedData, delivery, digest) {
4610
+ return {
4611
4611
  version: 1,
4612
- ...typedData,
4613
- delivery
4614
- };
4615
- return viem.stringToHex(jsonStringifyForAudit(envelope));
4616
- }
4617
- function buildEip712MultisignBody(args) {
4618
- const { typedData, delivery } = args;
4619
- const digest = viem.hashTypedData({
4612
+ digest,
4620
4613
  domain: typedData.domain,
4621
4614
  types: typedData.types,
4622
4615
  primaryType: typedData.primaryType,
4623
- message: typedData.message
4624
- });
4625
- const extraJSON = {
4626
- signRequestKind: EIP712_SIGN_REQUEST_KIND,
4627
- eip712: {
4628
- version: 1,
4629
- digest,
4630
- domain: typedData.domain,
4631
- types: typedData.types,
4632
- primaryType: typedData.primaryType,
4633
- message: typedData.message
4634
- },
4616
+ message: typedData.message,
4635
4617
  delivery
4636
4618
  };
4619
+ }
4620
+ function eip712MsgRawHex(envelope) {
4621
+ return viem.stringToHex(jsonStringifyForAudit(envelope));
4622
+ }
4623
+ function buildEip712Multisign(args) {
4624
+ if (args.legs.length < 1) {
4625
+ throw new Error("buildEip712Multisign requires at least one leg");
4626
+ }
4627
+ const eip712 = [];
4628
+ const legs = args.legs.map((leg) => {
4629
+ const digest = viem.hashTypedData({
4630
+ domain: leg.typedData.domain,
4631
+ types: leg.typedData.types,
4632
+ primaryType: leg.typedData.primaryType,
4633
+ message: leg.typedData.message
4634
+ });
4635
+ const envelope = eip712LegEnvelope(leg.typedData, leg.delivery, digest);
4636
+ eip712.push(envelope);
4637
+ return {
4638
+ msgHash: msgHashNo0x(digest),
4639
+ msgRaw: eip712MsgRawHex(envelope),
4640
+ destinationAddress: args.destinationAddress,
4641
+ signatureText: eip712SignatureText(leg.typedData.domain, leg.typedData.primaryType),
4642
+ audit: {
4643
+ kind: "EIP712",
4644
+ primaryType: leg.typedData.primaryType,
4645
+ deliveryKind: leg.delivery.kind,
4646
+ ...leg.audit ?? {}
4647
+ },
4648
+ feeSnapshot: {}
4649
+ };
4650
+ });
4637
4651
  return finalizeMultisign({
4638
4652
  keyGen: args.keyGen,
4639
4653
  purposeText: args.purposeText,
4640
4654
  purposeSuffix: args.purposeSuffix,
4641
4655
  destinationChainID: args.destinationChainID,
4642
4656
  destinationAddress: args.destinationAddress,
4643
- extraJSON,
4657
+ extraJSON: {
4658
+ signRequestKind: EIP712_SIGN_REQUEST_KIND,
4659
+ eip712
4660
+ },
4644
4661
  expiryDate: args.expiryDate,
4645
- legs: [
4646
- {
4647
- msgHash: msgHashNo0x(digest),
4648
- msgRaw: eip712MsgRawHex(typedData, delivery),
4649
- destinationAddress: args.destinationAddress,
4650
- signatureText: eip712SignatureText(typedData.domain, typedData.primaryType),
4651
- audit: {
4652
- kind: "EIP712",
4653
- primaryType: typedData.primaryType,
4654
- deliveryKind: delivery.kind,
4655
- ...args.audit ?? {}
4656
- },
4657
- feeSnapshot: {}
4658
- }
4659
- ]
4662
+ legs
4660
4663
  });
4661
4664
  }
4662
4665
 
@@ -4674,28 +4677,32 @@ async function buildEvmMultisignBodyUniswapV4LimitOrderBatch(args) {
4674
4677
  quoteResponse: args.fullLimitQuote,
4675
4678
  signatureHex: "0x"
4676
4679
  });
4677
- return buildEip712MultisignBody({
4680
+ return buildEip712Multisign({
4678
4681
  keyGen: args.keyGen,
4679
4682
  purposeText: args.purposeText,
4680
4683
  destinationChainID: String(UNISWAP_LIMIT_ORDER_CHAIN_ID),
4681
4684
  destinationAddress: PERMIT2_ADDRESS,
4682
- typedData,
4683
- delivery: {
4684
- kind: "uniswapx_limit_order",
4685
- chainId: UNISWAP_LIMIT_ORDER_CHAIN_ID,
4686
- swapper: viem.getAddress(args.swapper),
4687
- submitBodyTemplate: submitTemplate,
4688
- quoteResponse: args.fullLimitQuote,
4689
- uniswapApiKey: args.uniswapApiKey,
4690
- tradeApiBaseUrl: args.tradeApiBaseUrl ?? "https://trade-api.gateway.uniswap.org/v1"
4691
- },
4692
- audit: {
4693
- protocol: "uniswap-v4",
4694
- action: "limitOrder",
4695
- routing: args.fullLimitQuote.routing ?? "LIMIT_ORDER",
4696
- orderType: "Limit",
4697
- primaryType: typedData.primaryType
4698
- },
4685
+ legs: [
4686
+ {
4687
+ typedData,
4688
+ delivery: {
4689
+ kind: "uniswapx_limit_order",
4690
+ chainId: UNISWAP_LIMIT_ORDER_CHAIN_ID,
4691
+ swapper: viem.getAddress(args.swapper),
4692
+ submitBodyTemplate: submitTemplate,
4693
+ quoteResponse: args.fullLimitQuote,
4694
+ uniswapApiKey: args.uniswapApiKey,
4695
+ tradeApiBaseUrl: args.tradeApiBaseUrl ?? "https://trade-api.gateway.uniswap.org/v1"
4696
+ },
4697
+ audit: {
4698
+ protocol: "uniswap-v4",
4699
+ action: "limitOrder",
4700
+ routing: args.fullLimitQuote.routing ?? "LIMIT_ORDER",
4701
+ orderType: "Limit",
4702
+ primaryType: typedData.primaryType
4703
+ }
4704
+ }
4705
+ ],
4699
4706
  expiryDate: args.expiryDate
4700
4707
  });
4701
4708
  }