mirror of
https://github.com/0xbow-io/privacy-pools-core.git
synced 2026-01-09 01:17:58 -05:00
fix(sdk): remove RPC apiKey config from Data Service (#75)
This commit is contained in:
@@ -45,13 +45,12 @@ export class DataService {
|
||||
|
||||
try {
|
||||
for (const config of chainConfigs) {
|
||||
if (!config.rpcUrl || !config.apiKey) {
|
||||
throw new Error(`Missing RPC URL or API key for chain ${config.chainId}`);
|
||||
if (!config.rpcUrl) {
|
||||
throw new Error(`Missing RPC URL for chain ${config.chainId}`);
|
||||
}
|
||||
|
||||
const client = createPublicClient({
|
||||
transport: http(config.rpcUrl),
|
||||
key: config.apiKey,
|
||||
});
|
||||
this.clients.set(config.chainId, client);
|
||||
}
|
||||
|
||||
@@ -45,7 +45,6 @@ export interface ChainConfig {
|
||||
privacyPoolAddress: Address;
|
||||
startBlock: bigint;
|
||||
rpcUrl: string;
|
||||
apiKey: string; // API key for RPC provider authentication
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,17 +28,11 @@ describe('DataService with Sepolia', () => {
|
||||
};
|
||||
|
||||
beforeAll(() => {
|
||||
const apiKey = process.env.RPC_API_KEY;
|
||||
if (!apiKey) {
|
||||
throw new Error('RPC_API_KEY environment variable is required');
|
||||
}
|
||||
|
||||
const config: ChainConfig = {
|
||||
chainId: SEPOLIA_CHAIN_ID,
|
||||
privacyPoolAddress: POOL_ADDRESS,
|
||||
startBlock: START_BLOCK,
|
||||
rpcUrl: 'https://sepolia.rpc.hypersync.xyz',
|
||||
apiKey,
|
||||
};
|
||||
|
||||
dataService = new DataService([config]);
|
||||
|
||||
Reference in New Issue
Block a user