mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-14 06:02:36 +03:00
Rename integrator to indexer (#207)
This commit is contained in:
18
package-lock.json
generated
18
package-lock.json
generated
@@ -1,19 +1,19 @@
|
||||
{
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.20.10-rc101",
|
||||
"version": "0.20.16-rc1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.20.10-rc101",
|
||||
"version": "0.20.16-rc1",
|
||||
"hasInstallScript": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.21.0",
|
||||
"@ethersproject/abstract-signer": "^5.7.0",
|
||||
"@ethersproject/providers": "^5.7.2",
|
||||
"@orionprotocol/contracts": "1.22.1",
|
||||
"@orionprotocol/contracts": "1.22.3",
|
||||
"bignumber.js": "^9.1.1",
|
||||
"bson-objectid": "^2.0.4",
|
||||
"buffer": "^6.0.3",
|
||||
@@ -2419,9 +2419,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@orionprotocol/contracts": {
|
||||
"version": "1.22.1",
|
||||
"resolved": "https://registry.npmjs.org/@orionprotocol/contracts/-/contracts-1.22.1.tgz",
|
||||
"integrity": "sha512-DrIyAmZ+LK3Eflv/gk6Uq3shpTLjeG4wV6PoKVxJKoqk05qL35cJs5V/2it16s5NolcQliFrtJ54G3xI78gTwA=="
|
||||
"version": "1.22.3",
|
||||
"resolved": "https://registry.npmjs.org/@orionprotocol/contracts/-/contracts-1.22.3.tgz",
|
||||
"integrity": "sha512-TVZftFbrHA+ldZSvMAGTntSiTT20UWn6P/+N392A9dv6RtiIXaQpMic5hOhVdIed74DU/KixVxwjVL1Hr0RLGQ=="
|
||||
},
|
||||
"node_modules/@sinclair/typebox": {
|
||||
"version": "0.27.8",
|
||||
@@ -13460,9 +13460,9 @@
|
||||
}
|
||||
},
|
||||
"@orionprotocol/contracts": {
|
||||
"version": "1.22.1",
|
||||
"resolved": "https://registry.npmjs.org/@orionprotocol/contracts/-/contracts-1.22.1.tgz",
|
||||
"integrity": "sha512-DrIyAmZ+LK3Eflv/gk6Uq3shpTLjeG4wV6PoKVxJKoqk05qL35cJs5V/2it16s5NolcQliFrtJ54G3xI78gTwA=="
|
||||
"version": "1.22.3",
|
||||
"resolved": "https://registry.npmjs.org/@orionprotocol/contracts/-/contracts-1.22.3.tgz",
|
||||
"integrity": "sha512-TVZftFbrHA+ldZSvMAGTntSiTT20UWn6P/+N392A9dv6RtiIXaQpMic5hOhVdIed74DU/KixVxwjVL1Hr0RLGQ=="
|
||||
},
|
||||
"@sinclair/typebox": {
|
||||
"version": "0.27.8",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.20.15",
|
||||
"version": "0.20.16-rc1",
|
||||
"description": "Orion Protocol SDK",
|
||||
"main": "./lib/index.cjs",
|
||||
"module": "./lib/index.js",
|
||||
@@ -88,7 +88,7 @@
|
||||
"@babel/runtime": "^7.21.0",
|
||||
"@ethersproject/abstract-signer": "^5.7.0",
|
||||
"@ethersproject/providers": "^5.7.2",
|
||||
"@orionprotocol/contracts": "1.22.1",
|
||||
"@orionprotocol/contracts": "1.22.3",
|
||||
"bignumber.js": "^9.1.1",
|
||||
"bson-objectid": "^2.0.4",
|
||||
"buffer": "^6.0.3",
|
||||
|
||||
@@ -58,8 +58,8 @@ export default class Orion {
|
||||
priceFeed: {
|
||||
api: networkConfig.api + networkConfig.services.priceFeed.all,
|
||||
},
|
||||
integrator: {
|
||||
api: networkConfig.api + networkConfig.services.integrator.http,
|
||||
indexer: {
|
||||
api: networkConfig.api + networkConfig.services.indexer.http,
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -11,7 +11,7 @@ import Exchange from './Exchange/index.js';
|
||||
import FarmingManager from './FarmingManager/index.js';
|
||||
import { chains, envs } from '../config/index.js';
|
||||
import type { networkCodes } from '../constants/index.js';
|
||||
import { IntegratorService } from '../services/Integrator/index.js';
|
||||
import { IndexerService } from '../services/Indexer/index.js';
|
||||
|
||||
type KnownConfig = {
|
||||
env: KnownEnv
|
||||
@@ -27,7 +27,7 @@ export default class Unit {
|
||||
|
||||
public readonly blockchainService: BlockchainService;
|
||||
|
||||
public readonly integrator: IntegratorService;
|
||||
public readonly indexer: IndexerService;
|
||||
|
||||
public readonly aggregator: Aggregator;
|
||||
|
||||
@@ -85,8 +85,8 @@ export default class Unit {
|
||||
priceFeed: {
|
||||
api: networkConfig.api + networkConfig.services.priceFeed.all,
|
||||
},
|
||||
integrator: {
|
||||
api: networkConfig.api + networkConfig.services.integrator.http,
|
||||
indexer: {
|
||||
api: networkConfig.api + networkConfig.services.indexer.http,
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -109,8 +109,8 @@ export default class Unit {
|
||||
this.config.services.blockchainService.http,
|
||||
this.config.basicAuth
|
||||
);
|
||||
this.integrator = new IntegratorService(
|
||||
this.config.services.integrator.api,
|
||||
this.indexer = new IndexerService(
|
||||
this.config.services.indexer.api,
|
||||
intNetwork
|
||||
);
|
||||
this.aggregator = new Aggregator(
|
||||
|
||||
@@ -177,7 +177,7 @@ describe('Orion', () => {
|
||||
priceFeed: {
|
||||
api: orionPriceFeedAPI + '/price-feed',
|
||||
},
|
||||
integrator: {
|
||||
indexer: {
|
||||
api: '',
|
||||
}
|
||||
},
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
"priceFeed": {
|
||||
"all": "/price-feed"
|
||||
},
|
||||
"integrator": {
|
||||
"http": "/orion-integrator/"
|
||||
"indexer": {
|
||||
"http": "/orion-indexer/"
|
||||
}
|
||||
},
|
||||
"liquidityMigratorAddress": "0x23a1820a47BcD022E29f6058a5FD224242F50D1A"
|
||||
@@ -35,8 +35,8 @@
|
||||
"priceFeed": {
|
||||
"all": "/price-feed"
|
||||
},
|
||||
"integrator": {
|
||||
"http": "/orion-integrator/"
|
||||
"indexer": {
|
||||
"http": "/orion-indexer/"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -53,8 +53,8 @@
|
||||
"priceFeed": {
|
||||
"all": "/price-feed"
|
||||
},
|
||||
"integrator": {
|
||||
"http": "/orion-integrator/"
|
||||
"indexer": {
|
||||
"http": "/orion-indexer/"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -71,8 +71,8 @@
|
||||
"priceFeed": {
|
||||
"all": "/price-feed"
|
||||
},
|
||||
"integrator": {
|
||||
"http": "/orion-integrator/"
|
||||
"indexer": {
|
||||
"http": "/orion-indexer/"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -89,8 +89,8 @@
|
||||
"priceFeed": {
|
||||
"all": "/price-feed"
|
||||
},
|
||||
"integrator": {
|
||||
"http": "/orion-integrator/"
|
||||
"indexer": {
|
||||
"http": "/orion-indexer/"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -113,8 +113,8 @@
|
||||
"priceFeed": {
|
||||
"all": "/price-feed"
|
||||
},
|
||||
"integrator": {
|
||||
"http": "/orion-integrator/"
|
||||
"indexer": {
|
||||
"http": "/orion-indexer/"
|
||||
}
|
||||
},
|
||||
"liquidityMigratorAddress": "0x01b10dds12478C88A5E18e2707E729906bC25CfF6"
|
||||
@@ -132,8 +132,8 @@
|
||||
"priceFeed": {
|
||||
"all": "/price-feed"
|
||||
},
|
||||
"integrator": {
|
||||
"http": "/orion-integrator/"
|
||||
"indexer": {
|
||||
"http": "/orion-indexer/"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -150,8 +150,8 @@
|
||||
"priceFeed": {
|
||||
"all": "/price-feed"
|
||||
},
|
||||
"integrator": {
|
||||
"http": "/orion-integrator/"
|
||||
"indexer": {
|
||||
"http": "/orion-indexer/"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -168,8 +168,8 @@
|
||||
"priceFeed": {
|
||||
"all": "/price-feed"
|
||||
},
|
||||
"integrator": {
|
||||
"http": "/orion-integrator/"
|
||||
"indexer": {
|
||||
"http": "/orion-indexer/"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -186,8 +186,8 @@
|
||||
"priceFeed": {
|
||||
"all": "/price-feed"
|
||||
},
|
||||
"integrator": {
|
||||
"http": "/orion-integrator/"
|
||||
"indexer": {
|
||||
"http": "/orion-indexer/"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -204,8 +204,8 @@
|
||||
"priceFeed": {
|
||||
"all": "/price-feed"
|
||||
},
|
||||
"integrator": {
|
||||
"http": "/orion-integrator/"
|
||||
"indexer": {
|
||||
"http": "/orion-indexer/"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -228,8 +228,8 @@
|
||||
"priceFeed": {
|
||||
"all": "/price-feed"
|
||||
},
|
||||
"integrator": {
|
||||
"http": "/orion-integrator/"
|
||||
"indexer": {
|
||||
"http": "/orion-indexer/"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -246,8 +246,8 @@
|
||||
"priceFeed": {
|
||||
"all": "/price-feed"
|
||||
},
|
||||
"integrator": {
|
||||
"http": "/orion-integrator/"
|
||||
"indexer": {
|
||||
"http": "/orion-indexer/"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -264,8 +264,8 @@
|
||||
"priceFeed": {
|
||||
"all": "/price-feed"
|
||||
},
|
||||
"integrator": {
|
||||
"http": "/orion-integrator/"
|
||||
"indexer": {
|
||||
"http": "/orion-indexer/"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -282,8 +282,8 @@
|
||||
"priceFeed": {
|
||||
"all": "/price-feed"
|
||||
},
|
||||
"integrator": {
|
||||
"http": "/orion-integrator/"
|
||||
"indexer": {
|
||||
"http": "/orion-indexer/"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -300,8 +300,8 @@
|
||||
"priceFeed": {
|
||||
"all": "/price-feed"
|
||||
},
|
||||
"integrator": {
|
||||
"http": "/orion-integrator/"
|
||||
"indexer": {
|
||||
"http": "/orion-indexer/"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -324,8 +324,8 @@
|
||||
"priceFeed": {
|
||||
"all": "/price-feed"
|
||||
},
|
||||
"integrator": {
|
||||
"http": "/orion-integrator/"
|
||||
"indexer": {
|
||||
"http": "/orion-indexer/"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -342,8 +342,8 @@
|
||||
"priceFeed": {
|
||||
"all": "/price-feed"
|
||||
},
|
||||
"integrator": {
|
||||
"http": "/orion-integrator/"
|
||||
"indexer": {
|
||||
"http": "/orion-indexer/"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -366,8 +366,8 @@
|
||||
"priceFeed": {
|
||||
"all": "/price-feed"
|
||||
},
|
||||
"integrator": {
|
||||
"http": "/orion-integrator/"
|
||||
"indexer": {
|
||||
"http": "/orion-indexer/"
|
||||
}
|
||||
},
|
||||
"liquidityMigratorAddress": "0x23a1820a47BcD022E29f6058a5FD224242F50D1A"
|
||||
@@ -385,8 +385,8 @@
|
||||
"priceFeed": {
|
||||
"all": "/price-feed"
|
||||
},
|
||||
"integrator": {
|
||||
"http": "/orion-integrator/"
|
||||
"indexer": {
|
||||
"http": "/orion-indexer/"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -403,8 +403,8 @@
|
||||
"priceFeed": {
|
||||
"all": "/price-feed"
|
||||
},
|
||||
"integrator": {
|
||||
"http": "/orion-integrator/"
|
||||
"indexer": {
|
||||
"http": "/orion-indexer/"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -421,8 +421,8 @@
|
||||
"priceFeed": {
|
||||
"all": "/price-feed"
|
||||
},
|
||||
"integrator": {
|
||||
"http": "/orion-integrator/"
|
||||
"indexer": {
|
||||
"http": "/orion-indexer/"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -439,8 +439,8 @@
|
||||
"priceFeed": {
|
||||
"all": "/price-feed"
|
||||
},
|
||||
"integrator": {
|
||||
"http": "/orion-integrator/"
|
||||
"indexer": {
|
||||
"http": "/orion-indexer/"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ export const pureEnvNetworksSchema = z.object({
|
||||
priceFeed: z.object({
|
||||
all: z.string(),
|
||||
}),
|
||||
integrator: z.object({
|
||||
indexer: z.object({
|
||||
http: z.string(),
|
||||
}),
|
||||
}),
|
||||
|
||||
@@ -68,7 +68,7 @@ type Payload =
|
||||
| ListAmountPayload
|
||||
| GetAmountByORNPayload;
|
||||
|
||||
class IntegratorService {
|
||||
class IndexerService {
|
||||
private readonly apiUrl: string;
|
||||
|
||||
private readonly chainId: number;
|
||||
@@ -222,4 +222,4 @@ class IntegratorService {
|
||||
}
|
||||
|
||||
export * as schemas from './schemas/index.js';
|
||||
export { IntegratorService };
|
||||
export { IndexerService };
|
||||
@@ -2,4 +2,4 @@ export * as aggregator from './Aggregator/index.js';
|
||||
export * as blockchainService from './BlockchainService/index.js';
|
||||
export * as priceFeed from './PriceFeed/index.js';
|
||||
export * as referralSystem from './ReferralSystem/index.js';
|
||||
export * as integrator from './Integrator/index.js';
|
||||
export * as indexer from './Indexer/index.js';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable @typescript-eslint/consistent-type-definitions */
|
||||
import factories from './constants/factories.js';
|
||||
import type factories from './constants/factories.js';
|
||||
import type { BigNumber } from 'bignumber.js';
|
||||
import type subOrderStatuses from './constants/subOrderStatuses.js';
|
||||
import type positionStatuses from './constants/positionStatuses.js';
|
||||
@@ -253,7 +253,7 @@ export type VerboseUnitConfig = {
|
||||
// http://10.23.5.11:3003/,
|
||||
// https://price-feed:3003/
|
||||
}
|
||||
integrator: {
|
||||
indexer: {
|
||||
api: string
|
||||
// For example:
|
||||
// http://localhost:3004/,
|
||||
|
||||
Reference in New Issue
Block a user