feat: expand non-evm relay and route planning support

This commit is contained in:
defiQUG
2026-04-18 12:05:34 -07:00
parent da78073104
commit 843cdbf71c
113 changed files with 8542 additions and 222 deletions

View File

@@ -14,8 +14,22 @@ export const config = {
sourceChain: { rpcUrl: process.env.RPC_URL_138 || process.env.RPC_URL || "http://127.0.0.1:8545" },
etherlinkRpcUrl: process.env.ETHERLINK_RPC_URL || "https://node.mainnet.etherlink.com",
etherlinkRelayBridge: process.env.ETHERLINK_RELAY_BRIDGE || "",
relayPrivateKey: process.env.ETHERLINK_RELAY_PRIVATE_KEY || process.env.PRIVATE_KEY,
relayPrivateKey: resolvePrivateKey(
process.env.ETHERLINK_RELAY_PRIVATE_KEY,
process.env.PRIVATE_KEY,
process.env.DEPLOYER_PRIVATE_KEY,
),
pollIntervalMs: parseInt(process.env.POLL_INTERVAL_MS || "5000", 10),
maxConcurrent: parseInt(process.env.ETHERLINK_RELAY_MAX_CONCURRENT || "5", 10),
queueDepthLimit: parseInt(process.env.ETHERLINK_RELAY_QUEUE_DEPTH || "100", 10),
};
function resolvePrivateKey(...candidates) {
for (const candidate of candidates) {
if (!candidate) continue;
const value = candidate.trim();
if (!value || value.includes('${')) continue;
if (/^0x[0-9a-fA-F]{64}$/.test(value)) return value;
}
return "";
}