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

Feature: beta account activity #1006

Merged
merged 1 commit into from
Jul 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions backend/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ export const config = merge(
min: 0,
max: 15,
},
readOnlyIndexerActivity: {
host: "",
database: "",
user: "",
password: "",
},
},
},
getOverrides("NEAR_EXPLORER_CONFIG")
Expand Down
5 changes: 5 additions & 0 deletions backend/src/database/databases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { config } from "../config";
import * as Indexer from "./models/readOnlyIndexer";
import * as Telemetry from "./models/readOnlyTelemetry";
import * as Analytics from "./models/readOnlyAnalytics";
import * as IndexerActivity from "./models/readOnlyIndexerActivity";

const getPgPool = (config: PostgresDialectConfig): Pool => {
const pool = new Pool(config);
Expand Down Expand Up @@ -36,6 +37,10 @@ export const indexerDatabase = getKysely<Indexer.ModelTypeMap>(
config.db.readOnlyIndexer
);

export const indexerActivityDatabase = getKysely<IndexerActivity.ModelTypeMap>(
config.db.readOnlyIndexerActivity
);

export const analyticsDatabase = getKysely<Analytics.ModelTypeMap>(
config.db.readOnlyAnalytics
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// @generated
// Automatically generated. Don't change this file manually.

export default interface BalanceChanges {
/** Primary key. Index: balance_changes_pkey */
block_timestamp: string;

receipt_id: string | null;

transaction_hash: string | null;

/** Index: balance_changes_affected_account_idx */
affected_account_id: string;

involved_account_id: string | null;

direction: string;

cause: string;

status: string;

delta_nonstaked_amount: string;

absolute_nonstaked_amount: string;

delta_staked_amount: string;

absolute_staked_amount: string;

/** Primary key. Index: balance_changes_pkey */
shard_id: number;

/** Primary key. Index: balance_changes_pkey */
index_in_chunk: number;
}

export interface BalanceChangesInitializer {
/** Primary key. Index: balance_changes_pkey */
block_timestamp: string;

receipt_id?: string | null;

transaction_hash?: string | null;

/** Index: balance_changes_affected_account_idx */
affected_account_id: string;

involved_account_id?: string | null;

direction: string;

cause: string;

status: string;

delta_nonstaked_amount: string;

absolute_nonstaked_amount: string;

delta_staked_amount: string;

absolute_staked_amount: string;

/** Primary key. Index: balance_changes_pkey */
shard_id: number;

/** Primary key. Index: balance_changes_pkey */
index_in_chunk: number;
}
28 changes: 28 additions & 0 deletions backend/src/database/models/readOnlyIndexerActivity/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// @generated
// Automatically generated. Don't change this file manually.

import BalanceChanges, { BalanceChangesInitializer } from "./balance-changes";

type Model = BalanceChanges;

interface ModelTypeMap {
balance_changes: BalanceChanges;
}

interface ModelIdTypeMap {}

type Initializer = BalanceChangesInitializer;

interface InitializerTypeMap {
balance_changes: BalanceChangesInitializer;
}

export type {
BalanceChanges,
BalanceChangesInitializer,
Model,
ModelTypeMap,
ModelIdTypeMap,
Initializer,
InitializerTypeMap,
};
Loading