UNPKG

888 BTypeScriptView Raw
1/// <reference types="node" />
2import Accounts from '../services/accounts';
3import { AccountInfo } from '../types/accounts';
4import * as IlpPacket from 'ilp-packet';
5export interface SubmitPaymentParams {
6 sourceAccount: string;
7 destinationAccount: string;
8 sourceAmount: string;
9 destinationAmount: string;
10 parsedPacket?: IlpPacket.IlpPrepare;
11 result?: Buffer;
12}
13export interface BackendServices {
14 getInfo: (accountId: string) => AccountInfo | undefined;
15 accounts?: Accounts;
16}
17export interface BackendConstructor {
18 new (options: object, api: BackendServices): BackendInstance;
19}
20export interface BackendInstance {
21 connect(): Promise<void>;
22 getRate(sourceAccount: string, destinationAccount: string): Promise<number>;
23 submitPayment(params: SubmitPaymentParams): Promise<void>;
24 submitPacket?(params: SubmitPaymentParams): Promise<void>;
25}