Merge remote-tracking branch 'origin/main'

This commit is contained in:
Mikhail Gladchenko
2024-02-06 07:13:21 +00:00
7 changed files with 21 additions and 19 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@orionprotocol/sdk",
"version": "0.20.45",
"version": "0.20.52",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@orionprotocol/sdk",
"version": "0.20.45",
"version": "0.20.52",
"hasInstallScript": true,
"license": "ISC",
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "@orionprotocol/sdk",
"version": "0.20.49",
"version": "0.20.52",
"description": "Orion Protocol SDK",
"main": "./lib/index.cjs",
"module": "./lib/index.js",

View File

@@ -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,
}
},
};

View File

@@ -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,

View File

@@ -16,7 +16,7 @@ export const pureEnvNetworksSchema = z.object({
}),
indexer: z.object({
http: z.string(),
}),
}).optional(),
}),
rpc: z.string().optional(),
liquidityMigratorAddress: z.string().optional(),

View File

@@ -1,8 +1,8 @@
import { z } from 'zod';
const linkSchema = z.object({
status: z.string(),
referer: z.string(),
ref_link: z.string(),
});
export default linkSchema;

View File

@@ -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
}