@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
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ export { getClientIdFromKeyGenResult as firstClientIdFromKeyGen } from '@continu
3
3
  export { BuildPayloadSignEd25519MultisignBodyArgs, DEFAULT_DEFI_MULTISIGN_EXPIRY_SECONDS, DEFI_PROTOCOLS_WITH_30MIN_EXPIRY, PAYLOAD_SIGN_ED25519_REQUEST_KIND, PayloadSignEd25519Delivery, buildPayloadSignEd25519MultisignBody, defiMultisignExpiryUnixSeconds, getAaveGraphqlProxyUrl, getCoingeckoProxyUrl, getEulerGraphqlProxyUrl, getJsonViaOptionalProxy, getMapleGraphqlProxyUrl, getMorphoGraphqlProxyUrl, getMorphoMidnightRestProxyUrl, mergePurposeText, postJsonViaOptionalProxy, setAaveGraphqlProxyUrl, setCoingeckoProxyUrl, setEulerGraphqlProxyUrl, setMapleGraphqlProxyUrl, setMorphoGraphqlProxyUrl, setMorphoMidnightRestProxyUrl } from './core/index.js';
4
4
  export { C as ChainCategoryBuildInput, a as ChainCategoryModule, M as MultisignLeg, c as coreChainCategoryModule, f as finalizeMultisign } from './envelope-C_bfuKab.js';
5
5
  export { g as getActionsByChainCategory, a as getProtocolModule, b as getProtocolModules, r as registerProtocolModule } from './registry-DxDSPQ-p.js';
6
- export { B as BuildEip712MultisignBodyArgs, E as EIP712_SIGN_REQUEST_KIND, a as Eip712MultisignDelivery, b as Eip712TypedDataField, c as Eip712TypedDataPayload, d as buildEip712MultisignBody } from './eip712Multisign-xhXpUYp3.js';
6
+ export { B as BuildEip712MultisignArgs, a as BuildEip712MultisignLeg, E as EIP712_SIGN_REQUEST_KIND, b as Eip712MultisignDelivery, c as Eip712TypedDataField, d as Eip712TypedDataPayload, e as buildEip712Multisign } from './eip712Multisign-DCW7heqX.js';
7
7
  export { E as EvmChainDetail, a as EvmProtocolContext, b as EvmTxStep, i as isEvmNativeToken, m as matchEvmTokenKind } from './types-RZWOTm8c.js';
8
8
  export { COINGECKO_PLATFORM_BY_CHAIN_ID, ConditionalApproveStep, EvmBatchMetaBuilder, EvmBuildBatchArgs, approveStepsToEvmTxSteps, buildConditionalErc20ApproveSteps, buildEvmMultisignBatch, coingeckoPlatformForChainId, evmChainCategoryModule, normalizeCurveRouterAmountString, normalizeHumanDecimalAmount, parseEvmChainIdToNumber, publicClientForRpc, resolveErc20Decimals, routerSwapGasLimitFromEstimate } from './chains/evm/index.js';
9
9
  export { SOLANA_CHAIN_CATEGORY, solanaChainCategoryModule } from './chains/solana/index.js';
