xud
Version:
Exchange Union Daemon
18 lines (17 loc) • 907 B
TypeScript
import { Models } from '../db/DB';
import { NodeCreationAttributes, NodeInstance, ReputationEventCreationAttributes, ReputationEventInstance } from '../db/types';
declare class P2PRepository {
private models;
constructor(models: Models);
getNodes: () => Promise<NodeInstance[]>;
getNode: (nodePubKey: string) => Promise<NodeInstance | null>;
getReputationEvents: (node: NodeInstance) => Promise<ReputationEventInstance[]>;
/**
* Adds a node to the database if it doesn't already exist.
* @returns the created node instance, or undefined if it already existed.
*/
addNodeIfNotExists: (node: NodeCreationAttributes) => Promise<NodeInstance | undefined>;
addReputationEvent: (event: ReputationEventCreationAttributes) => Promise<ReputationEventInstance>;
addNodes: (nodes: NodeCreationAttributes[]) => Promise<NodeInstance[]>;
}
export default P2PRepository;