Merge branch 'main' into OP-3618-claim-rewards

This commit is contained in:
kuduzow
2023-03-09 10:35:08 +03:00
5 changed files with 412 additions and 8480 deletions

8859
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "@orionprotocol/sdk",
"version": "0.17.29-rc.0",
"version": "0.17.30-rc.0",
"description": "Orion Protocol SDK",
"main": "./lib/esm/index.js",
"module": "./lib/esm/index.js",
@@ -47,12 +47,12 @@
"@types/socket.io-client": "1.4.33",
"@types/uuid": "^9.0.1",
"@types/ws": "^8.5.4",
"@typescript-eslint/eslint-plugin": "^5.53.0",
"@typescript-eslint/parser": "^5.53.0",
"@typescript-eslint/eslint-plugin": "^5.54.1",
"@typescript-eslint/parser": "^5.54.1",
"@babel/core": "^7.21.0",
"babel-loader": "^9.1.2",
"concurrently": "^7.6.0",
"eslint": "^8.34.0",
"eslint": "^8.35.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-standard": "^17.0.0",
"eslint-config-standard-with-typescript": "^34.0.0",
@@ -62,7 +62,7 @@
"http-terminator": "^3.2.0",
"husky": "^8.0.3",
"is-ci": "^3.0.1",
"jest": "^29.4.3",
"jest": "^29.5.0",
"ts-jest": "^29.0.5",
"ts-loader": "^9.4.2",
"typescript": "^4.9.5",
@@ -74,7 +74,7 @@
"@ethersproject/abstract-signer": "^5.7.0",
"@ethersproject/providers": "^5.7.2",
"@lukeed/csprng": "^1.0.1",
"@orionprotocol/contracts": "0.3.0",
"@orionprotocol/contracts": "0.4.0",
"bignumber.js": "^9.1.1",
"bson-objectid": "^2.0.4",
"buffer": "^6.0.3",
@@ -92,7 +92,7 @@
"ts-node": "^10.9.1",
"uuid": "^9.0.0",
"ws": "^8.12.1",
"zod": "3.21.2"
"zod": "3.21.4"
},
"homepage": "https://github.com/orionprotocol/sdk#readme",
"files": [

View File

@@ -11,7 +11,7 @@ import {
import UnsubscriptionType from './UnsubscriptionType';
import type {
SwapInfoBase, AssetPairUpdate, OrderbookItem,
Balance, Exchange, CFDBalance, FuturesTradeInfo, SwapInfo, AnyJSON,
Balance, Exchange, CFDBalance, FuturesTradeInfo, SwapInfo, Json,
} from '../../../types';
import unsubscriptionDoneSchema from './schemas/unsubscriptionDoneSchema';
import assetPairConfigSchema from './schemas/assetPairConfigSchema';
@@ -202,7 +202,7 @@ class OrionAggregatorWS {
}
}
private send(jsonObject: AnyJSON) {
private send(jsonObject: Json) {
if (this.ws?.readyState === WebSocket.OPEN) {
const jsonData = JSON.stringify(jsonObject);
this.ws.send(jsonData);
@@ -228,7 +228,7 @@ class OrionAggregatorWS {
const id = type === 'aobus'
? ((subscription as any).payload as string) // TODO: Refactor!!!
: uuidv4();
const subRequest: AnyJSON = {};
const subRequest: Json = {};
subRequest['T'] = type;
subRequest['id'] = id;

View File

@@ -4,7 +4,7 @@ import { v4 as uuidv4 } from 'uuid';
import priceFeedSubscriptions from './priceFeedSubscriptions';
import { tickerInfoSchema, candleSchema } from './schemas';
import priceSchema from './schemas/priceSchema';
import type { AnyJSON } from '../../../types';
import type { Json } from '../../../types';
import allTickersSchema from './schemas/allTickersSchema';
export const subscriptions = {
@@ -83,7 +83,7 @@ export default class PriceFeedSubscription<T extends SubscriptionType = Subscrip
this.init();
}
private send(jsonObject: AnyJSON) {
private send(jsonObject: Json) {
if (this.ws?.readyState === WebSocket.OPEN) {
const jsonData = JSON.stringify(jsonObject);
this.ws.send(jsonData);

View File

@@ -294,11 +294,4 @@ export type VerboseOrionUnitConfig = {
export type KnownEnv = typeof knownEnvs[number];
export type AnyJSON = string | number | boolean | null | JSONObject | JSONArray;
// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style
interface JSONObject {
[x: string]: AnyJSON
}
interface JSONArray extends Array<AnyJSON> {}
export type Json = string | number | boolean | null | Json[] | { [key: string]: Json };