1 |
|
2 | import Accounts from '../services/accounts';
|
3 | import { AccountInfo } from '../types/accounts';
|
4 | import * as IlpPacket from 'ilp-packet';
|
5 | export interface SubmitPaymentParams {
|
6 | sourceAccount: string;
|
7 | destinationAccount: string;
|
8 | sourceAmount: string;
|
9 | destinationAmount: string;
|
10 | parsedPacket?: IlpPacket.IlpPrepare;
|
11 | result?: Buffer;
|
12 | }
|
13 | export interface BackendServices {
|
14 | getInfo: (accountId: string) => AccountInfo | undefined;
|
15 | accounts?: Accounts;
|
16 | }
|
17 | export interface BackendConstructor {
|
18 | new (options: object, api: BackendServices): BackendInstance;
|
19 | }
|
20 | export 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 | }
|