Token_orderbook_snapshots for Ddex and Paradex(#1354)

* Implements the TokenOrderbookSnapshot Table

* Scripts, Data Sources and Entities to pull Ddex and Paradex API data.
This commit is contained in:
zkao
2018-12-04 13:21:46 -08:00
committed by Alex Browne
parent 7198b441e0
commit 87ffa5d7ab
14 changed files with 669 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
import { BigNumber } from '@0x/utils';
import 'mocha';
import { TokenOrderbookSnapshot } from '../../src/entities';
import { createDbConnectionOnceAsync } from '../db_setup';
import { chaiSetup } from '../utils/chai_setup';
import { testSaveAndFindEntityAsync } from './util';
chaiSetup.configure();
const tokenOrderbookSnapshot: TokenOrderbookSnapshot = {
source: 'ddextest',
observedTimestamp: Date.now(),
orderType: 'bid',
price: new BigNumber(10.1),
baseAssetSymbol: 'ETH',
baseAssetAddress: '0x818e6fecd516ecc3849daf6845e3ec868087b755',
baseVolume: new BigNumber(143),
quoteAssetSymbol: 'ABC',
quoteAssetAddress: '0x00923b9a074762b93650716333b3e1473a15048e',
quoteVolume: new BigNumber(12.3234234),
};
describe('TokenOrderbookSnapshot entity', () => {
it('save/find', async () => {
const connection = await createDbConnectionOnceAsync();
const tokenOrderbookSnapshotRepository = connection.getRepository(TokenOrderbookSnapshot);
await testSaveAndFindEntityAsync(tokenOrderbookSnapshotRepository, tokenOrderbookSnapshot);
});
});