aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-09-28 04:53:37 +0800
committerFred Carlsen <fred@sjelfull.no>2018-12-13 01:12:18 +0800
commit2a133f2c551ac9706c6ed2b5deadda4bc4c63832 (patch)
tree7f5ddd205c82a10992d105846bf3297505172b05
parent4570bc2729cef550bacd168928ce1206ee06d3c2 (diff)
downloaddexon-sol-tools-2a133f2c551ac9706c6ed2b5deadda4bc4c63832.tar
dexon-sol-tools-2a133f2c551ac9706c6ed2b5deadda4bc4c63832.tar.gz
dexon-sol-tools-2a133f2c551ac9706c6ed2b5deadda4bc4c63832.tar.bz2
dexon-sol-tools-2a133f2c551ac9706c6ed2b5deadda4bc4c63832.tar.lz
dexon-sol-tools-2a133f2c551ac9706c6ed2b5deadda4bc4c63832.tar.xz
dexon-sol-tools-2a133f2c551ac9706c6ed2b5deadda4bc4c63832.tar.zst
dexon-sol-tools-2a133f2c551ac9706c6ed2b5deadda4bc4c63832.zip
Add soruceUrl to SraOrder entity
-rw-r--r--packages/pipeline/src/entities/SraOrder.ts1
-rw-r--r--packages/pipeline/src/index.ts4
2 files changed, 4 insertions, 1 deletions
diff --git a/packages/pipeline/src/entities/SraOrder.ts b/packages/pipeline/src/entities/SraOrder.ts
index c9a1f926d..e4987df57 100644
--- a/packages/pipeline/src/entities/SraOrder.ts
+++ b/packages/pipeline/src/entities/SraOrder.ts
@@ -7,6 +7,7 @@ export class SraOrder extends BaseEntity {
@PrimaryColumn() public exchangeAddress!: string;
@PrimaryColumn() public orderHashHex!: string;
+ @Column() public sourceUrl!: string;
@Column() public lastUpdatedTimestamp!: number;
@Column() public firstSeenTimestamp!: number;
diff --git a/packages/pipeline/src/index.ts b/packages/pipeline/src/index.ts
index 3e8434e3d..c442c7970 100644
--- a/packages/pipeline/src/index.ts
+++ b/packages/pipeline/src/index.ts
@@ -47,10 +47,12 @@ async function getSraOrdersAsync(): Promise<void> {
const orderRepository = connection.getRepository(SraOrder);
console.log(`found ${await orderRepository.count()} existing orders`);
- const connect = new HttpClient('https://api.radarrelay.com/0x/v2');
+ const sraUrl = 'https://api.radarrelay.com/0x/v2';
+ const connect = new HttpClient(sraUrl);
const rawOrders = await connect.getOrdersAsync();
const orders = parseSraOrders(rawOrders);
for (const order of orders) {
+ order.sourceUrl = sraUrl;
order.save();
}
console.log(`now there are ${await orderRepository.count()} total orders`);