Skip to content
This repository has been archived by the owner on Sep 9, 2023. It is now read-only.

Commit

Permalink
digifinex: convert to TS
Browse files Browse the repository at this point in the history
  • Loading branch information
bmancini55 committed Jun 11, 2021
1 parent 0acf590 commit 8454681
Show file tree
Hide file tree
Showing 5 changed files with 410 additions and 393 deletions.
1 change: 1 addition & 0 deletions __tests__/TestRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export type TickerOptions = {
export type TradeOptions = {
hasTradeId?: boolean;
hasSequenceId?: boolean;
tradeIdPattern?: RegExp;
tests?: (spec: any, result: any) => void;
};

Expand Down
80 changes: 80 additions & 0 deletions __tests__/exchanges/DigifinexClient.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import { testClient } from "../TestRunner";
import { DigifinexClient } from "../../src/exchanges/DigifinexClient";
import * as https from "../../src/Https";

testClient({
clientFactory: () => new DigifinexClient(),
clientName: "DigifinexClient",
exchangeName: "Digifinex",
markets: [
{
id: "btc_usdt",
base: "BTC",
quote: "USDT",
},
{
id: "eth_usdt",
base: "ETH",
quote: "USDT",
},
],

async fetchAllMarkets() {
const res: any = await https.get("https://openapi.digifinex.com/v3/markets");
return res.data.map(p => ({
id: p.market,
base: p.market.split("_")[0],
quote: p.market.split("_")[1],
}));
},

testConnectEvents: true,
testDisconnectEvents: true,
testReconnectionEvents: true,
testCloseEvents: true,

testAllMarketsTrades: true,
testAllMarketsTradesSuccess: 200,

hasTickers: true,
hasTrades: true,
hasCandles: false,
hasLevel2Snapshots: false,
hasLevel2Updates: true,
hasLevel3Snapshots: false,
hasLevel3Updates: false,

ticker: {
hasTimestamp: true,
hasLast: true,
hasOpen: true,
hasHigh: true,
hasLow: true,
hasVolume: true,
hasQuoteVolume: true,
hasChange: true,
hasChangePercent: true,
hasAsk: true,
hasBid: true,
hasAskVolume: true,
hasBidVolume: true,
},

trade: {
hasTradeId: true,
tradeIdPattern: /[0-9]+/,
},

l2update: {
hasSnapshot: true,
hasTimestampMs: false,
hasSequenceId: false,
hasCount: false,
},

l2snapshot: {
hasTimestampMs: false,
hasSequenceId: false,
hasCount: false,
},
});
80 changes: 0 additions & 80 deletions __tests__/exchanges/digifinex-client.spec.js

This file was deleted.

Loading

0 comments on commit 8454681

Please sign in to comment.