Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Remove MultiIndexer (moved to L2BEAT repo) (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
imxeno authored Apr 11, 2024
1 parent 56d03fa commit c0c79a9
Show file tree
Hide file tree
Showing 16 changed files with 7 additions and 1,617 deletions.
50 changes: 0 additions & 50 deletions packages/uif-example/src/Application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ import { BlockIndexerRepository } from './blocks/BlockIndexerRepository'
import { BlockRepository } from './blocks/BlockRepository'
import { BlockService } from './blocks/BlockService'
import { HourlyIndexer } from './HourlyIndexer'
import { PriceIndexer } from './prices/PriceIndexer'
import { PriceIndexerRepository } from './prices/PriceIndexerRepository'
import { PriceRepository } from './prices/PriceRepository'
import { PriceService } from './prices/PriceService'
import { msToHours, ONE_HOUR_MS } from './utils'

export class Application {
Expand All @@ -19,50 +15,6 @@ export class Application {

const hourlyIndexer = new HourlyIndexer(logger)

const priceService = new PriceService(logger)
const priceRepository = new PriceRepository()
const priceIndexerRepository = new PriceIndexerRepository()

const ethereumPriceIndexer = new PriceIndexer(
'price-ethereum',
priceService,
priceRepository,
priceIndexerRepository,
hourlyIndexer,
logger,
[
{
// could be a hash of properties & minHeight instead
id: 'eth-ethereum',
properties: { tokenSymbol: 'ETH', apiId: 'ethereum' },
minHeight: msToHours(Date.now() - 48 * ONE_HOUR_MS),
maxHeight: null,
},
{
id: 'weth-ethereum',
properties: { tokenSymbol: 'WETH', apiId: 'ethereum' },
minHeight: msToHours(Date.now() - 32 * ONE_HOUR_MS),
maxHeight: null,
},
],
)
const bitcoinPriceIndexer = new PriceIndexer(
'price-bitcoin',
priceService,
priceRepository,
priceIndexerRepository,
hourlyIndexer,
logger,
[
{
id: 'btc-bitcoin',
properties: { tokenSymbol: 'BTC', apiId: 'bitcoin' },
minHeight: msToHours(Date.now() - 72 * ONE_HOUR_MS),
maxHeight: null,
},
],
)

const blockService = new BlockService()
const blockRepository = new BlockRepository()
const blockIndexerRepository = new BlockIndexerRepository()
Expand All @@ -79,8 +31,6 @@ export class Application {
logger.for('Application').info('Starting')

await hourlyIndexer.start()
await ethereumPriceIndexer.start()
await bitcoinPriceIndexer.start()
await blockIndexer.start()

logger.for('Application').info('Started')
Expand Down
4 changes: 0 additions & 4 deletions packages/uif-example/src/prices/PriceConfig.ts

This file was deleted.

107 changes: 0 additions & 107 deletions packages/uif-example/src/prices/PriceIndexer.ts

This file was deleted.

19 changes: 0 additions & 19 deletions packages/uif-example/src/prices/PriceIndexerRepository.ts

This file was deleted.

38 changes: 0 additions & 38 deletions packages/uif-example/src/prices/PriceRepository.ts

This file was deleted.

30 changes: 0 additions & 30 deletions packages/uif-example/src/prices/PriceService.ts

This file was deleted.

6 changes: 6 additions & 0 deletions packages/uif/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @l2beat/uif

## 0.5.0

### Minor Changes

- cd6d192: Removed `MultiIndexer`

## 0.4.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/uif/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@l2beat/uif",
"description": "Universal Indexer Framework.",
"version": "0.4.0",
"version": "0.5.0",
"license": "MIT",
"repository": "https://github.com/l2beat/tools",
"bugs": {
Expand Down
2 changes: 0 additions & 2 deletions packages/uif/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
export * from './Indexer'
export * from './indexers/ChildIndexer'
export * from './indexers/multi/MultiIndexer'
export * from './indexers/multi/types'
export * from './indexers/RootIndexer'
export * from './Retries'
Loading

0 comments on commit c0c79a9

Please sign in to comment.