Merge conflicts fix

package.json version was updated to 0.16.0-rc.12
This commit is contained in:
Mikhail Gladchenko
2023-01-10 09:37:06 +00:00
parent 8f88278cb9
commit d6f6061a66
2 changed files with 9 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@orionprotocol/sdk",
"version": "0.16.0-rc.11",
"version": "0.16.0-rc.12",
"description": "Orion Protocol SDK",
"main": "./lib/esm/index.js",
"module": "./lib/esm/index.js",

View File

@@ -16,7 +16,7 @@ import {
import unsubscriptionDoneSchema from './schemas/unsubscriptionDoneSchema';
import assetPairConfigSchema from './schemas/assetPairConfigSchema';
import { fullOrderSchema, orderUpdateSchema } from './schemas/addressUpdateSchema';
import cfdAddressUpdateSchema from "./schemas/cfdAddressUpdateSchema";
import cfdAddressUpdateSchema from './schemas/cfdAddressUpdateSchema';
// import errorSchema from './schemas/errorSchema';
const UNSUBSCRIBE = 'u';
@@ -90,13 +90,13 @@ type AddressUpdateInitial = {
type CfdAddressUpdateUpdate = {
kind: 'update',
balances: CFDBalance[],
order?: OrderUpdate | FullOrder
order?: z.infer<typeof orderUpdateSchema> | z.infer<typeof fullOrderSchema>
}
type CfdAddressUpdateInitial = {
kind: 'initial',
balances: CFDBalance[],
orders?: FullOrder[] // The field is not defined if the user has no orders
orders?: z.infer<typeof fullOrderSchema>[] // The field is not defined if the user has no orders
}
type AddressUpdateSubscription = {
@@ -455,11 +455,11 @@ class OrionAggregatorWS {
}
break;
case MessageType.CFD_ADDRESS_UPDATE: {
const balances = json.b ?? []
const balances = json.b ?? [];
switch (json.k) { // message kind
case 'i': { // initial
const fullOrders = json.o
? json.o.reduce<FullOrder[]>((prev, o) => {
? json.o.reduce<z.infer<typeof fullOrderSchema>[]>((prev, o) => {
prev.push(o);
return prev;
@@ -468,7 +468,7 @@ class OrionAggregatorWS {
this.subscriptions[
SubscriptionType.CFD_ADDRESS_UPDATES_SUBSCRIBE
]?.[json.id]?.callback({
]?.[json.id]?.callback({
kind: 'initial',
orders: fullOrders,
balances,
@@ -476,7 +476,7 @@ class OrionAggregatorWS {
}
break;
case 'u': { // update
let orderUpdate: OrderUpdate | FullOrder | undefined;
let orderUpdate: z.infer<typeof orderUpdateSchema> | z.infer<typeof fullOrderSchema> | undefined;
if (json.o) {
const firstOrder = json.o[0];
orderUpdate = firstOrder;
@@ -484,7 +484,7 @@ class OrionAggregatorWS {
this.subscriptions[
SubscriptionType.CFD_ADDRESS_UPDATES_SUBSCRIBE
]?.[json.id]?.callback({
]?.[json.id]?.callback({
kind: 'update',
order: orderUpdate,
balances,