@continuumdao/ctm-mpc-defi 0.2.18 → 0.2.20
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 +185 -56
- package/dist/agent/catalog.cjs.map +1 -1
- package/dist/agent/catalog.d.ts +696 -633
- package/dist/agent/catalog.js +183 -57
- package/dist/agent/catalog.js.map +1 -1
- package/dist/agent/skills/hyperliquid/SKILL.md +24 -20
- package/dist/chains/evm/index.cjs +1 -1
- package/dist/chains/evm/index.cjs.map +1 -1
- package/dist/chains/evm/index.js +1 -1
- package/dist/chains/evm/index.js.map +1 -1
- package/dist/core/index.cjs +70 -1
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.ts +35 -2
- package/dist/core/index.js +69 -2
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +69 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +69 -3
- package/dist/index.js.map +1 -1
- package/dist/protocols/evm/aave-v4/index.cjs +1 -1
- package/dist/protocols/evm/aave-v4/index.cjs.map +1 -1
- package/dist/protocols/evm/aave-v4/index.js +1 -1
- package/dist/protocols/evm/aave-v4/index.js.map +1 -1
- package/dist/protocols/evm/circle-cctp/index.cjs +1 -1
- package/dist/protocols/evm/circle-cctp/index.cjs.map +1 -1
- package/dist/protocols/evm/circle-cctp/index.js +1 -1
- package/dist/protocols/evm/circle-cctp/index.js.map +1 -1
- package/dist/protocols/evm/curve-dao/index.cjs +1 -1
- package/dist/protocols/evm/curve-dao/index.cjs.map +1 -1
- package/dist/protocols/evm/curve-dao/index.d.ts +1 -1
- package/dist/protocols/evm/curve-dao/index.js +1 -1
- package/dist/protocols/evm/curve-dao/index.js.map +1 -1
- package/dist/protocols/evm/ethena/index.cjs +1 -1
- package/dist/protocols/evm/ethena/index.cjs.map +1 -1
- package/dist/protocols/evm/ethena/index.js +1 -1
- package/dist/protocols/evm/ethena/index.js.map +1 -1
- package/dist/protocols/evm/euler-v2/index.cjs +1 -1
- package/dist/protocols/evm/euler-v2/index.cjs.map +1 -1
- package/dist/protocols/evm/euler-v2/index.js +1 -1
- package/dist/protocols/evm/euler-v2/index.js.map +1 -1
- package/dist/protocols/evm/gmx/index.cjs +50 -22
- package/dist/protocols/evm/gmx/index.cjs.map +1 -1
- package/dist/protocols/evm/gmx/index.d.ts +20 -6
- package/dist/protocols/evm/gmx/index.js +49 -23
- package/dist/protocols/evm/gmx/index.js.map +1 -1
- package/dist/protocols/evm/hyperliquid/index.cjs +462 -2
- package/dist/protocols/evm/hyperliquid/index.cjs.map +1 -1
- package/dist/protocols/evm/hyperliquid/index.d.ts +189 -2
- package/dist/protocols/evm/hyperliquid/index.js +442 -4
- package/dist/protocols/evm/hyperliquid/index.js.map +1 -1
- package/dist/protocols/evm/lido/index.cjs +1 -1
- package/dist/protocols/evm/lido/index.cjs.map +1 -1
- package/dist/protocols/evm/lido/index.js +1 -1
- package/dist/protocols/evm/lido/index.js.map +1 -1
- package/dist/protocols/evm/maple/index.cjs +1 -1
- package/dist/protocols/evm/maple/index.cjs.map +1 -1
- package/dist/protocols/evm/maple/index.js +1 -1
- package/dist/protocols/evm/maple/index.js.map +1 -1
- package/dist/protocols/evm/morpho/index.cjs +1 -1
- package/dist/protocols/evm/morpho/index.cjs.map +1 -1
- package/dist/protocols/evm/morpho/index.js +1 -1
- package/dist/protocols/evm/morpho/index.js.map +1 -1
- package/dist/protocols/evm/permit2/index.cjs +202 -0
- package/dist/protocols/evm/permit2/index.cjs.map +1 -0
- package/dist/protocols/evm/permit2/index.d.ts +43 -0
- package/dist/protocols/evm/permit2/index.js +199 -0
- package/dist/protocols/evm/permit2/index.js.map +1 -0
- package/dist/protocols/evm/sky/index.cjs +1 -1
- package/dist/protocols/evm/sky/index.cjs.map +1 -1
- package/dist/protocols/evm/sky/index.js +1 -1
- package/dist/protocols/evm/sky/index.js.map +1 -1
- package/dist/protocols/evm/uniswap-v4/index.cjs +1 -1
- package/dist/protocols/evm/uniswap-v4/index.cjs.map +1 -1
- package/dist/protocols/evm/uniswap-v4/index.js +1 -1
- package/dist/protocols/evm/uniswap-v4/index.js.map +1 -1
- package/package.json +7 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { C as ChainCategory, a as ChainSupportContext, E as EvmTokenKind, K as KeyGenSubset, b as KeyGenSubsetForPermit, M as MultisignBuildResult, c as MultisignCommonArgs, N as NearTokenKind, P as ParamDoc, d as ProtocolActionDescriptor, e as ProtocolModule, S as SolanaTokenKind, T as TokenRef } from './types-BfjWdw1j.js';
|
|
2
2
|
export { getClientIdFromKeyGenResult as firstClientIdFromKeyGen } from '@continuumdao/continuum-node-sdk';
|
|
3
|
-
export { getAaveGraphqlProxyUrl, getCoingeckoProxyUrl, getEulerGraphqlProxyUrl, getMapleGraphqlProxyUrl, getMorphoGraphqlProxyUrl, mergePurposeText, postJsonViaOptionalProxy, setAaveGraphqlProxyUrl, setCoingeckoProxyUrl, setEulerGraphqlProxyUrl, setMapleGraphqlProxyUrl, setMorphoGraphqlProxyUrl } from './core/index.js';
|
|
3
|
+
export { BuildEip712MultisignBodyArgs, EIP712_SIGN_REQUEST_KIND, Eip712MultisignDelivery, Eip712TypedDataField, Eip712TypedDataPayload, buildEip712MultisignBody, getAaveGraphqlProxyUrl, getCoingeckoProxyUrl, getEulerGraphqlProxyUrl, getMapleGraphqlProxyUrl, getMorphoGraphqlProxyUrl, mergePurposeText, postJsonViaOptionalProxy, setAaveGraphqlProxyUrl, setCoingeckoProxyUrl, setEulerGraphqlProxyUrl, setMapleGraphqlProxyUrl, setMorphoGraphqlProxyUrl } from './core/index.js';
|
|
4
4
|
export { C as ChainCategoryBuildInput, a as ChainCategoryModule, M as MultisignLeg, c as coreChainCategoryModule, f as finalizeMultisign } from './envelope-CpBUh9eP.js';
|
|
5
5
|
export { g as getActionsByChainCategory, a as getProtocolModule, b as getProtocolModules, r as registerProtocolModule } from './registry-Bv5o37_w.js';
|
|
6
6
|
export { E as EvmChainDetail, a as EvmProtocolContext, b as EvmTxStep, i as isEvmNativeToken, m as matchEvmTokenKind } from './types-DUeNJLr9.js';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getClientIdFromKeyGenResult, gasLimitFromEstimateAndChainConfig, fetchChainFeeParams, gweiToDecimalString, proposalTxParamsToFeeSnapshot, alignEip1559FeesWithLatestBase, nodeFetchWithReadAuth } from '@continuumdao/continuum-node-sdk';
|
|
2
2
|
export { getClientIdFromKeyGenResult as firstClientIdFromKeyGen } from '@continuumdao/continuum-node-sdk';
|
|
3
|
-
import { parseAbi, parseAbiItem, getAddress, zeroAddress, defineChain, createPublicClient, http, parseGwei, serializeTransaction, keccak256, parseUnits, formatUnits, encodeFunctionData, decodeFunctionData, erc20Abi, isAddress } from 'viem';
|
|
3
|
+
import { parseAbi, parseAbiItem, hashTypedData, getAddress, zeroAddress, defineChain, createPublicClient, http, parseGwei, serializeTransaction, keccak256, parseUnits, formatUnits, encodeFunctionData, stringToHex, decodeFunctionData, erc20Abi, isAddress } from 'viem';
|
|
4
4
|
|
|
5
5
|
// src/core/index.ts
|
|
6
6
|
|
|
@@ -35,7 +35,7 @@ function finalizeMultisign(input) {
|
|
|
35
35
|
batchMeta,
|
|
36
36
|
...input.extraJSON ?? {}
|
|
37
37
|
};
|
|
38
|
-
const extraJSON = JSON.stringify(extraPayload);
|
|
38
|
+
const extraJSON = JSON.stringify(extraPayload, (_, v) => typeof v === "bigint" ? v.toString() : v);
|
|
39
39
|
const bodyForSign = {
|
|
40
40
|
keyList,
|
|
41
41
|
pubKey: ph,
|
|
@@ -148,6 +148,72 @@ async function postJsonViaOptionalProxy(args) {
|
|
|
148
148
|
}
|
|
149
149
|
return await r.json();
|
|
150
150
|
}
|
|
151
|
+
var EIP712_SIGN_REQUEST_KIND = "eip712";
|
|
152
|
+
function msgHashNo0x(digest) {
|
|
153
|
+
return digest.startsWith("0x") ? digest.slice(2) : digest;
|
|
154
|
+
}
|
|
155
|
+
function eip712SignatureText(domain, primaryType) {
|
|
156
|
+
return JSON.stringify({
|
|
157
|
+
kind: "EIP-712",
|
|
158
|
+
...typeof domain.name === "string" ? { name: domain.name } : {},
|
|
159
|
+
primaryType
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
function jsonStringifyForAudit(value) {
|
|
163
|
+
return JSON.stringify(value, (_, v) => typeof v === "bigint" ? v.toString() : v);
|
|
164
|
+
}
|
|
165
|
+
function eip712MsgRawHex(typedData, delivery) {
|
|
166
|
+
const envelope = {
|
|
167
|
+
version: 1,
|
|
168
|
+
...typedData,
|
|
169
|
+
delivery
|
|
170
|
+
};
|
|
171
|
+
return stringToHex(jsonStringifyForAudit(envelope));
|
|
172
|
+
}
|
|
173
|
+
function buildEip712MultisignBody(args) {
|
|
174
|
+
const { typedData, delivery } = args;
|
|
175
|
+
const digest = hashTypedData({
|
|
176
|
+
domain: typedData.domain,
|
|
177
|
+
types: typedData.types,
|
|
178
|
+
primaryType: typedData.primaryType,
|
|
179
|
+
message: typedData.message
|
|
180
|
+
});
|
|
181
|
+
const extraJSON = {
|
|
182
|
+
signRequestKind: EIP712_SIGN_REQUEST_KIND,
|
|
183
|
+
eip712: {
|
|
184
|
+
version: 1,
|
|
185
|
+
digest,
|
|
186
|
+
domain: typedData.domain,
|
|
187
|
+
types: typedData.types,
|
|
188
|
+
primaryType: typedData.primaryType,
|
|
189
|
+
message: typedData.message
|
|
190
|
+
},
|
|
191
|
+
delivery
|
|
192
|
+
};
|
|
193
|
+
return finalizeMultisign({
|
|
194
|
+
keyGen: args.keyGen,
|
|
195
|
+
purposeText: args.purposeText,
|
|
196
|
+
purposeSuffix: args.purposeSuffix,
|
|
197
|
+
destinationChainID: args.destinationChainID,
|
|
198
|
+
destinationAddress: args.destinationAddress,
|
|
199
|
+
extraJSON,
|
|
200
|
+
legs: [
|
|
201
|
+
{
|
|
202
|
+
msgHash: msgHashNo0x(digest),
|
|
203
|
+
msgRaw: eip712MsgRawHex(typedData, delivery),
|
|
204
|
+
destinationAddress: args.destinationAddress,
|
|
205
|
+
signatureText: eip712SignatureText(typedData.domain, typedData.primaryType),
|
|
206
|
+
audit: {
|
|
207
|
+
kind: "EIP712",
|
|
208
|
+
primaryType: typedData.primaryType,
|
|
209
|
+
deliveryKind: delivery.kind,
|
|
210
|
+
...args.audit ?? {}
|
|
211
|
+
},
|
|
212
|
+
feeSnapshot: {}
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
});
|
|
216
|
+
}
|
|
151
217
|
function isEvmNativeToken(address) {
|
|
152
218
|
try {
|
|
153
219
|
return getAddress(address) === zeroAddress;
|
|
@@ -2616,6 +2682,6 @@ var curveDao = {
|
|
|
2616
2682
|
registerProtocolModule(uniswapV4ProtocolModule);
|
|
2617
2683
|
registerProtocolModule(curveDaoProtocolModule);
|
|
2618
2684
|
|
|
2619
|
-
export { COINGECKO_PLATFORM_BY_CHAIN_ID, NEAR_CHAIN_CATEGORY, SOLANA_CHAIN_CATEGORY, approveStepsToEvmTxSteps, buildConditionalErc20ApproveSteps, buildEvmMultisignBatch, coingeckoPlatformForChainId, coreChainCategoryModule, curveDao, curveDaoProtocolModule, evmChainCategoryModule, finalizeMultisign, getAaveGraphqlProxyUrl, getActionsByChainCategory, getCoingeckoProxyUrl, getEulerGraphqlProxyUrl, getMapleGraphqlProxyUrl, getMorphoGraphqlProxyUrl, getProtocolModule, getProtocolModules, isEvmNativeToken, matchEvmTokenKind, mergePurposeText, nearChainCategoryModule, normalizeCurveRouterAmountString, normalizeHumanDecimalAmount, parseEvmChainIdToNumber, postJsonViaOptionalProxy, publicClientForRpc, registerProtocolModule, resolveErc20Decimals, routerSwapGasLimitFromEstimate, setAaveGraphqlProxyUrl, setCoingeckoProxyUrl, setEulerGraphqlProxyUrl, setMapleGraphqlProxyUrl, setMorphoGraphqlProxyUrl, solanaChainCategoryModule, uniswapV4, uniswapV4ProtocolModule };
|
|
2685
|
+
export { COINGECKO_PLATFORM_BY_CHAIN_ID, EIP712_SIGN_REQUEST_KIND, NEAR_CHAIN_CATEGORY, SOLANA_CHAIN_CATEGORY, approveStepsToEvmTxSteps, buildConditionalErc20ApproveSteps, buildEip712MultisignBody, buildEvmMultisignBatch, coingeckoPlatformForChainId, coreChainCategoryModule, curveDao, curveDaoProtocolModule, evmChainCategoryModule, finalizeMultisign, getAaveGraphqlProxyUrl, getActionsByChainCategory, getCoingeckoProxyUrl, getEulerGraphqlProxyUrl, getMapleGraphqlProxyUrl, getMorphoGraphqlProxyUrl, getProtocolModule, getProtocolModules, isEvmNativeToken, matchEvmTokenKind, mergePurposeText, nearChainCategoryModule, normalizeCurveRouterAmountString, normalizeHumanDecimalAmount, parseEvmChainIdToNumber, postJsonViaOptionalProxy, publicClientForRpc, registerProtocolModule, resolveErc20Decimals, routerSwapGasLimitFromEstimate, setAaveGraphqlProxyUrl, setCoingeckoProxyUrl, setEulerGraphqlProxyUrl, setMapleGraphqlProxyUrl, setMorphoGraphqlProxyUrl, solanaChainCategoryModule, uniswapV4, uniswapV4ProtocolModule };
|
|
2620
2686
|
//# sourceMappingURL=index.js.map
|
|
2621
2687
|
//# sourceMappingURL=index.js.map
|