|
|
@@ -2,6 +2,7 @@ import fs from "node:fs/promises";
|
|
|
|
|
|
import type { PrivateKey } from "@pythnetwork/contract-manager/core/base";
|
|
|
import { toPrivateKey } from "@pythnetwork/contract-manager/core/base";
|
|
|
+import { EvmChain } from "@pythnetwork/contract-manager/core/chains";
|
|
|
import { EvmEntropyContract } from "@pythnetwork/contract-manager/core/contracts/evm";
|
|
|
import { DefaultStore } from "@pythnetwork/contract-manager/node/store";
|
|
|
import type { Logger } from "pino";
|
|
|
@@ -44,6 +45,7 @@ async function loadConfig(configPath: string): Promise<LoadedConfig[]> {
|
|
|
z.strictObject({
|
|
|
"chain-id": z.string(),
|
|
|
interval: z.string(),
|
|
|
+ "rpc-endpoint": z.string().optional(),
|
|
|
}),
|
|
|
);
|
|
|
const configContent = (await import(configPath, {
|
|
|
@@ -66,6 +68,16 @@ async function loadConfig(configPath: string): Promise<LoadedConfig[]> {
|
|
|
`Multiple contracts found for chain ${config["chain-id"]}, check contract manager store.`,
|
|
|
);
|
|
|
}
|
|
|
+ if (config["rpc-endpoint"]) {
|
|
|
+ const evmChain = firstContract.chain;
|
|
|
+ firstContract.chain = new EvmChain(
|
|
|
+ evmChain.getId(),
|
|
|
+ evmChain.isMainnet(),
|
|
|
+ evmChain.getNativeToken(),
|
|
|
+ config["rpc-endpoint"],
|
|
|
+ evmChain.networkId,
|
|
|
+ );
|
|
|
+ }
|
|
|
return { contract: firstContract, interval };
|
|
|
});
|
|
|
return loadedConfigs;
|