package/dist/index.js CHANGED
@@ -181,57 +181,60 @@ function eip712SignatureText(domain, primaryType) {
181
181
  function jsonStringifyForAudit(value) {
182
182
  return JSON.stringify(value, (_, v) => typeof v === "bigint" ? v.toString() : v);
183
183
  }
184
- function eip712MsgRawHex(typedData, delivery) {
185
- const envelope = {
184
+ function eip712LegEnvelope(typedData, delivery, digest) {
185
+ return {
186
186
  version: 1,
187
- ...typedData,
188
- delivery
189
- };
190
- return stringToHex(jsonStringifyForAudit(envelope));
191
- }
192
- function buildEip712MultisignBody(args) {
193
- const { typedData, delivery } = args;
194
- const digest = hashTypedData({
187
+ digest,
195
188
  domain: typedData.domain,
196
189
  types: typedData.types,
197
190
  primaryType: typedData.primaryType,
198
- message: typedData.message
199
- });
200
- const extraJSON = {
201
- signRequestKind: EIP712_SIGN_REQUEST_KIND,
202
- eip712: {
203
- version: 1,
204
- digest,
205
- domain: typedData.domain,
206
- types: typedData.types,
207
- primaryType: typedData.primaryType,
208
- message: typedData.message
209
- },
191
+ message: typedData.message,
210
192
  delivery
211
193
  };
194
+ }
195
+ function eip712MsgRawHex(envelope) {
196
+ return stringToHex(jsonStringifyForAudit(envelope));
197
+ }
198
+ function buildEip712Multisign(args) {
199
+ if (args.legs.length < 1) {
200
+ throw new Error("buildEip712Multisign requires at least one leg");
201
+ }
202
+ const eip712 = [];
203
+ const legs = args.legs.map((leg) => {
204
+ const digest = hashTypedData({
205
+ domain: leg.typedData.domain,
206
+ types: leg.typedData.types,
207
+ primaryType: leg.typedData.primaryType,
208
+ message: leg.typedData.message
209
+ });
210
+ const envelope = eip712LegEnvelope(leg.typedData, leg.delivery, digest);
211
+ eip712.push(envelope);
212
+ return {
213
+ msgHash: msgHashNo0x(digest),
214
+ msgRaw: eip712MsgRawHex(envelope),
215
+ destinationAddress: args.destinationAddress,
216
+ signatureText: eip712SignatureText(leg.typedData.domain, leg.typedData.primaryType),
217
+ audit: {
218
+ kind: "EIP712",
219
+ primaryType: leg.typedData.primaryType,
220
+ deliveryKind: leg.delivery.kind,
221
+ ...leg.audit ?? {}
222
+ },
223
+ feeSnapshot: {}
224
+ };
225
+ });
212
226
  return finalizeMultisign({
213
227
  keyGen: args.keyGen,
214
228
  purposeText: args.purposeText,
215
229
  purposeSuffix: args.purposeSuffix,
216
230
  destinationChainID: args.destinationChainID,
217
231
  destinationAddress: args.destinationAddress,
218
- extraJSON,
232
+ extraJSON: {
233
+ signRequestKind: EIP712_SIGN_REQUEST_KIND,
234
+ eip712
235
+ },
219
236
  expiryDate: args.expiryDate,
220
- legs: [
221
- {
222
- msgHash: msgHashNo0x(digest),
223
- msgRaw: eip712MsgRawHex(typedData, delivery),
224
- destinationAddress: args.destinationAddress,
225
- signatureText: eip712SignatureText(typedData.domain, typedData.primaryType),
226
- audit: {
227
- kind: "EIP712",
228
- primaryType: typedData.primaryType,
229
- deliveryKind: delivery.kind,
230
- ...args.audit ?? {}
231
- },
232
- feeSnapshot: {}
233
- }
234
- ]
237
+ legs
235
238
  });
236
239
  }
237
240
  var PAYLOAD_SIGN_ED25519_REQUEST_KIND = "payload_sign_ed25519";
@@ -2894,28 +2897,32 @@ async function buildEvmMultisignBodyUniswapV4LimitOrderBatch(args) {
2894
2897
  quoteResponse: args.fullLimitQuote,
2895
2898
  signatureHex: "0x"
2896
2899
  });
2897
- return buildEip712MultisignBody({
2900
+ return buildEip712Multisign({
2898
2901
  keyGen: args.keyGen,
2899
2902
  purposeText: args.purposeText,
2900
2903
  destinationChainID: String(UNISWAP_LIMIT_ORDER_CHAIN_ID),
2901
2904
  destinationAddress: PERMIT2_ADDRESS,
2902
- typedData,
2903
- delivery: {
2904
- kind: "uniswapx_limit_order",
2905
- chainId: UNISWAP_LIMIT_ORDER_CHAIN_ID,
2906
- swapper: getAddress(args.swapper),
2907
- submitBodyTemplate: submitTemplate,
2908
- quoteResponse: args.fullLimitQuote,
2909
- uniswapApiKey: args.uniswapApiKey,
2910
- tradeApiBaseUrl: args.tradeApiBaseUrl ?? "https://trade-api.gateway.uniswap.org/v1"
2911
- },
2912
- audit: {
2913
- protocol: "uniswap-v4",
2914
- action: "limitOrder",
2915
- routing: args.fullLimitQuote.routing ?? "LIMIT_ORDER",
2916
- orderType: "Limit",
2917
- primaryType: typedData.primaryType
2918
- },
2905
+ legs: [
2906
+ {
2907
+ typedData,
2908
+ delivery: {
2909
+ kind: "uniswapx_limit_order",
2910
+ chainId: UNISWAP_LIMIT_ORDER_CHAIN_ID,
2911
+ swapper: getAddress(args.swapper),
2912
+ submitBodyTemplate: submitTemplate,
2913
+ quoteResponse: args.fullLimitQuote,
2914
+ uniswapApiKey: args.uniswapApiKey,
2915
+ tradeApiBaseUrl: args.tradeApiBaseUrl ?? "https://trade-api.gateway.uniswap.org/v1"
2916
+ },
2917
+ audit: {
2918
+ protocol: "uniswap-v4",
2919
+ action: "limitOrder",
2920
+ routing: args.fullLimitQuote.routing ?? "LIMIT_ORDER",
2921
+ orderType: "Limit",
2922
+ primaryType: typedData.primaryType
2923
+ }
2924
+ }
2925
+ ],
2919
2926
  expiryDate: args.expiryDate
2920
2927
  });
2921
2928
  }
@@ -3428,6 +3435,6 @@ var curveDao = {
3428
3435
  registerProtocolModule(uniswapV4ProtocolModule);
3429
3436
  registerProtocolModule(curveDaoProtocolModule);
3430
3437
 
3431
- export { COINGECKO_PLATFORM_BY_CHAIN_ID, DEFAULT_DEFI_MULTISIGN_EXPIRY_SECONDS, DEFI_PROTOCOLS_WITH_30MIN_EXPIRY, EIP712_SIGN_REQUEST_KIND, NEAR_CHAIN_CATEGORY, PAYLOAD_SIGN_ED25519_REQUEST_KIND, SOLANA_CHAIN_CATEGORY, approveStepsToEvmTxSteps, buildConditionalErc20ApproveSteps, buildEip712MultisignBody, buildEvmMultisignBatch, buildPayloadSignEd25519MultisignBody, coingeckoPlatformForChainId, coreChainCategoryModule, curveDao, curveDaoProtocolModule, defiMultisignExpiryUnixSeconds, evmChainCategoryModule, finalizeMultisign, getAaveGraphqlProxyUrl, getActionsByChainCategory, getCoingeckoProxyUrl, getEulerGraphqlProxyUrl, getJsonViaOptionalProxy, getMapleGraphqlProxyUrl, getMorphoGraphqlProxyUrl, getMorphoMidnightRestProxyUrl, getProtocolModule, getProtocolModules, isEvmNativeToken, matchEvmTokenKind, mergePurposeText, nearChainCategoryModule, normalizeCurveRouterAmountString, normalizeHumanDecimalAmount, parseEvmChainIdToNumber, postJsonViaOptionalProxy, publicClientForRpc, registerProtocolModule, resolveErc20Decimals, routerSwapGasLimitFromEstimate, setAaveGraphqlProxyUrl, setCoingeckoProxyUrl, setEulerGraphqlProxyUrl, setMapleGraphqlProxyUrl, setMorphoGraphqlProxyUrl, setMorphoMidnightRestProxyUrl, solanaChainCategoryModule, uniswapV4, uniswapV4ProtocolModule };
3438
+ export { COINGECKO_PLATFORM_BY_CHAIN_ID, DEFAULT_DEFI_MULTISIGN_EXPIRY_SECONDS, DEFI_PROTOCOLS_WITH_30MIN_EXPIRY, EIP712_SIGN_REQUEST_KIND, NEAR_CHAIN_CATEGORY, PAYLOAD_SIGN_ED25519_REQUEST_KIND, SOLANA_CHAIN_CATEGORY, approveStepsToEvmTxSteps, buildConditionalErc20ApproveSteps, buildEip712Multisign, buildEvmMultisignBatch, buildPayloadSignEd25519MultisignBody, coingeckoPlatformForChainId, coreChainCategoryModule, curveDao, curveDaoProtocolModule, defiMultisignExpiryUnixSeconds, evmChainCategoryModule, finalizeMultisign, getAaveGraphqlProxyUrl, getActionsByChainCategory, getCoingeckoProxyUrl, getEulerGraphqlProxyUrl, getJsonViaOptionalProxy, getMapleGraphqlProxyUrl, getMorphoGraphqlProxyUrl, getMorphoMidnightRestProxyUrl, getProtocolModule, getProtocolModules, isEvmNativeToken, matchEvmTokenKind, mergePurposeText, nearChainCategoryModule, normalizeCurveRouterAmountString, normalizeHumanDecimalAmount, parseEvmChainIdToNumber, postJsonViaOptionalProxy, publicClientForRpc, registerProtocolModule, resolveErc20Decimals, routerSwapGasLimitFromEstimate, setAaveGraphqlProxyUrl, setCoingeckoProxyUrl, setEulerGraphqlProxyUrl, setMapleGraphqlProxyUrl, setMorphoGraphqlProxyUrl, setMorphoMidnightRestProxyUrl, solanaChainCategoryModule, uniswapV4, uniswapV4ProtocolModule };
3432
3439
  //# sourceMappingURL=index.js.map
3433
3440
  //# sourceMappingURL=index.js.map