@continuumdao/ctm-mpc-defi 0.2.1 → 0.2.3
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 +96 -25
- package/dist/agent/catalog.cjs.map +1 -1
- package/dist/agent/catalog.d.ts +27 -1
- package/dist/agent/catalog.js +95 -26
- package/dist/agent/catalog.js.map +1 -1
- package/dist/agent/skills/curve-dao/SKILL.md +2 -1
- package/dist/chains/evm/index.cjs +54 -0
- package/dist/chains/evm/index.cjs.map +1 -1
- package/dist/chains/evm/index.d.ts +13 -1
- package/dist/chains/evm/index.js +52 -2
- package/dist/chains/evm/index.js.map +1 -1
- package/dist/core/index.cjs +64 -0
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.ts +20 -1
- package/dist/core/index.js +56 -1
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +165 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +154 -16
- package/dist/index.js.map +1 -1
- package/dist/protocols/evm/aave-v4/index.cjs +766 -6
- package/dist/protocols/evm/aave-v4/index.cjs.map +1 -1
- package/dist/protocols/evm/aave-v4/index.d.ts +417 -1
- package/dist/protocols/evm/aave-v4/index.js +741 -8
- package/dist/protocols/evm/aave-v4/index.js.map +1 -1
- package/dist/protocols/evm/curve-dao/index.cjs +268 -21
- package/dist/protocols/evm/curve-dao/index.cjs.map +1 -1
- package/dist/protocols/evm/curve-dao/index.d.ts +74 -9
- package/dist/protocols/evm/curve-dao/index.js +262 -23
- package/dist/protocols/evm/curve-dao/index.js.map +1 -1
- package/dist/protocols/evm/ethena/index.cjs +104 -0
- package/dist/protocols/evm/ethena/index.cjs.map +1 -1
- package/dist/protocols/evm/ethena/index.d.ts +46 -1
- package/dist/protocols/evm/ethena/index.js +99 -1
- package/dist/protocols/evm/ethena/index.js.map +1 -1
- package/dist/protocols/evm/euler-v2/index.cjs +2334 -37
- package/dist/protocols/evm/euler-v2/index.cjs.map +1 -1
- package/dist/protocols/evm/euler-v2/index.d.ts +464 -1
- package/dist/protocols/evm/euler-v2/index.js +2286 -39
- package/dist/protocols/evm/euler-v2/index.js.map +1 -1
- package/dist/protocols/evm/lido/index.cjs +110 -0
- package/dist/protocols/evm/lido/index.cjs.map +1 -1
- package/dist/protocols/evm/lido/index.d.ts +33 -2
- package/dist/protocols/evm/lido/index.js +107 -2
- package/dist/protocols/evm/lido/index.js.map +1 -1
- package/dist/protocols/evm/maple/index.cjs +83 -0
- package/dist/protocols/evm/maple/index.cjs.map +1 -1
- package/dist/protocols/evm/maple/index.d.ts +22 -1
- package/dist/protocols/evm/maple/index.js +82 -1
- package/dist/protocols/evm/maple/index.js.map +1 -1
- package/dist/protocols/evm/sky/index.cjs +217 -0
- package/dist/protocols/evm/sky/index.cjs.map +1 -1
- package/dist/protocols/evm/sky/index.d.ts +56 -1
- package/dist/protocols/evm/sky/index.js +210 -2
- package/dist/protocols/evm/sky/index.js.map +1 -1
- package/package.json +3 -3
package/dist/core/index.js
CHANGED
|
@@ -86,6 +86,61 @@ function getActionsByChainCategory(category) {
|
|
|
86
86
|
return modules.filter((m) => m.chainCategory === category).flatMap((m) => m.actions);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
// src/core/defiProxy.ts
|
|
90
|
+
var aaveGraphqlProxyUrl;
|
|
91
|
+
var eulerGraphqlProxyUrl;
|
|
92
|
+
var mapleGraphqlProxyUrl;
|
|
93
|
+
var coingeckoProxyUrl;
|
|
94
|
+
function setAaveGraphqlProxyUrl(url) {
|
|
95
|
+
aaveGraphqlProxyUrl = url?.trim() || void 0;
|
|
96
|
+
}
|
|
97
|
+
function getAaveGraphqlProxyUrl() {
|
|
98
|
+
return aaveGraphqlProxyUrl;
|
|
99
|
+
}
|
|
100
|
+
function setEulerGraphqlProxyUrl(url) {
|
|
101
|
+
eulerGraphqlProxyUrl = url?.trim() || void 0;
|
|
102
|
+
}
|
|
103
|
+
function getEulerGraphqlProxyUrl() {
|
|
104
|
+
return eulerGraphqlProxyUrl;
|
|
105
|
+
}
|
|
106
|
+
function setMapleGraphqlProxyUrl(url) {
|
|
107
|
+
mapleGraphqlProxyUrl = url?.trim() || void 0;
|
|
108
|
+
}
|
|
109
|
+
function getMapleGraphqlProxyUrl() {
|
|
110
|
+
return mapleGraphqlProxyUrl;
|
|
111
|
+
}
|
|
112
|
+
function setCoingeckoProxyUrl(url) {
|
|
113
|
+
coingeckoProxyUrl = url?.trim() || void 0;
|
|
114
|
+
}
|
|
115
|
+
function getCoingeckoProxyUrl() {
|
|
116
|
+
return coingeckoProxyUrl;
|
|
117
|
+
}
|
|
118
|
+
async function postJsonViaOptionalProxy(args) {
|
|
119
|
+
const proxy = args.proxyUrl?.trim();
|
|
120
|
+
if (proxy) {
|
|
121
|
+
const r2 = await fetch(proxy, {
|
|
122
|
+
method: "POST",
|
|
123
|
+
headers: { "content-type": "application/json" },
|
|
124
|
+
body: JSON.stringify(args.proxyEnvelope ?? args.body)
|
|
125
|
+
});
|
|
126
|
+
if (!r2.ok) {
|
|
127
|
+
const t = await r2.text().catch(() => "");
|
|
128
|
+
throw new Error(t ? `Proxy HTTP ${r2.status}: ${t.slice(0, 200)}` : `Proxy HTTP ${r2.status}`);
|
|
129
|
+
}
|
|
130
|
+
return await r2.json();
|
|
131
|
+
}
|
|
132
|
+
const r = await fetch(args.directUrl, {
|
|
133
|
+
method: "POST",
|
|
134
|
+
headers: { "content-type": "application/json" },
|
|
135
|
+
body: JSON.stringify(args.body)
|
|
136
|
+
});
|
|
137
|
+
if (!r.ok) {
|
|
138
|
+
const t = await r.text().catch(() => "");
|
|
139
|
+
throw new Error(t ? `HTTP ${r.status}: ${t.slice(0, 200)}` : `HTTP ${r.status}`);
|
|
140
|
+
}
|
|
141
|
+
return await r.json();
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export { coreChainCategoryModule, finalizeMultisign, getAaveGraphqlProxyUrl, getActionsByChainCategory, getCoingeckoProxyUrl, getEulerGraphqlProxyUrl, getMapleGraphqlProxyUrl, getProtocolModule, getProtocolModules, mergePurposeText, postJsonViaOptionalProxy, registerProtocolModule, setAaveGraphqlProxyUrl, setCoingeckoProxyUrl, setEulerGraphqlProxyUrl, setMapleGraphqlProxyUrl };
|
|
90
145
|
//# sourceMappingURL=index.js.map
|
|
91
146
|
//# sourceMappingURL=index.js.map
|
package/dist/core/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/purpose.ts","../../src/core/envelope.ts","../../src/core/registry.ts"],"names":[],"mappings":";;;;;;AACO,SAAS,gBAAA,CAAiB,aAAqB,aAAA,EAAgC;AACpF,EAAA,MAAM,CAAA,GAAI,YAAY,IAAA,EAAK;AAC3B,EAAA,MAAM,MAAA,GAAA,CAAU,aAAA,IAAiB,EAAA,EAAI,IAAA,EAAK;AAC1C,EAAA,IAAI,CAAC,QAAQ,OAAO,CAAA;AACpB,EAAA,OAAO,CAAA,GAAI,GAAG,CAAC;;AAAA,EAAO,MAAM,CAAA,CAAA,GAAK,MAAA;AACnC;AC8BO,SAAS,kBAAkB,KAAA,EAAsD;AACtF,EAAA,MAAM,EAAE,MAAA,EAAQ,kBAAA,EAAoB,IAAA,EAAK,GAAI,KAAA;AAC7C,EAAA,IAAI,IAAA,CAAK,WAAW,CAAA,EAAG;AACrB,IAAA,MAAM,IAAI,MAAM,6CAA6C,CAAA;AAAA,EAC/D;AAEA,EAAA,MAAM,EAAA,GAAA,CAAM,MAAA,CAAO,SAAA,IAAa,EAAA,EAAI,IAAA,EAAK;AACzC,EAAA,IAAI,CAAC,EAAA,EAAI,MAAM,IAAI,MAAM,uCAAuC,CAAA;AAEhE,EAAA,MAAM,OAAA,GAAU,MAAA,CAAO,OAAA,IAAW,EAAC;AACnC,EAAA,MAAM,QAAA,GAAW,4BAA4B,MAAM,CAAA;AACnD,EAAA,MAAM,KAAA,GAAQ,KAAK,CAAC,CAAA;AAE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AAA,CAAQ,CAAC,CAAA,KAAM,CAAA,CAAE,OAAO,CAAA;AACrF","file":"index.js","sourcesContent":["/** Merge user purpose text with an optional batch / protocol suffix. */\nexport function mergePurposeText(purposeText: string, purposeSuffix?: string): string {\n const t = purposeText.trim()\n const suffix = (purposeSuffix ?? '').trim()\n if (!suffix) return t\n return t ? `${t}\\n\\n${suffix}` : suffix\n}\n","import type { ChainCategory, MultisignBuildResult, KeyGenSubset } from './types.js'\nimport { getClientIdFromKeyGenResult } from '@continuumdao/continuum-node-sdk'\nimport { mergePurposeText } from './purpose.js'\n\nexport interface MultisignLeg {\n msgHash: string\n msgRaw: string\n destinationAddress: string\n signatureText: string\n audit: Record<string, unknown>\n feeSnapshot: Record<string, unknown>\n proposalTxParams?: Record<string, unknown>\n /** Payable value wei string for first leg only when relevant */\n valueWei?: bigint\n}\n\nexport interface ChainCategoryBuildInput {\n keyGen: KeyGenSubset\n purposeText: string\n purposeSuffix?: string\n destinationChainID: string\n legs: MultisignLeg[]\n extraJSON?: Record<string, unknown>\n /** Top-level destination address (first leg destination if omitted) */\n destinationAddress?: string\n}\n\nexport interface ChainCategoryModule {\n category: ChainCategory\n finalizeMultisign(input: ChainCategoryBuildInput): MultisignBuildResult\n}\n\n/**\n * Assemble mpc-auth `bodyForSign` from category-built legs.\n * Supports single-tx and batch (messageHashes / messageRawBatch / proposalTxParams).\n */\nexport function finalizeMultisign(input: ChainCategoryBuildInput): MultisignBuildResult {\n const { keyGen, destinationChainID, legs } = input\n if (legs.length === 0) {\n throw new Error('finalizeMultisign requires at least one leg')\n }\n\n const ph = (keyGen.pubkeyhex ?? '').trim()\n if (!ph) throw new Error('keyGen pubKey (pubkeyhex) is required')\n\n const keyList = keyGen.keylist ?? []\n const clientId = getClientIdFromKeyGenResult(keyGen)\n const first = legs[0]!\n\n const messageHashes = legs.map((l) => l.msgHash)\n const messageRawBatch = legs.map((l) => l.msgRaw)\n const batchMeta = legs.map((l) => ({\n destinationAddress: l.destinationAddress,\n signatureText: l.signatureText,\n ...l.audit,\n }))\n\n const proposalTxParams = legs\n .map((l) => l.proposalTxParams)\n .filter((p): p is Record<string, unknown> => p != null && typeof p === 'object')\n\n const extraPayload: Record<string, unknown> = {\n batchMeta,\n ...(input.extraJSON ?? {}),\n }\n const extraJSON = JSON.stringify(extraPayload)\n\n const bodyForSign: Record<string, unknown> = {\n keyList,\n pubKey: ph,\n msgHash: messageHashes[0],\n msgRaw: first.msgRaw,\n destinationChainID,\n destinationAddress: input.destinationAddress ?? first.destinationAddress,\n extraJSON,\n signatureText: first.signatureText,\n purpose: mergePurposeText(input.purposeText, input.purposeSuffix),\n ...first.feeSnapshot,\n }\n\n if (legs.length > 1) {\n bodyForSign.messageHashes = messageHashes\n bodyForSign.messageRawBatch = messageRawBatch\n }\n\n if (proposalTxParams.length > 0) {\n bodyForSign.proposalTxParams = proposalTxParams\n }\n\n const valueWei = first.valueWei\n if (valueWei != null && valueWei > 0n) {\n bodyForSign.value = valueWei.toString()\n }\n\n if (clientId) bodyForSign.clientId = clientId\n\n return { bodyForSign, messageToSign: JSON.stringify(bodyForSign) }\n}\n\nexport const coreChainCategoryModule: ChainCategoryModule = {\n category: 'evm',\n finalizeMultisign,\n}\n","import type { ProtocolModule } from './types.js'\n\nconst modules: ProtocolModule[] = []\n\nexport function registerProtocolModule(mod: ProtocolModule): void {\n const existing = modules.findIndex((m) => m.id === mod.id)\n if (existing >= 0) {\n modules[existing] = mod\n } else {\n modules.push(mod)\n }\n}\n\nexport function getProtocolModules(): readonly ProtocolModule[] {\n return modules\n}\n\nexport function getProtocolModule(id: string): ProtocolModule | undefined {\n return modules.find((m) => m.id === id)\n}\n\nexport function getActionsByChainCategory(category: string): ProtocolModule['actions'] {\n return modules.filter((m) => m.chainCategory === category).flatMap((m) => m.actions)\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/core/purpose.ts","../../src/core/envelope.ts","../../src/core/registry.ts","../../src/core/defiProxy.ts"],"names":["r"],"mappings":";;;;;;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AW;AAAA,IACpC,MAAA,EAAQ,MAAA;AAAA,IACR,OAAA,EAAS,EAAC,cAAA,EAAgB,kBAAA,EAAkB;AAAA,IAC5C,IAAA,EAAM,IAAA,CAAK,SAAA,CAAU,IAAA,CAAK,IAAI;AAAA,GAC/B,CAAA;AACD,EAAA,IAAI,CAAC,EAAE,EAAA,EAAI;AACT,IAAA,MAAM,IAAI,MAAM,CAAA,CAAE,MAAK,CAAE,KAAA,CAAM,MAAM,EAAE,CAAA;AACvC,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,GAAI,CAAA,KAAA,EAAQ,CAAA,CAAE,MAAM,CAAA,EAAA,EAAK,CAAA,CAAE,KAAA,CAAM,CAAA,EAAG,GAAG,CAAC,CAAA,CAAA,GAAK,CAAA,KAAA,EAAQ,CAAA,CAAE,MAAM,CAAA,CAAE,CAAA;AAAA,EACjF;AACA,EAAA,OAAQ,MAAM,EAAE,IAAA,EAAK;AACvB","file":"index.js","sourcesContent":["/** Merge user purpose text with an optional batch / protocol suffix. */\nexport function mergePurposeText(purposeText: string, purposeSuffix?: string): string {\n const t = purposeText.trim()\n const suffix = (purposeSuffix ?? '').trim()\n if (!suffix) return t\n return t ? `${t}\\n\\n${suffix}` : suffix\n}\n","import type { ChainCategory, MultisignBuildResult, KeyGenSubset } from './types.js'\nimport { getClientIdFromKeyGenResult } from '@continuumdao/continuum-node-sdk'\nimport { mergePurposeText } from './purpose.js'\n\nexport interface MultisignLeg {\n msgHash: string\n msgRaw: string\n destinationAddress: string\n signatureText: string\n audit: Record<string, unknown>\n feeSnapshot: Record<string, unknown>\n proposalTxParams?: Record<string, unknown>\n /** Payable value wei string for first leg only when relevant */\n valueWei?: bigint\n}\n\nexport interface ChainCategoryBuildInput {\n keyGen: KeyGenSubset\n purposeText: string\n purposeSuffix?: string\n destinationChainID: string\n legs: MultisignLeg[]\n extraJSON?: Record<string, unknown>\n /** Top-level destination address (first leg destination if omitted) */\n destinationAddress?: string\n}\n\nexport interface ChainCategoryModule {\n category: ChainCategory\n finalizeMultisign(input: ChainCategoryBuildInput): MultisignBuildResult\n}\n\n/**\n * Assemble mpc-auth `bodyForSign` from category-built legs.\n * Supports single-tx and batch (messageHashes / messageRawBatch / proposalTxParams).\n */\nexport function finalizeMultisign(input: ChainCategoryBuildInput): MultisignBuildResult {\n const { keyGen, destinationChainID, legs } = input\n if (legs.length === 0) {\n throw new Error('finalizeMultisign requires at least one leg')\n }\n\n const ph = (keyGen.pubkeyhex ?? '').trim()\n if (!ph) throw new Error('keyGen pubKey (pubkeyhex) is required')\n\n const keyList = keyGen.keylist ?? []\n const clientId = getClientIdFromKeyGenResult(keyGen)\n const first = legs[0]!\n\n const messageHashes = legs.map((l) => l.msgHash)\n const messageRawBatch = legs.map((l) => l.msgRaw)\n const batchMeta = legs.map((l) => ({\n destinationAddress: l.destinationAddress,\n signatureText: l.signatureText,\n ...l.audit,\n }))\n\n const proposalTxParams = legs\n .map((l) => l.proposalTxParams)\n .filter((p): p is Record<string, unknown> => p != null && typeof p === 'object')\n\n const extraPayload: Record<string, unknown> = {\n batchMeta,\n ...(input.extraJSON ?? {}),\n }\n const extraJSON = JSON.stringify(extraPayload)\n\n const bodyForSign: Record<string, unknown> = {\n keyList,\n pubKey: ph,\n msgHash: messageHashes[0],\n msgRaw: first.msgRaw,\n destinationChainID,\n destinationAddress: input.destinationAddress ?? first.destinationAddress,\n extraJSON,\n signatureText: first.signatureText,\n purpose: mergePurposeText(input.purposeText, input.purposeSuffix),\n ...first.feeSnapshot,\n }\n\n if (legs.length > 1) {\n bodyForSign.messageHashes = messageHashes\n bodyForSign.messageRawBatch = messageRawBatch\n }\n\n if (proposalTxParams.length > 0) {\n bodyForSign.proposalTxParams = proposalTxParams\n }\n\n const valueWei = first.valueWei\n if (valueWei != null && valueWei > 0n) {\n bodyForSign.value = valueWei.toString()\n }\n\n if (clientId) bodyForSign.clientId = clientId\n\n return { bodyForSign, messageToSign: JSON.stringify(bodyForSign) }\n}\n\nexport const coreChainCategoryModule: ChainCategoryModule = {\n category: 'evm',\n finalizeMultisign,\n}\n","import type { ProtocolModule } from './types.js'\n\nconst modules: ProtocolModule[] = []\n\nexport function registerProtocolModule(mod: ProtocolModule): void {\n const existing = modules.findIndex((m) => m.id === mod.id)\n if (existing >= 0) {\n modules[existing] = mod\n } else {\n modules.push(mod)\n }\n}\n\nexport function getProtocolModules(): readonly ProtocolModule[] {\n return modules\n}\n\nexport function getProtocolModule(id: string): ProtocolModule | undefined {\n return modules.find((m) => m.id === id)\n}\n\nexport function getActionsByChainCategory(category: string): ProtocolModule['actions'] {\n return modules.filter((m) => m.chainCategory === category).flatMap((m) => m.actions)\n}\n","/**\n * Optional browser → Next.js API proxy paths for DeFi upstream calls.\n * Set once from continuumdao-node-app client bootstrap.\n */\n\nlet aaveGraphqlProxyUrl: string | undefined\nlet eulerGraphqlProxyUrl: string | undefined\nlet mapleGraphqlProxyUrl: string | undefined\nlet coingeckoProxyUrl: string | undefined\n\nexport function setAaveGraphqlProxyUrl(url: string | undefined): void {\n aaveGraphqlProxyUrl = url?.trim() || undefined\n}\n\nexport function getAaveGraphqlProxyUrl(): string | undefined {\n return aaveGraphqlProxyUrl\n}\n\nexport function setEulerGraphqlProxyUrl(url: string | undefined): void {\n eulerGraphqlProxyUrl = url?.trim() || undefined\n}\n\nexport function getEulerGraphqlProxyUrl(): string | undefined {\n return eulerGraphqlProxyUrl\n}\n\nexport function setMapleGraphqlProxyUrl(url: string | undefined): void {\n mapleGraphqlProxyUrl = url?.trim() || undefined\n}\n\nexport function getMapleGraphqlProxyUrl(): string | undefined {\n return mapleGraphqlProxyUrl\n}\n\nexport function setCoingeckoProxyUrl(url: string | undefined): void {\n coingeckoProxyUrl = url?.trim() || undefined\n}\n\nexport function getCoingeckoProxyUrl(): string | undefined {\n return coingeckoProxyUrl\n}\n\nexport async function postJsonViaOptionalProxy<T>(args: {\n directUrl: string\n body: unknown\n proxyUrl?: string\n proxyEnvelope?: unknown\n}): Promise<T> {\n const proxy = args.proxyUrl?.trim()\n if (proxy) {\n const r = await fetch(proxy, {\n method: 'POST',\n headers: {'content-type': 'application/json'},\n body: JSON.stringify(args.proxyEnvelope ?? args.body),\n })\n if (!r.ok) {\n const t = await r.text().catch(() => '')\n throw new Error(t ? `Proxy HTTP ${r.status}: ${t.slice(0, 200)}` : `Proxy HTTP ${r.status}`)\n }\n return (await r.json()) as T\n }\n const r = await fetch(args.directUrl, {\n method: 'POST',\n headers: {'content-type': 'application/json'},\n body: JSON.stringify(args.body),\n })\n if (!r.ok) {\n const t = await r.text().catch(() => '')\n throw new Error(t ? `HTTP ${r.status}: ${t.slice(0, 200)}` : `HTTP ${r.status}`)\n }\n return (await r.json()) as T\n}\n"]}
|
package/dist/index.cjs
CHANGED
|
@@ -87,6 +87,61 @@ function getProtocolModule(id) {
|
|
|
87
87
|
function getActionsByChainCategory(category) {
|
|
88
88
|
return modules.filter((m) => m.chainCategory === category).flatMap((m) => m.actions);
|
|
89
89
|
}
|
|
90
|
+
|
|
91
|
+
// src/core/defiProxy.ts
|
|
92
|
+
var aaveGraphqlProxyUrl;
|
|
93
|
+
var eulerGraphqlProxyUrl;
|
|
94
|
+
var mapleGraphqlProxyUrl;
|
|
95
|
+
var coingeckoProxyUrl;
|
|
96
|
+
function setAaveGraphqlProxyUrl(url) {
|
|
97
|
+
aaveGraphqlProxyUrl = url?.trim() || void 0;
|
|
98
|
+
}
|
|
99
|
+
function getAaveGraphqlProxyUrl() {
|
|
100
|
+
return aaveGraphqlProxyUrl;
|
|
101
|
+
}
|
|
102
|
+
function setEulerGraphqlProxyUrl(url) {
|
|
103
|
+
eulerGraphqlProxyUrl = url?.trim() || void 0;
|
|
104
|
+
}
|
|
105
|
+
function getEulerGraphqlProxyUrl() {
|
|
106
|
+
return eulerGraphqlProxyUrl;
|
|
107
|
+
}
|
|
108
|
+
function setMapleGraphqlProxyUrl(url) {
|
|
109
|
+
mapleGraphqlProxyUrl = url?.trim() || void 0;
|
|
110
|
+
}
|
|
111
|
+
function getMapleGraphqlProxyUrl() {
|
|
112
|
+
return mapleGraphqlProxyUrl;
|
|
113
|
+
}
|
|
114
|
+
function setCoingeckoProxyUrl(url) {
|
|
115
|
+
coingeckoProxyUrl = url?.trim() || void 0;
|
|
116
|
+
}
|
|
117
|
+
function getCoingeckoProxyUrl() {
|
|
118
|
+
return coingeckoProxyUrl;
|
|
119
|
+
}
|
|
120
|
+
async function postJsonViaOptionalProxy(args) {
|
|
121
|
+
const proxy = args.proxyUrl?.trim();
|
|
122
|
+
if (proxy) {
|
|
123
|
+
const r2 = await fetch(proxy, {
|
|
124
|
+
method: "POST",
|
|
125
|
+
headers: { "content-type": "application/json" },
|
|
126
|
+
body: JSON.stringify(args.proxyEnvelope ?? args.body)
|
|
127
|
+
});
|
|
128
|
+
if (!r2.ok) {
|
|
129
|
+
const t = await r2.text().catch(() => "");
|
|
130
|
+
throw new Error(t ? `Proxy HTTP ${r2.status}: ${t.slice(0, 200)}` : `Proxy HTTP ${r2.status}`);
|
|
131
|
+
}
|
|
132
|
+
return await r2.json();
|
|
133
|
+
}
|
|
134
|
+
const r = await fetch(args.directUrl, {
|
|
135
|
+
method: "POST",
|
|
136
|
+
headers: { "content-type": "application/json" },
|
|
137
|
+
body: JSON.stringify(args.body)
|
|
138
|
+
});
|
|
139
|
+
if (!r.ok) {
|
|
140
|
+
const t = await r.text().catch(() => "");
|
|
141
|
+
throw new Error(t ? `HTTP ${r.status}: ${t.slice(0, 200)}` : `HTTP ${r.status}`);
|
|
142
|
+
}
|
|
143
|
+
return await r.json();
|
|
144
|
+
}
|
|
90
145
|
function isEvmNativeToken(address) {
|
|
91
146
|
try {
|
|
92
147
|
return viem.getAddress(address) === viem.zeroAddress;
|
|
@@ -299,6 +354,56 @@ function parseEvmChainIdToNumber(chainId) {
|
|
|
299
354
|
}
|
|
300
355
|
return Number.parseInt(t, 10);
|
|
301
356
|
}
|
|
357
|
+
function normalizeHumanDecimalAmount(raw, tokenDecimals) {
|
|
358
|
+
const t = raw.trim().replace(/,/g, "");
|
|
359
|
+
if (!t) return "";
|
|
360
|
+
if (!Number.isInteger(tokenDecimals) || tokenDecimals < 0 || tokenDecimals > 18) {
|
|
361
|
+
throw new Error("Invalid token decimals for amount normalization.");
|
|
362
|
+
}
|
|
363
|
+
const wei = viem.parseUnits(t, tokenDecimals);
|
|
364
|
+
return viem.formatUnits(wei, tokenDecimals);
|
|
365
|
+
}
|
|
366
|
+
var normalizeCurveRouterAmountString = normalizeHumanDecimalAmount;
|
|
367
|
+
|
|
368
|
+
// src/chains/evm/coingecko.ts
|
|
369
|
+
var COINGECKO_PLATFORM_BY_CHAIN_ID = {
|
|
370
|
+
"1": "ethereum",
|
|
371
|
+
"56": "binance-smart-chain",
|
|
372
|
+
"137": "polygon-pos",
|
|
373
|
+
"42161": "arbitrum-one",
|
|
374
|
+
"10": "optimistic-ethereum",
|
|
375
|
+
"43114": "avalanche",
|
|
376
|
+
"8453": "base",
|
|
377
|
+
"324": "zk-sync-era",
|
|
378
|
+
"42220": "celo",
|
|
379
|
+
"250": "fantom",
|
|
380
|
+
"100": "gnosis",
|
|
381
|
+
"204": "op-bnb",
|
|
382
|
+
"534352": "scroll",
|
|
383
|
+
"5000": "mantle",
|
|
384
|
+
"169": "manta-pacific",
|
|
385
|
+
"1116": "core",
|
|
386
|
+
"30": "rootstock",
|
|
387
|
+
"288": "boba",
|
|
388
|
+
"1088": "metis-andromeda",
|
|
389
|
+
"34443": "mode",
|
|
390
|
+
"80084": "berachain",
|
|
391
|
+
"146": "sonic",
|
|
392
|
+
"60808": "bob-network",
|
|
393
|
+
"80094": "berachain",
|
|
394
|
+
"130": "unichain",
|
|
395
|
+
"57073": "ink",
|
|
396
|
+
"999": "hyperevm",
|
|
397
|
+
"239": "tac",
|
|
398
|
+
"9745": "plasma",
|
|
399
|
+
"1923": "swellchain",
|
|
400
|
+
"59144": "linea",
|
|
401
|
+
"81457": "blast",
|
|
402
|
+
"7777777": "zora"
|
|
403
|
+
};
|
|
404
|
+
function coingeckoPlatformForChainId(chainId) {
|
|
405
|
+
return COINGECKO_PLATFORM_BY_CHAIN_ID[String(chainId).trim()];
|
|
406
|
+
}
|
|
302
407
|
|
|
303
408
|
// src/chains/solana/types.ts
|
|
304
409
|
var solanaChainCategoryModule = {
|
|
@@ -1372,44 +1477,64 @@ function swappableCurveGraphNodeKeys(adj) {
|
|
|
1372
1477
|
}
|
|
1373
1478
|
|
|
1374
1479
|
// src/protocols/evm/curve-dao/apiSession.ts
|
|
1480
|
+
var CURVE_SESSION_CACHE_TTL_MS = 5 * 60 * 1e3;
|
|
1481
|
+
var curveSessionCache = /* @__PURE__ */ new Map();
|
|
1375
1482
|
async function fetchAllCurvePools(curve) {
|
|
1376
1483
|
const run = (p) => p.catch(() => void 0);
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1484
|
+
const tasks = [];
|
|
1485
|
+
for (const key of [
|
|
1486
|
+
"factory",
|
|
1487
|
+
"crvUSDFactory",
|
|
1488
|
+
"EYWAFactory",
|
|
1489
|
+
"cryptoFactory",
|
|
1490
|
+
"twocryptoFactory",
|
|
1491
|
+
"tricryptoFactory",
|
|
1492
|
+
"stableNgFactory"
|
|
1493
|
+
]) {
|
|
1494
|
+
const f = curve[key];
|
|
1495
|
+
if (f?.fetchPools) {
|
|
1496
|
+
tasks.push(run(f.fetchPools()));
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
await Promise.all(tasks);
|
|
1386
1500
|
}
|
|
1387
1501
|
async function loadFullCurveSessionForRpc(rpcUrl) {
|
|
1388
1502
|
const url = (rpcUrl ?? "").trim();
|
|
1389
|
-
if (!url)
|
|
1503
|
+
if (!url) {
|
|
1504
|
+
throw new Error("rpcUrl is required.");
|
|
1505
|
+
}
|
|
1506
|
+
const cached = curveSessionCache.get(url);
|
|
1507
|
+
if (cached && cached.expiresAt > Date.now()) {
|
|
1508
|
+
return cached.session;
|
|
1509
|
+
}
|
|
1390
1510
|
try {
|
|
1391
1511
|
const { default: curve } = await import('@curvefi/api');
|
|
1392
1512
|
await curve.init("JsonRpc", { url }, {});
|
|
1393
1513
|
const wrapped = curve.getNetworkConstants().NATIVE_COIN?.wrappedAddress;
|
|
1394
1514
|
if (!curve.hasRouter || !curve.hasRouter()) {
|
|
1395
|
-
|
|
1515
|
+
const session2 = {
|
|
1396
1516
|
curve,
|
|
1397
1517
|
adj: /* @__PURE__ */ new Map(),
|
|
1398
1518
|
swappableNodeKeys: /* @__PURE__ */ new Set(),
|
|
1399
1519
|
wrappedNative: wrapped
|
|
1400
1520
|
};
|
|
1521
|
+
curveSessionCache.set(url, { session: session2, expiresAt: Date.now() + CURVE_SESSION_CACHE_TTL_MS });
|
|
1522
|
+
return session2;
|
|
1401
1523
|
}
|
|
1402
1524
|
await fetchAllCurvePools(curve);
|
|
1403
1525
|
const adj = buildCurveLiquidityGraphFromApi(curve);
|
|
1404
1526
|
addNativeWethBridge(adj, wrapped);
|
|
1405
|
-
|
|
1527
|
+
const session = {
|
|
1406
1528
|
curve,
|
|
1407
1529
|
adj,
|
|
1408
1530
|
swappableNodeKeys: swappableCurveGraphNodeKeys(adj),
|
|
1409
1531
|
wrappedNative: wrapped
|
|
1410
1532
|
};
|
|
1411
|
-
|
|
1412
|
-
return
|
|
1533
|
+
curveSessionCache.set(url, { session, expiresAt: Date.now() + CURVE_SESSION_CACHE_TTL_MS });
|
|
1534
|
+
return session;
|
|
1535
|
+
} catch (e) {
|
|
1536
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
1537
|
+
throw new Error(`Curve session init failed for RPC: ${msg}`);
|
|
1413
1538
|
}
|
|
1414
1539
|
}
|
|
1415
1540
|
|
|
@@ -1589,6 +1714,19 @@ var curveDaoProtocolModule = {
|
|
|
1589
1714
|
return token.kind === "native" || token.kind === "erc20";
|
|
1590
1715
|
},
|
|
1591
1716
|
actions: [
|
|
1717
|
+
{
|
|
1718
|
+
id: "curve-dao.quote",
|
|
1719
|
+
protocolId: CURVE_DAO_PROTOCOL_ID,
|
|
1720
|
+
chainCategory: "evm",
|
|
1721
|
+
description: "Quote swap via Curve Router NG (getBestRouteAndOutput)",
|
|
1722
|
+
commonParams: [],
|
|
1723
|
+
params: {
|
|
1724
|
+
chainId: { type: "number", required: true, description: "EVM chain id" },
|
|
1725
|
+
tokenIn: { type: "address", required: true, description: "Token in or native placeholder" },
|
|
1726
|
+
tokenOut: { type: "address", required: true, description: "Token out or native placeholder" },
|
|
1727
|
+
amountHuman: { type: "string", required: true, description: "Human-readable input amount" }
|
|
1728
|
+
}
|
|
1729
|
+
},
|
|
1592
1730
|
{
|
|
1593
1731
|
id: "curve-dao.swap",
|
|
1594
1732
|
protocolId: CURVE_DAO_PROTOCOL_ID,
|
|
@@ -1619,24 +1757,37 @@ Object.defineProperty(exports, "firstClientIdFromKeyGen", {
|
|
|
1619
1757
|
enumerable: true,
|
|
1620
1758
|
get: function () { return continuumNodeSdk.getClientIdFromKeyGenResult; }
|
|
1621
1759
|
});
|
|
1760
|
+
exports.COINGECKO_PLATFORM_BY_CHAIN_ID = COINGECKO_PLATFORM_BY_CHAIN_ID;
|
|
1622
1761
|
exports.NEAR_CHAIN_CATEGORY = NEAR_CHAIN_CATEGORY;
|
|
1623
1762
|
exports.SOLANA_CHAIN_CATEGORY = SOLANA_CHAIN_CATEGORY;
|
|
1624
1763
|
exports.buildEvmMultisignBatch = buildEvmMultisignBatch;
|
|
1764
|
+
exports.coingeckoPlatformForChainId = coingeckoPlatformForChainId;
|
|
1625
1765
|
exports.coreChainCategoryModule = coreChainCategoryModule;
|
|
1626
1766
|
exports.curveDao = curveDao;
|
|
1627
1767
|
exports.curveDaoProtocolModule = curveDaoProtocolModule;
|
|
1628
1768
|
exports.evmChainCategoryModule = evmChainCategoryModule;
|
|
1629
1769
|
exports.finalizeMultisign = finalizeMultisign;
|
|
1770
|
+
exports.getAaveGraphqlProxyUrl = getAaveGraphqlProxyUrl;
|
|
1630
1771
|
exports.getActionsByChainCategory = getActionsByChainCategory;
|
|
1772
|
+
exports.getCoingeckoProxyUrl = getCoingeckoProxyUrl;
|
|
1773
|
+
exports.getEulerGraphqlProxyUrl = getEulerGraphqlProxyUrl;
|
|
1774
|
+
exports.getMapleGraphqlProxyUrl = getMapleGraphqlProxyUrl;
|
|
1631
1775
|
exports.getProtocolModule = getProtocolModule;
|
|
1632
1776
|
exports.getProtocolModules = getProtocolModules;
|
|
1633
1777
|
exports.isEvmNativeToken = isEvmNativeToken;
|
|
1634
1778
|
exports.matchEvmTokenKind = matchEvmTokenKind;
|
|
1635
1779
|
exports.mergePurposeText = mergePurposeText;
|
|
1636
1780
|
exports.nearChainCategoryModule = nearChainCategoryModule;
|
|
1781
|
+
exports.normalizeCurveRouterAmountString = normalizeCurveRouterAmountString;
|
|
1782
|
+
exports.normalizeHumanDecimalAmount = normalizeHumanDecimalAmount;
|
|
1637
1783
|
exports.parseEvmChainIdToNumber = parseEvmChainIdToNumber;
|
|
1784
|
+
exports.postJsonViaOptionalProxy = postJsonViaOptionalProxy;
|
|
1638
1785
|
exports.registerProtocolModule = registerProtocolModule;
|
|
1639
1786
|
exports.routerSwapGasLimitFromEstimate = routerSwapGasLimitFromEstimate;
|
|
1787
|
+
exports.setAaveGraphqlProxyUrl = setAaveGraphqlProxyUrl;
|
|
1788
|
+
exports.setCoingeckoProxyUrl = setCoingeckoProxyUrl;
|
|
1789
|
+
exports.setEulerGraphqlProxyUrl = setEulerGraphqlProxyUrl;
|
|
1790
|
+
exports.setMapleGraphqlProxyUrl = setMapleGraphqlProxyUrl;
|
|
1640
1791
|
exports.solanaChainCategoryModule = solanaChainCategoryModule;
|
|
1641
1792
|
exports.uniswapV4 = uniswapV4;
|
|
1642
1793
|
exports.uniswapV4ProtocolModule = uniswapV4ProtocolModule;
|