UNPKG

1.97 kBTypeScriptView Raw
1import { SubscriptionResponse, ErrorResponse, SuccessResponse } from "frontblock-generic/Service";
2import { Coin, AccountMap, TransactionMap } from "frontblock-generic/Types";
3import { FrontblockApi } from "frontblock-generic/Api";
4import { Payment, PaymentService } from "./PaymentService";
5import { DollarValueProvider, FrontblockConf } from "./Types";
6export declare const CryptocompareDollarValueProvider: DollarValueProvider;
7export declare class Frontblock implements PaymentService, FrontblockApi {
8 private subscriptionUIDs;
9 private payments;
10 private paymentStreams;
11 private dollarValues;
12 private dollarValueProvider;
13 private apikey;
14 private conf;
15 private io;
16 private socket;
17 constructor(conf: FrontblockConf);
18 private updateSubscribers;
19 private updateModifyDate;
20 private handlePayment;
21 private updateDollarValue;
22 createUsdValuePayment<C extends Coin>(currency: C, amount: number): Promise<Payment<C> | ErrorResponse>;
23 createCryptoPayment<C extends Coin>(currency: C, amount: number): Promise<Payment<C> | ErrorResponse>;
24 getPayment(paymentID: string | Payment<Coin>): Promise<Payment<Coin> | ErrorResponse>;
25 cancelPayment(paymentID: string | Payment<Coin>): Promise<ErrorResponse | SuccessResponse>;
26 resolvePayment(paymentID: string | Payment<Coin>): Promise<ErrorResponse | SuccessResponse>;
27 finalizePayment(paymentID: string | Payment<Coin>): Promise<SuccessResponse | ErrorResponse>;
28 cancelStream(uid: string | SubscriptionResponse): Promise<ErrorResponse | SuccessResponse>;
29 streamPayments(callback: (payment: Payment<Coin>) => void): Promise<ErrorResponse | SubscriptionResponse>;
30 subscribe<C extends Coin>(apikey: string, coin: C, account: AccountMap[C], callback: (tx: TransactionMap[C]) => void): Promise<SubscriptionResponse | ErrorResponse>;
31 unsubscribe(apikey: string, uid: string | SubscriptionResponse): Promise<ErrorResponse | SuccessResponse>;
32}