Skip to content

Commit

Permalink
add logging and use blocks behind
Browse files Browse the repository at this point in the history
  • Loading branch information
Strernd committed Apr 6, 2021
1 parent 88fea1c commit be43174
Show file tree
Hide file tree
Showing 23 changed files with 716 additions and 19 deletions.
1 change: 1 addition & 0 deletions lib/api.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
63 changes: 63 additions & 0 deletions lib/api.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions lib/database.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Model } from "sequelize";
export interface DBTransaction {
symbol: string;
hash: string;
sender: string;
receiver: string;
amount: number;
block: number;
contract: string;
}
export declare const Transaction: import("sequelize/types").ModelCtor<Model<DBTransaction, DBTransaction>>;
export declare function init(): Promise<void>;
export declare function getLatestBlockNumberForSymbol(symbol: string): Promise<unknown>;
export declare function getTransactionsToForSymbol(symbol: string, receiver: string): Promise<Model<DBTransaction, DBTransaction>[]>;
export declare function getTransactionsFromForSymbol(symbol: string, sender: string): Promise<Model<DBTransaction, DBTransaction>[]>;
export declare function getTransactionByHashForSymbol(symbol: string, hash: string): Promise<Model<DBTransaction, DBTransaction> | null>;
57 changes: 57 additions & 0 deletions lib/database.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions lib/eth.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { TokenConfig } from "./index";
export interface TokenApi {
symbol: string;
decimals: number;
address: string;
getTransactionsFromBlock: (from: number, to: number) => Promise<Erc20Transaction[]>;
}
export interface Erc20Transaction {
hash: string;
amount: number;
sender: string;
receiver: string;
block: number;
}
export declare function getCurrentBlockNumber(): Promise<number>;
export declare function generateTokenApi(token: TokenConfig): Promise<TokenApi>;
Loading

0 comments on commit be43174

Please sign in to comment.