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": "^4.17.1",
"express-validator": "^6.12.1", "express-validator": "^6.12.1",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"node-fetch": "^2.5.0", "node-fetch": "2.6.1",
"pino": "^6.13.2", "pino": "^6.13.2",
"pino-pretty": "^7.0.0" "pino-pretty": "^7.0.0"
}, },

View File

@ -28,15 +28,15 @@ import {
Commitment, Commitment,
Connection, Connection,
PublicKey, PublicKey,
Transaction,
TransactionSignature, TransactionSignature,
} from "@solana/web3.js"; } from "@solana/web3.js";
import BN from "bn.js";
import fs from "fs"; import fs from "fs";
import fetch from "node-fetch"; import fetch from "node-fetch";
import os from "os"; import os from "os";
import { OrderInfo } from "types"; import { OrderInfo } from "types";
import { logger, zipDict } from "./utils"; import { logger, zipDict } from "./utils";
import BN from "bn.js";
import { Transaction } from "@solana/web3.js";
class MangoSimpleClient { class MangoSimpleClient {
constructor( 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 // 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 // instruction and use a dynamic chunk size
const chunk = 10; const chunk = 10;
const transactionsToSend: Transaction[] = []; 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 transactionsChunk = transactions.slice(i, i + chunk);
const transactionToSend = new Transaction(); const transactionToSend = new Transaction();
for (const transaction of transactionsChunk) { for (const transaction of transactionsChunk) {
@ -545,7 +546,7 @@ class MangoSimpleClient {
this.mangoGroupConfig.serumProgramId this.mangoGroupConfig.serumProgramId
); );
} }
return await this.buildCancelSpotOrderTransaction( return this.buildCancelSpotOrderTransaction(
this.mangoGroup, this.mangoGroup,
this.mangoAccount, this.mangoAccount,
this.owner, this.owner,
@ -757,7 +758,7 @@ class MangoSimpleClient {
return; return;
} }
let possibleClustersUrls = [ const possibleClustersUrls = [
"https://api.mainnet-beta.solana.com", "https://api.mainnet-beta.solana.com",
"https://lokidfxnwlabdq.main.genesysgo.net:8899/", "https://lokidfxnwlabdq.main.genesysgo.net:8899/",
"https://solana-api.projectserum.com/", "https://solana-api.projectserum.com/",

View File

@ -150,12 +150,10 @@ class MarketsController implements Controller {
// latest trade+price // latest trade+price
const parsedTradesResponse = (await tradesResponse.json()) as any; const parsedTradesResponse = (await tradesResponse.json()) as any;
let lastPrice; const lastPrice =
if ("s" in parsedTradesResponse && parsedTradesResponse["s"] === "error") { "s" in parsedTradesResponse && parsedTradesResponse["s"] === "error"
lastPrice = null; ? null
} else { : parsedTradesResponse["data"][0]["price"];
lastPrice = parsedTradesResponse["data"][0]["price"];
}
// size increments // size increments
let minOrderSize; let minOrderSize;
@ -402,7 +400,7 @@ async function getOhlcv(
export async function getVolumeForMarket( export async function getVolumeForMarket(
marketConfig: MarketConfig marketConfig: MarketConfig
): Promise<Number> { ): Promise<number> {
const perpVolume = await fetch( const perpVolume = await fetch(
`https://event-history-api.herokuapp.com/stats/perps/${marketConfig.publicKey.toBase58()}` `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" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052"
integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== 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: node-fetch@^2.6.1:
version "2.6.5" version "2.6.5"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.5.tgz#42735537d7f080a7e5f78b6c549b7146be1742fd" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.5.tgz#42735537d7f080a7e5f78b6c549b7146be1742fd"