-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
{backend, test}: change backend files and backend tests to typescript (…
…#204) * refactor backend file structure, add typescript config file * remove compiled files * remove extra file * fresh yarn lock * fix test, readme * update package.json script * change js to ts in backend, begin fixes * finish refactoring/cleaning up backend ts files * fix tests * upgrade tsconfig target to es6, moduleResolution to node * fix docker run error * empty commit * debugging sequelize error * remove babel, change common/lumen.js to use commonjs, other fixes * fix convertFields method * unneeded allowJS in tsconfig * use correct types instead of any in lumens.d.ts * add LedgerSql type * use _:any for unused params
- Loading branch information
Showing
16 changed files
with
335 additions
and
288 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
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 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,59 @@ | ||
import { Sequelize, Model, DataTypes } from "sequelize"; | ||
|
||
export const sequelize = new Sequelize( | ||
process.env.DEV | ||
? "postgres://localhost/dashboard?sslmode=disable" | ||
: process.env.POSTGRES_URL || "", | ||
process.env.DEV | ||
? {} | ||
: { | ||
dialect: "postgres", | ||
dialectOptions: { | ||
ssl: { | ||
require: true, | ||
rejectUnauthorized: false, | ||
}, | ||
}, | ||
}, | ||
); | ||
|
||
export class LedgerStats extends Model { | ||
public sequence!: number; | ||
public closed_at!: Date; | ||
public paging_token!: string; | ||
public transaction_count!: number; | ||
public operation_count!: number; | ||
} | ||
|
||
LedgerStats.init( | ||
{ | ||
sequence: { | ||
type: DataTypes.INTEGER, | ||
allowNull: false, | ||
primaryKey: true, | ||
}, | ||
closed_at: { | ||
type: DataTypes.DATE, | ||
allowNull: false, | ||
}, | ||
paging_token: { | ||
type: DataTypes.STRING, | ||
allowNull: false, | ||
}, | ||
transaction_count: { | ||
type: DataTypes.INTEGER, | ||
allowNull: false, | ||
}, | ||
operation_count: { | ||
type: DataTypes.INTEGER, | ||
allowNull: false, | ||
}, | ||
}, | ||
{ | ||
tableName: "ledger_stats", | ||
sequelize, | ||
}, | ||
); | ||
|
||
// Create schema if doesn't exist | ||
sequelize.sync({ hooks: true }); |
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,15 @@ | ||
export var ORIGINAL_SUPPLY_AMOUNT: string; | ||
export function getLumenBalance(horizonURL: string, accountId: string): string; | ||
export function totalLumens(horizonURL: string): string; | ||
export function inflationLumens(): Promise<BigNumber>; | ||
export function feePool(): string; | ||
export function burnedLumens(): string; | ||
export function directDevelopmentAll(): Promise<string>; | ||
export function distributionEcosystemSupport(): Promise<string>; | ||
export function distributionUseCaseInvestment(): Promise<string>; | ||
export function distributionUserAcquisition(): Promise<string>; | ||
export function getUpgradeReserve(): string; | ||
export function sdfAccounts(): Promise<BigNumber>; | ||
export function totalSupply(): Promise<BigNumber>; | ||
export function noncirculatingSupply(): Promise<BigNumber>; | ||
export function circulatingSupply(): Promise<BigNumber>; |
Oops, something went wrong.