mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-04-11 05:28:06 +03:00
Make Indexer optional (#231)
* feature: added new Thena exchange and indexer was made optional * fix: updated indexer types * Update package.json * fix: updated indexer types * fix: updated indexer types * fix: updated indexer types --------- Co-authored-by: TheJuze <dimanikus0106@gmail.com>
This commit is contained in:
committed by
GitHub
parent
85963892cb
commit
c597fa0805
@@ -59,7 +59,7 @@ export default class Orion {
|
||||
api: networkConfig.api + networkConfig.services.priceFeed.all,
|
||||
},
|
||||
indexer: {
|
||||
api: networkConfig.api + networkConfig.services.indexer.http,
|
||||
api: networkConfig.api + networkConfig.services.indexer?.http,
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { JsonRpcProvider } from 'ethers';
|
||||
import { Aggregator } from '../services/Aggregator/index.js';
|
||||
import { BlockchainService } from '../services/BlockchainService/index.js';
|
||||
import { PriceFeed } from '../services/PriceFeed/index.js';
|
||||
import { Aggregator } from '../services/Aggregator';
|
||||
import { BlockchainService } from '../services/BlockchainService';
|
||||
import { PriceFeed } from '../services/PriceFeed';
|
||||
import type {
|
||||
KnownEnv,
|
||||
SupportedChainId,
|
||||
VerboseUnitConfig,
|
||||
} from '../types.js';
|
||||
import Exchange from './Exchange/index.js';
|
||||
import { chains, envs } from '../config/index.js';
|
||||
import { chains, envs } from '../config';
|
||||
import type { networkCodes } from '../constants/index.js';
|
||||
import { IndexerService } from '../services/Indexer/index.js';
|
||||
import { IndexerService } from '../services/Indexer';
|
||||
|
||||
type KnownConfig = {
|
||||
env: KnownEnv
|
||||
@@ -26,7 +26,7 @@ export default class Unit {
|
||||
|
||||
public readonly blockchainService: BlockchainService;
|
||||
|
||||
public readonly indexer: IndexerService;
|
||||
public readonly indexer: IndexerService | undefined;
|
||||
|
||||
public readonly aggregator: Aggregator;
|
||||
|
||||
@@ -83,7 +83,7 @@ export default class Unit {
|
||||
api: networkConfig.api + networkConfig.services.priceFeed.all,
|
||||
},
|
||||
indexer: {
|
||||
api: networkConfig.api + networkConfig.services.indexer.http,
|
||||
api: networkConfig.api + networkConfig.services.indexer?.http,
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -106,10 +106,12 @@ export default class Unit {
|
||||
this.config.services.blockchainService.http,
|
||||
this.config.basicAuth
|
||||
);
|
||||
this.indexer = new IndexerService(
|
||||
this.config.services.indexer.api,
|
||||
intNetwork
|
||||
);
|
||||
this.indexer = this.config.services.indexer
|
||||
? new IndexerService(
|
||||
this.config.services.indexer.api,
|
||||
intNetwork
|
||||
)
|
||||
: undefined;
|
||||
this.aggregator = new Aggregator(
|
||||
this.config.services.aggregator.http,
|
||||
this.config.services.aggregator.ws,
|
||||
|
||||
@@ -16,7 +16,7 @@ export const pureEnvNetworksSchema = z.object({
|
||||
}),
|
||||
indexer: z.object({
|
||||
http: z.string(),
|
||||
}),
|
||||
}).optional(),
|
||||
}),
|
||||
rpc: z.string().optional(),
|
||||
liquidityMigratorAddress: z.string().optional(),
|
||||
|
||||
@@ -262,12 +262,12 @@ export type VerboseUnitConfig = {
|
||||
// http://10.23.5.11:3003/,
|
||||
// https://price-feed:3003/
|
||||
}
|
||||
indexer: {
|
||||
indexer?: {
|
||||
api: string
|
||||
// For example:
|
||||
// http://localhost:3004/,
|
||||
// http://
|
||||
}
|
||||
} | undefined
|
||||
}
|
||||
basicAuth?: BasicAuthCredentials
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user