forked from bitcoinjs/bolt11
-
Notifications
You must be signed in to change notification settings - Fork 0
/
payreq.d.ts
44 lines (42 loc) · 1.44 KB
/
payreq.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import BN from "bn.js";
type RoutingInfo = Array<{
pubkey: string;
short_channel_id: string;
fee_base_msat: number;
fee_proportional_millionths: number;
cltv_expiry_delta: number;
}>;
type FallbackAddress = {
code: number;
address: string;
addressHash: string;
};
// Start exports
export declare type TagData = string | number | RoutingInfo | FallbackAddress;
export declare type PaymentRequestObject = {
paymentRequest?: string;
complete?: boolean;
prefix?: string;
wordsTemp?: string;
coinType?: string;
satoshis?: number;
millisatoshis?: string;
timestamp?: number;
timestampString?: string;
timeExpireDate?: number;
timeExpireDateString?: string;
payeeNodeKey?: string;
signature?: string;
recoveryFlag?: number;
tags: Array<{
tagName: string;
data: TagData;
}>;
};
export declare function encode(inputData: PaymentRequestObject, addDefaults?: boolean): PaymentRequestObject;
export declare function decode(paymentRequest: string): PaymentRequestObject;
export declare function sign(inputPayReqObj: PaymentRequestObject, inputPrivateKey: string | Buffer): PaymentRequestObject;
export declare function satToHrp(satoshis: number | string): string;
export declare function millisatToHrp(millisatoshis: number | string): string;
export declare function hrpToSat(hrpString: string, outputString?: boolean): string | BN;
export declare function hrpToMillisat(hrpString: string, outputString?: boolean): string | BN;