-
Notifications
You must be signed in to change notification settings - Fork 10
/
types.ts
106 lines (95 loc) · 1.93 KB
/
types.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
export type KeysendResponse = {
customKey: string;
customValue: string;
destination: string;
};
export type LnUrlRawData = {
tag: string;
callback: string;
minSendable: number;
maxSendable: number;
metadata: string;
payerData?: LUD18ServicePayerData;
commentAllowed?: number;
allowsNostr?: boolean;
};
export type LnUrlPayResponse = {
callback: string;
fixed: boolean;
min: number;
max: number;
domain?: string;
metadata: Array<Array<string>>;
metadataHash: string;
identifier: string;
description: string;
image: string;
commentAllowed?: number;
rawData: LnUrlRawData;
allowsNostr: boolean;
payerData?: LUD18ServicePayerData;
};
export type LUD18ServicePayerData = Partial<{
name: { mandatory: boolean };
pubkey: { mandatory: boolean };
identifier: { mandatory: boolean };
email: { mandatory: boolean };
auth: {
mandatory: boolean;
k1: string;
};
}> &
Record<string, unknown>;
export type LUD18PayerData = Partial<{
name?: string;
pubkey?: string;
identifier?: string;
email?: string;
auth?: {
key: string;
sig: string;
};
}> &
Record<string, unknown>;
export type NostrResponse = {
names: Record<string, string>;
relays: Record<string, string[]>;
};
export type InvoiceArgs = {
pr: string;
verify?: string;
preimage?: string;
};
export type Event = {
id?: string;
kind: number;
pubkey?: string;
content: string;
tags: string[][];
created_at: number;
sig?: string;
};
export type ZapArgs = {
satoshi: number;
comment?: string;
relays: string[];
p?: string;
e?: string; // note you are zapping, optional
};
export type NostrProvider = {
getPublicKey(): Promise<string>;
signEvent(
event: Event & {
pubkey: string;
id: string;
},
): Promise<Event>;
};
export type ZapOptions = {
nostr?: NostrProvider;
};
export type RequestInvoiceArgs = {
satoshi: number;
comment?: string;
payerdata?: LUD18PayerData;
};