-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(project): refactor project structure
- Loading branch information
1 parent
5f6403f
commit b44a1b6
Showing
19 changed files
with
149 additions
and
130 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export const DEFAULT_TOKEN_ID = | ||
'wSHV2S4qX9jFsLjQo8r1BsMLH2ZRKsZx6EJd1sbozGPieEC4Jf' as const; |
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,65 @@ | ||
import { ArchiveNodeDatabaseRow } from 'src/db/sql/events-actions/types'; | ||
|
||
export type Transactions = Map<string, ArchiveNodeDatabaseRow[]>; | ||
|
||
export type BlocksWithTransactionsMap = Map<string, Transactions>; | ||
|
||
export type FieldElementIdWithValueMap = Map<string, string>; | ||
|
||
export enum BlockStatusFilter { | ||
all = 'ALL', | ||
pending = 'PENDING', | ||
canonical = 'CANONICAL', | ||
} | ||
|
||
export type Event = { | ||
transactionInfo: TransactionInfo; | ||
data: string[]; | ||
}; | ||
|
||
export type Action = { | ||
accountUpdateId: string; | ||
transactionInfo: TransactionInfo; | ||
data: string[]; | ||
}; | ||
|
||
export type BlockInfo = { | ||
height: number; | ||
stateHash: string; | ||
parentHash: string; | ||
ledgerHash: string; | ||
chainStatus: string; | ||
timestamp: string; | ||
globalSlotSinceHardfork: number; | ||
globalSlotSinceGenesis: number; | ||
distanceFromMaxBlockHeight: number; | ||
lastVrfOutput: string; | ||
minWindowDensity: number; | ||
subWindowDensities: number[]; | ||
}; | ||
|
||
export type TransactionInfo = { | ||
status: string; | ||
hash: string; | ||
memo: string; | ||
authorizationKind: string; | ||
}; | ||
|
||
export type Events = { | ||
eventData: Event[]; | ||
blockInfo: BlockInfo; | ||
}[]; | ||
|
||
export type ActionStates = { | ||
actionStateOne: string; | ||
actionStateTwo: string; | ||
actionStateThree: string; | ||
actionStateFour: string; | ||
actionStateFive: string; | ||
}; | ||
|
||
export type Actions = { | ||
actionState: ActionStates; | ||
actionData: Action[]; | ||
blockInfo: BlockInfo; | ||
}[]; |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
|
||
export { CONFIG }; | ||
|
||
type Config = { | ||
|
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 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,12 @@ | ||
import type { EventFilterOptionsInput } from 'src/resolvers-types'; | ||
import type { Actions, Events } from 'src/blockchain/types'; | ||
|
||
export { DatabaseAdapter }; | ||
|
||
interface DatabaseAdapter { | ||
getEvents(input: EventFilterOptionsInput, options?: unknown): Promise<Events>; | ||
getActions( | ||
input: EventFilterOptionsInput, | ||
options?: unknown | ||
): Promise<Actions>; | ||
} |
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
src/db/archive-node-adapter/queries.ts → src/db/sql/events-actions/queries.ts
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 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,6 @@ | ||
import { Actions } from 'src/blockchain/types'; | ||
import { ActionFilterOptionsInput } from 'src/resolvers-types'; | ||
|
||
export interface IActionsService { | ||
getActions(input: ActionFilterOptionsInput): Promise<Actions>; | ||
} |
20 changes: 11 additions & 9 deletions
20
...b/archive-node-adapter/actions-service.ts → ...rvices/actions-service/actions-service.ts
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,6 @@ | ||
import { Events } from 'src/blockchain/types'; | ||
import { EventFilterOptionsInput } from 'src/resolvers-types'; | ||
|
||
export interface IEventsService { | ||
getEvents(input: EventFilterOptionsInput): Promise<Events>; | ||
} |
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,4 @@ | ||
export interface ITracingService { | ||
startSpan(name: string): void; | ||
endSpan(): void; | ||
} |
7 changes: 4 additions & 3 deletions
7
src/tracing/tracing.ts → ...rvices/tracing-service/tracing-service.ts
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
10 changes: 5 additions & 5 deletions
10
src/db/archive-node-adapter/utils.ts → src/services/utils/utils.ts
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
Oops, something went wrong.