lint + fix dependency

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
microwavedcola1 2021-09-25 13:51:19 +02:00
parent eefd1f95bc
commit d72bcc6458
4 changed files with 14 additions and 20 deletions

View File

@ -18,7 +18,7 @@
"express": "^4.17.1",
"express-validator": "^6.12.1",
"lodash": "^4.17.21",
"node-fetch": "^2.5.0",
"node-fetch": "2.6.1",
"pino": "^6.13.2",
"pino-pretty": "^7.0.0"
},

View File

@ -28,15 +28,15 @@ import {
Commitment,
Connection,
PublicKey,
Transaction,
TransactionSignature,
} from "@solana/web3.js";
import BN from "bn.js";
import fs from "fs";
import fetch from "node-fetch";
import os from "os";
import { OrderInfo } from "types";
import { logger, zipDict } from "./utils";
import BN from "bn.js";
import { Transaction } from "@solana/web3.js";
class MangoSimpleClient {
constructor(
@ -437,14 +437,15 @@ class MangoSimpleClient {
)
);
let i, j;
let i;
const j = transactions.length;
// assuming we can fit 10 cancel order transactions in a solana transaction
// we could switch to computing actual transactionSize every time we add an
// we could switch to computing actual transactionSize every time we add an
// instruction and use a dynamic chunk size
const chunk = 10;
const transactionsToSend: Transaction[] = [];
for (i = 0, j = transactions.length; i < j; i += chunk) {
for (i = 0; i < j; i += chunk) {
const transactionsChunk = transactions.slice(i, i + chunk);
const transactionToSend = new Transaction();
for (const transaction of transactionsChunk) {
@ -545,7 +546,7 @@ class MangoSimpleClient {
this.mangoGroupConfig.serumProgramId
);
}
return await this.buildCancelSpotOrderTransaction(
return this.buildCancelSpotOrderTransaction(
this.mangoGroup,
this.mangoAccount,
this.owner,
@ -757,7 +758,7 @@ class MangoSimpleClient {
return;
}
let possibleClustersUrls = [
const possibleClustersUrls = [
"https://api.mainnet-beta.solana.com",
"https://lokidfxnwlabdq.main.genesysgo.net:8899/",
"https://solana-api.projectserum.com/",

View File

@ -150,12 +150,10 @@ class MarketsController implements Controller {
// latest trade+price
const parsedTradesResponse = (await tradesResponse.json()) as any;
let lastPrice;
if ("s" in parsedTradesResponse && parsedTradesResponse["s"] === "error") {
lastPrice = null;
} else {
lastPrice = parsedTradesResponse["data"][0]["price"];
}
const lastPrice =
"s" in parsedTradesResponse && parsedTradesResponse["s"] === "error"
? null
: parsedTradesResponse["data"][0]["price"];
// size increments
let minOrderSize;
@ -402,7 +400,7 @@ async function getOhlcv(
export async function getVolumeForMarket(
marketConfig: MarketConfig
): Promise<Number> {
): Promise<number> {
const perpVolume = await fetch(
`https://event-history-api.herokuapp.com/stats/perps/${marketConfig.publicKey.toBase58()}`
);

View File

@ -1466,11 +1466,6 @@ node-fetch@2.6.1:
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052"
integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==
node-fetch@^2.5.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.5.0.tgz#8028c49fc1191bba56a07adc6e2a954644a48501"
integrity sha512-YuZKluhWGJwCcUu4RlZstdAxr8bFfOVHakc1mplwHkk8J+tqM1Y5yraYvIUpeX8aY7+crCwiELJq7Vl0o0LWXw==
node-fetch@^2.6.1:
version "2.6.5"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.5.tgz#42735537d7f080a7e5f78b6c549b7146be1742fd"