1 | import Accounts from '../services/accounts'
|
2 | import { AccountInfo } from '../types/accounts'
|
3 | import * as IlpPacket from 'ilp-packet'
|
4 |
|
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 |
|
14 |
|
15 | export interface BackendServices {
|
16 | getInfo: (accountId: string) => AccountInfo | undefined
|
17 | accounts?: Accounts
|
18 | }
|
19 |
|
20 | export interface BackendConstructor {
|
21 | new (options: object, api: BackendServices): BackendInstance
|
22 | }
|
23 |
|
24 | export interface BackendInstance {
|
25 | connect (): Promise<void>
|
26 | getRate (sourceAccount: string, destinationAccount: string): Promise<number>
|
27 | submitPayment (params: SubmitPaymentParams): Promise<void>
|
28 | submitPacket? (params: SubmitPaymentParams): Promise<void>
|
29 | }
|