generated from multiversx/mx-template-service
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from MogageNicolae/Dune-mock-API-Service
Dune simulator implementation + hatom borrow events parser service
- Loading branch information
Showing
112 changed files
with
4,765 additions
and
12,850 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
NETWORK=devnet | ||
API_URL=https://devnet-api.multiversx.com | ||
NETWORK=mainnet | ||
API_URL=https://api.multiversx.com | ||
DATA_API_CEX_URL=https://data-api.multiversx.com/v1/quotes/cex | ||
DATA_API_XEXCHANGE_URL=https://data-api.multiversx.com/v1/quotes/xexchange | ||
# DUNE_API_URL=http://localhost:3001/api/v1/table | ||
DUNE_API_URL=https://api.dune.com/api/v1/table | ||
DUNE_NAMESPACE=stefanmvx | ||
DUNE_API_KEY= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
NETWORK=mainnet | ||
API_URL=https://api.multiversx.com | ||
DATA_API_CEX_URL=https://data-api.multiversx.com/v1/quotes/cex | ||
DATA_API_XEXCHANGE_URL=https://data-api.multiversx.com/v1/quotes/xexchange | ||
DUNE_API_URL=http://localhost:3001/api/v1/table | ||
# DUNE_API_URL=https://api.dune.com/api/v1/table | ||
DUNE_NAMESPACE=stefanmvx | ||
DUNE_API_KEY=test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
NETWORK=testnet | ||
API_URL=https://testnet-api.multiversx.com | ||
NETWORK=mainnet | ||
API_URL=https://api.multiversx.com | ||
DATA_API_CEX_URL=https://data-api.multiversx.com/v1/quotes/cex | ||
DATA_API_XEXCHANGE_URL=https://data-api.multiversx.com/v1/quotes/xexchange | ||
# DUNE_API_URL=http://localhost:3001/api/v1/table | ||
DUNE_API_URL=https://api.dune.com/api/v1/table | ||
DUNE_NAMESPACE=stefanmvx | ||
DUNE_API_KEY= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,3 +47,6 @@ lerna-debug.log* | |
# Environment | ||
.env | ||
.env.custom | ||
/scripts/insertCsv.ts | ||
scripts/ | ||
out_csv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { ApiProperty } from "@nestjs/swagger"; | ||
|
||
export class EventLog { | ||
constructor(init?: Partial<EventLog>) { | ||
Object.assign(this, init); | ||
} | ||
@ApiProperty() | ||
eventId: string = ''; | ||
|
||
@ApiProperty() | ||
txHash: string = ''; | ||
|
||
@ApiProperty() | ||
shardId: number = 0; | ||
|
||
@ApiProperty() | ||
timestamp: number = 0; | ||
|
||
@ApiProperty() | ||
address: string = ''; | ||
|
||
@ApiProperty() | ||
identifier: string = ''; | ||
|
||
@ApiProperty() | ||
topics: string[] = []; | ||
|
||
@ApiProperty() | ||
data: string = ''; | ||
|
||
@ApiProperty() | ||
additionalData: string[] = []; | ||
|
||
@ApiProperty() | ||
txOrder: number = 0; | ||
|
||
@ApiProperty() | ||
eventOrder: number = 0; | ||
} | ||
|
||
export class EventsLog { | ||
constructor(init?: Partial<EventsLog>) { | ||
Object.assign(this, init); | ||
} | ||
|
||
@ApiProperty({ type: EventLog, isArray: true }) | ||
events: EventLog[] = []; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./event.log"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Body, Controller, Param, Post } from "@nestjs/common"; | ||
import { ApiTags } from "@nestjs/swagger"; | ||
import { EventLog } from "./entities/event.log"; | ||
import { HatomBorrowEventsService, LiquidityEventsService } from "@libs/services/events"; | ||
|
||
@Controller('/events') | ||
@ApiTags('events') | ||
export class EventsController { | ||
constructor( | ||
private readonly liquidityService: LiquidityEventsService, | ||
private readonly hatomBorrowService: HatomBorrowEventsService, | ||
) { } | ||
|
||
@Post("/liquidity-webhook") | ||
async liquidityWebhook( | ||
@Body() body: EventLog[], | ||
): Promise<void> { | ||
await this.liquidityService.liquidityWebhook(body); | ||
} | ||
|
||
@Post("/hatom-webhook/:borrowed_token") | ||
async hatomBorrowWebhook( | ||
@Body() body: EventLog[], | ||
@Param('borrowed_token') borrowedToken: string, | ||
): Promise<void> { | ||
await this.hatomBorrowService.hatomBorrowWebhook(body, borrowedToken); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Module } from "@nestjs/common"; | ||
import { ServicesModule } from "@libs/services/services.module"; | ||
import { EventsController } from "./events.controller"; | ||
|
||
@Module({ | ||
imports: [ | ||
ServicesModule, | ||
], | ||
controllers: [ | ||
EventsController, | ||
], | ||
}) | ||
export class EventsModule { } |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.