Orion, Orion Unit, Configuration (#40)

* Refactoring

* Better docs

* Bump

* ESLint standard

* Fix

* Bumo

* VerboseOrionUnitConfig to types

* Docs improvements

* Docs improvements. Orion default env
This commit is contained in:
Aleksandr Kraiz
2023-02-08 14:51:58 +04:00
committed by GitHub
parent bf33fbe4f0
commit b2f3cdf5fb
31 changed files with 4386 additions and 2816 deletions

View File

@@ -1,68 +1,350 @@
{
"production": {
"analyticsAPI": "https://trade.orionprotocol.io/api/stats",
"referralAPI": "https://trade.orionprotocol.io/referral-api",
"networks": {
"1": {
"api": "https://trade.orionprotocol.io",
"services": {
"aggregator": {
"http": "/backend",
"ws": "/v1"
},
"blockchain": {
"http": ""
},
"priceFeed": {
"all": "/price-feed"
}
},
"liquidityMigratorAddress": "0x23a1820a47BcD022E29f6058a5FD224242F50D1A"
},
"56": {
"api": "https://trade-exp.orionprotocol.io"
"api": "https://trade-exp.orionprotocol.io",
"services": {
"aggregator": {
"http": "/backend",
"ws": "/v1"
},
"blockchain": {
"http": ""
},
"priceFeed": {
"all": "/price-feed"
}
}
},
"250": {
"api": "https://trade-ftm.orionprotocol.io"
"api": "https://trade-ftm.orionprotocol.io",
"services": {
"aggregator": {
"http": "/backend",
"ws": "/v1"
},
"blockchain": {
"http": ""
},
"priceFeed": {
"all": "/price-feed"
}
}
},
"137": {
"api": "https://trade-polygon.orionprotocol.io"
"api": "https://trade-polygon.orionprotocol.io",
"services": {
"aggregator": {
"http": "/backend",
"ws": "/v1"
},
"blockchain": {
"http": ""
},
"priceFeed": {
"all": "/price-feed"
}
}
},
"66": {
"api": "https://trade-okc.orionprotocol.io"
"api": "https://trade-okc.orionprotocol.io",
"services": {
"aggregator": {
"http": "/backend",
"ws": "/v1"
},
"blockchain": {
"http": ""
},
"priceFeed": {
"all": "/price-feed"
}
}
}
}
},
"testing": {
"analyticsAPI": "https://trade.orionprotocol.io/api/stats",
"referralAPI": "https://testing.orionprotocol.io/referral-api",
"networks": {
"97": {
"api": "https://testing.orionprotocol.io/bsc-testnet",
"services": {
"aggregator": {
"http": "/backend",
"ws": "/v1"
},
"blockchain": {
"http": ""
},
"priceFeed": {
"all": "/price-feed"
}
},
"liquidityMigratorAddress": "0x01b10dds12478C88A5E18e2707E729906bC25CfF6"
},
"3": {
"api": "https://testing.orionprotocol.io/eth-ropsten",
"services": {
"aggregator": {
"http": "/backend",
"ws": "/v1"
},
"blockchain": {
"http": ""
},
"priceFeed": {
"all": "/price-feed"
}
},
"liquidityMigratorAddress": "0x36969a25622AE31bA9946e0c8151f0dc08b3A1c8"
},
"4002": {
"api": "https://testing.orionprotocol.io/ftm-testnet"
"api": "https://testing.orionprotocol.io/ftm-testnet",
"services": {
"aggregator": {
"http": "/backend",
"ws": "/v1"
},
"blockchain": {
"http": ""
},
"priceFeed": {
"all": "/price-feed"
}
}
},
"80001": {
"api": "https://testing.orionprotocol.io/polygon-mumbai"
"api": "https://testing.orionprotocol.io/polygon-mumbai",
"services": {
"aggregator": {
"http": "/backend",
"ws": "/v1"
},
"blockchain": {
"http": ""
},
"priceFeed": {
"all": "/price-feed"
}
}
}
}
},
"staging": {
"analyticsAPI": "https://trade.orionprotocol.io/api/stats",
"referralAPI": "https://staging.orionprotocol.io/referral-api",
"networks": {
"1": {
"api": "https://staging.orionprotocol.io"
"api": "https://staging.orionprotocol.io",
"services": {
"aggregator": {
"http": "/backend",
"ws": "/v1"
},
"blockchain": {
"http": ""
},
"priceFeed": {
"all": "/price-feed"
}
}
},
"56": {
"api": "https://staging-bsc.orionprotocol.io"
"api": "https://staging-bsc.orionprotocol.io",
"services": {
"aggregator": {
"http": "/backend",
"ws": "/v1"
},
"blockchain": {
"http": ""
},
"priceFeed": {
"all": "/price-feed"
}
}
},
"250": {
"api": "https://staging-ftm.orionprotocol.io"
"api": "https://staging-ftm.orionprotocol.io",
"services": {
"aggregator": {
"http": "/backend",
"ws": "/v1"
},
"blockchain": {
"http": ""
},
"priceFeed": {
"all": "/price-feed"
}
}
},
"137": {
"api": "https://staging-polygon.orionprotocol.io"
"api": "https://staging-polygon.orionprotocol.io",
"services": {
"aggregator": {
"http": "/backend",
"ws": "/v1"
},
"blockchain": {
"http": ""
},
"priceFeed": {
"all": "/price-feed"
}
}
},
"66": {
"api": "https://staging-okc.orionprotocol.io"
"api": "https://staging-okc.orionprotocol.io",
"services": {
"aggregator": {
"http": "/backend",
"ws": "/v1"
},
"blockchain": {
"http": ""
},
"priceFeed": {
"all": "/price-feed"
}
}
}
}
},
"experimental": {
"analyticsAPI": "https://trade.orionprotocol.io/api/stats",
"referralAPI": "https://testing.orionprotocol.io/referral-api",
"networks": {
"97": {
"api": "https://dn-dev.orionprotocol.io/bsc-testnet"
"api": "https://dn-dev.orionprotocol.io/bsc-testnet",
"services": {
"aggregator": {
"http": "/backend",
"ws": "/v1"
},
"blockchain": {
"http": ""
},
"priceFeed": {
"all": "/price-feed"
}
}
},
"3": {
"api": "https://dn-dev.orionprotocol.io/eth-ropsten"
"api": "https://dn-dev.orionprotocol.io/eth-ropsten",
"services": {
"aggregator": {
"http": "/backend",
"ws": "/v1"
},
"blockchain": {
"http": ""
},
"priceFeed": {
"all": "/price-feed"
}
}
}
}
},
"kucoin-production": {
"analyticsAPI": "https://trade.orionprotocol.io/api/stats",
"referralAPI": "https://trade.orionprotocol.io/referral-api",
"networks": {
"1": {
"api": "https://trade.orionprotocol.io",
"services": {
"aggregator": {
"http": "/backend",
"ws": "/v1"
},
"blockchain": {
"http": ""
},
"priceFeed": {
"all": "/price-feed"
}
},
"liquidityMigratorAddress": "0x23a1820a47BcD022E29f6058a5FD224242F50D1A"
},
"56": {
"api": "https://trade-exp.orionprotocol.io",
"services": {
"aggregator": {
"http": "/backend",
"ws": "/v1"
},
"blockchain": {
"http": ""
},
"priceFeed": {
"all": "/price-feed"
}
}
},
"250": {
"api": "https://trade-ftm.orionprotocol.io",
"services": {
"aggregator": {
"http": "/backend",
"ws": "/v1"
},
"blockchain": {
"http": ""
},
"priceFeed": {
"all": "/price-feed"
}
}
},
"137": {
"api": "https://trade-polygon.orionprotocol.io",
"services": {
"aggregator": {
"http": "/backend",
"ws": "/v1"
},
"blockchain": {
"http": ""
},
"priceFeed": {
"all": "/price-feed"
}
}
},
"66": {
"api": "https://trade-okc.orionprotocol.io",
"services": {
"aggregator": {
"http": "/backend",
"ws": "/v1"
},
"blockchain": {
"http": ""
},
"priceFeed": {
"all": "/price-feed"
}
}
}
}
}

View File

@@ -1,18 +1,34 @@
import { z } from 'zod';
import { SupportedChainId } from '../../types';
export const pureEnvNetworksSchema = z.object({
api: z.string(),
services: z.object({
blockchain: z.object({
http: z.string(),
}),
aggregator: z.object({
http: z.string(),
ws: z.string(),
}),
priceFeed: z.object({
all: z.string(),
}),
}),
rpc: z.string().optional(),
liquidityMigratorAddress: z.string().optional(),
});
export const pureEnvPayloadSchema = z.object({
analyticsAPI: z.string().url(),
referralAPI: z.string().url(),
networks: z.record(
z.nativeEnum(SupportedChainId),
z.object({
api: z.string(),
rpc: z.string().optional(),
liquidityMigratorAddress: z.string().optional(),
}),
pureEnvNetworksSchema
),
});
export const pureEnvSchema = z.record(
z.string(),
z.enum(['production', 'staging', 'testing']).or(z.string()),
pureEnvPayloadSchema,
);