feat: expand non-evm relay and route planning support
This commit is contained in:
@@ -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 "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user