aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/src/models
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-09-20 01:51:12 +0800
committerAlex Browne <stephenalexbrowne@gmail.com>2018-12-05 06:23:29 +0800
commitcd73a047efbc1b7afa884ef27a1cc4991e20efd8 (patch)
tree4355fd034ec22a5e5412aca1876ee09a9d848eb4 /packages/pipeline/src/models
parent57e7119c0d4f1ab7dd1d4c0118e72dc1706e2151 (diff)
downloaddexon-sol-tools-cd73a047efbc1b7afa884ef27a1cc4991e20efd8.tar
dexon-sol-tools-cd73a047efbc1b7afa884ef27a1cc4991e20efd8.tar.gz
dexon-sol-tools-cd73a047efbc1b7afa884ef27a1cc4991e20efd8.tar.bz2
dexon-sol-tools-cd73a047efbc1b7afa884ef27a1cc4991e20efd8.tar.lz
dexon-sol-tools-cd73a047efbc1b7afa884ef27a1cc4991e20efd8.tar.xz
dexon-sol-tools-cd73a047efbc1b7afa884ef27a1cc4991e20efd8.tar.zst
dexon-sol-tools-cd73a047efbc1b7afa884ef27a1cc4991e20efd8.zip
Remove old code. Create function for getting contract events via etherscan
Diffstat (limited to 'packages/pipeline/src/models')
-rw-r--r--packages/pipeline/src/models/block.ts22
-rw-r--r--packages/pipeline/src/models/event.ts84
-rw-r--r--packages/pipeline/src/models/historical_prices.ts43
-rw-r--r--packages/pipeline/src/models/order.ts30
-rw-r--r--packages/pipeline/src/models/price.ts15
-rw-r--r--packages/pipeline/src/models/relayer.ts75
-rw-r--r--packages/pipeline/src/models/tokens.ts24
-rw-r--r--packages/pipeline/src/models/transaction.ts36
8 files changed, 0 insertions, 329 deletions
diff --git a/packages/pipeline/src/models/block.ts b/packages/pipeline/src/models/block.ts
deleted file mode 100644
index a81cdb293..000000000
--- a/packages/pipeline/src/models/block.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-const block = {
- tableName: 'blocks',
- tableProperties: {
- id: {
- type: 'key',
- },
- timestamp: {
- type: 'timestamp',
- required: true,
- },
- block_number: {
- type: 'bigint',
- required: true,
- },
- },
-};
-const logToBlockSchemaMapping: any = {
- number: 'block_number',
- hash: 'block_hash',
- timestamp: 'timestamp',
-};
-export { block, logToBlockSchemaMapping };
diff --git a/packages/pipeline/src/models/event.ts b/packages/pipeline/src/models/event.ts
deleted file mode 100644
index cb1c939e5..000000000
--- a/packages/pipeline/src/models/event.ts
+++ /dev/null
@@ -1,84 +0,0 @@
-const event = {
- tableName: 'events',
- tableProperties: {
- id: {
- type: 'key',
- },
- timestamp: {
- type: 'timestamp',
- required: true,
- },
- event_type: {
- type: 'varchar',
- required: true,
- },
- error_id: {
- type: 'varchar',
- },
- order_hash: {
- type: 'char(66)',
- },
- maker: {
- type: 'char(42)',
- },
- maker_amount: {
- type: 'varchar',
- },
- maker_fee: {
- type: 'varchar',
- },
- maker_token: {
- type: 'char(42)',
- },
- taker_amount: {
- type: 'varchar',
- },
- taker_fee: {
- type: 'varchar',
- },
- taker_token: {
- type: 'char(42)',
- },
- txn_hash: {
- type: 'char(66)',
- },
- gas_used: {
- type: 'varchar',
- },
- gas_price: {
- type: 'varchar',
- },
- fee_recipient: {
- type: 'char(42)',
- },
- method_id: {
- type: 'char(10)',
- },
- salt: {
- type: 'varchar',
- },
- block_number: {
- type: 'bigint',
- },
- },
-};
-const logToEventSchemaMapping: any = {
- blockNumber: 'block_number',
- transactionHash: 'txn_hash',
- event: 'event_type',
- logIndex: 'log_index',
- 'args.maker': 'maker',
- 'args.taker': 'taker',
- 'args.feeRecipient': 'fee_recipient',
- 'args.makerToken': 'maker_token',
- 'args.takerToken': 'taker_token',
- 'args.filledMakerTokenAmount': 'maker_amount',
- 'args.filledTakerTokenAmount': 'taker_amount',
- 'args.paidMakerFee': 'maker_fee',
- 'args.paidTakerFee': 'taker_fee',
- 'args.orderHash': 'order_hash',
- 'args.cancelledMakerTokenAmount': 'maker_amount',
- 'args.cancelledTakerTokenAmount': 'taker_amount',
- 'args.errorId': 'error_id',
-};
-export { event, logToEventSchemaMapping };
diff --git a/packages/pipeline/src/models/historical_prices.ts b/packages/pipeline/src/models/historical_prices.ts
deleted file mode 100644
index cf49b579e..000000000
--- a/packages/pipeline/src/models/historical_prices.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-const historicalPrices = {
- tableName: 'historical_prices',
- tableProperties: {
- token: {
- type: 'varchar',
- },
- base: {
- type: 'varchar',
- },
- timestamp: {
- type: 'timestamp',
- },
- close: {
- type: 'numeric(50)',
- },
- high: {
- type: 'numeric(50)',
- },
- low: {
- type: 'numeric(50)',
- },
- open: {
- type: 'numeric(50)',
- },
- volume_from: {
- type: 'numeric(50)',
- },
- volume_to: {
- type: 'numeric(50)',
- },
- },
-};
-const logToHistoricalPricesSchema: { [log: string]: string } = {
- token: 'token',
- time: 'timestamp',
- close: 'close',
- high: 'high',
- low: 'low',
- open: 'open',
- volumefrom: 'volume_from',
- volumeto: 'volume_to',
-};
-export { historicalPrices, logToHistoricalPricesSchema };
diff --git a/packages/pipeline/src/models/order.ts b/packages/pipeline/src/models/order.ts
deleted file mode 100644
index dadae2883..000000000
--- a/packages/pipeline/src/models/order.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-const order = {
- tableName: 'orders',
- tableProperties: {
- id: {
- type: 'key',
- },
- timestamp: {
- type: 'timestamp',
- required: true,
- },
- block_number: {
- type: 'bigint',
- required: true,
- },
- },
-};
-const logToOrderSchemaMapping: any = {
- exchangeContractAddress: 'exchange_contract_address',
- maker: 'maker',
- makerTokenAddress: 'maker_token',
- makerTokenAmount: 'maker_amount',
- makerFee: 'maker_fee',
- taker: 'taker',
- takerTokenAddress: 'taker_token',
- takerTokenAmount: 'taker_amount',
- takerFee: 'taker_fee',
- expirationUnixTimestampSec: 'expiration_unix_timestamp_sec',
- salt: 'salt',
-};
-export { order, logToOrderSchemaMapping };
diff --git a/packages/pipeline/src/models/price.ts b/packages/pipeline/src/models/price.ts
deleted file mode 100644
index 9e45cc2a9..000000000
--- a/packages/pipeline/src/models/price.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-const price = {
- tableName: 'prices',
- tableProperties: {
- address: {
- type: 'char(42)',
- },
- timestamp: {
- type: 'timestamp',
- },
- price: {
- type: 'numeric(50)',
- },
- },
-};
-export { price };
diff --git a/packages/pipeline/src/models/relayer.ts b/packages/pipeline/src/models/relayer.ts
deleted file mode 100644
index 77a123e8b..000000000
--- a/packages/pipeline/src/models/relayer.ts
+++ /dev/null
@@ -1,75 +0,0 @@
-// const relayer = {
-// tableName: 'relayers',
-// tableProperties: {
-// id: {
-// type: 'integer',
-// },
-// name: {
-// type: 'varchar',
-// },
-// url : {
-// type: 'varchar',
-// },
-// model: {
-// type: 'varchar[]',
-// },
-// status: {
-// type: 'varchar',
-// },
-// sra_status: {
-// type: 'varchar',
-// },
-// sra_http_url: {
-// type: 'varchar',
-// },
-// known_fee_addresses: {
-// type: 'char(42)[]',
-// },
-// known_taker_addresses: {
-// type: 'char(42)[]',
-// },
-// relayer_type: {
-// type: 'varchar',
-// },
-// },
-// };
-const relayer = {
- tableName: 'relayers',
- tableProperties: {
- name: {
- type: 'varchar',
- },
- url: {
- type: 'varchar',
- },
- sra_http_endpoint: {
- type: 'varchar',
- },
- sra_ws_endpoint: {
- type: 'varchar',
- },
- fee_recipient_addresses: {
- type: 'char(42)[]',
- },
- taker_addresses: {
- type: 'char(42)[]',
- },
- },
-};
-// const logToRelayerSchemaMapping: any = {
-// 'id' : 'id',
-// 'fields[\'Name\']': 'name',
-// 'fields[\'URL\']': 'url',
-// 'fields[\'Model\']': 'model',
-// 'fields[\'Status\']': 'status',
-// 'fields[\'SRA Status\']': 'sra_status',
-// 'fields[\'SRA HTTP URL\']': 'sra_http_url',
-// 'fields[\'Known Fee Addresses\']': 'known_fee_addresses',
-// 'fields[\'Known Taker Addresses\']': 'known_taker_addresses',
-// 'fields[\'Relayer Type\']': 'relayer_type',
-// };
-const logToRelayerSchemaMapping: any = {
- name: 'name',
- homepage_url: 'url',
-};
-export { relayer, logToRelayerSchemaMapping };
diff --git a/packages/pipeline/src/models/tokens.ts b/packages/pipeline/src/models/tokens.ts
deleted file mode 100644
index 96e8a31af..000000000
--- a/packages/pipeline/src/models/tokens.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-const token = {
- tableName: 'tokens',
- tableProperties: {
- address: {
- type: 'char(66)',
- },
- decimals: {
- type: 'bigint',
- },
- name: {
- type: 'varchar',
- },
- symbol: {
- type: 'varchar',
- },
- },
-};
-const logToTokenSchemaMapping: any = {
- address: 'address',
- decimals: 'decimals',
- name: 'name',
- symbol: 'symbol',
-};
-export { token, logToTokenSchemaMapping };
diff --git a/packages/pipeline/src/models/transaction.ts b/packages/pipeline/src/models/transaction.ts
deleted file mode 100644
index 715cc9480..000000000
--- a/packages/pipeline/src/models/transaction.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-const transaction = {
- tableName: 'transactions',
- tableProperties: {
- txn_hash: {
- type: 'char(66)',
- },
- block_hash: {
- type: 'char(66)',
- },
- block_number: {
- type: 'bigint',
- },
- gas_used: {
- type: 'varchar',
- },
- gas_price: {
- type: 'varchar',
- },
- method_id: {
- type: 'char(10)',
- },
- salt: {
- type: 'varchar',
- },
- },
-};
-const logToTransactionSchemaMapping: any = {
- hash: 'txn_hash',
- gas: 'gas_used',
- gasPrice: 'gas_price',
- blockHash: 'block_hash',
- blockNumber: 'block_number',
- method_id: 'method_id',
- salt: 'salt',
-};
-export { transaction, logToTransactionSchemaMapping };