UNPKG

676 BTypeScriptView Raw
1import { AccountInfo } from '../types/accounts';
2import { BackendInstance, BackendServices } from '../types/backend';
3export interface OneToOneOptions {
4 spread: number;
5 ratesApiUrl: string;
6 getInfo: (accountId: string) => AccountInfo;
7 getAssetCode: (accountId: string) => string;
8}
9export default class OneToOneBackend implements BackendInstance {
10 protected spread: number;
11 protected getInfo: (accountId: string) => AccountInfo | undefined;
12 constructor(opts: OneToOneOptions, api: BackendServices);
13 connect(): Promise<void>;
14 getRate(sourceAccount: string, destinationAccount: string): Promise<number>;
15 submitPayment(): Promise<void>;
16}