-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.d.ts
141 lines (130 loc) · 2.45 KB
/
types.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
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
export type Status = {
total: number;
status: "good" | "bad";
customers: number;
offers?: Offer[];
max: number;
exchangeRate: number;
};
export interface User {
id: string;
address: string;
confirmed: boolean;
sourceId?: string;
}
export interface Offer {
offer_id: string;
source_id: string;
name: string;
balance: number;
rate: number;
chain: "banano" | "nano";
}
export interface OfferResponse {
balance: number;
rate: number;
}
export interface Source {
email: string;
id: string;
active: boolean;
name: string;
secret: string;
chain: "banano" | "nano";
account: string;
}
export interface ManualSource extends Source {
custodial: false;
webhook: string;
}
export interface Price {
min: number;
market: boolean;
margin: number;
}
export interface CustodialSource extends Source {
custodial: true;
address: string;
seed: string;
price: Price;
}
export interface Order {
timestamp: number;
address: string;
paymentIntent: string;
amount: number;
price: number;
status:
| "open"
| "succeeded"
| "failed"
| "invalid hash"
| "transaction error"
| "transfer error"
| "refund error"
| "refunded";
test: boolean;
source: CustodialSource | ManualSource;
transferGroup: string;
version: string;
offer: Offer;
hash?: string;
transferId?: string;
chain: "banano" | "nano";
currency: "usd" | "eur";
transferAmount?: number;
}
interface Purchase {
// Visible to users on Dashboard
timestamp: number;
id: string;
hash: string;
address: string;
amount: number;
price: number;
currency: "usd" | "eur";
chain: "banano" | "nano";
status:
| "open"
| "succeeded"
| "failed"
| "invalid hash"
| "transaction error"
| "transfer error"
| "refund error"
| "refunded";
test: boolean;
}
interface Block {
block_account: string;
amount: number;
balance: number;
height: number;
local_timestamp: number;
confirmed: boolean;
contents: {
type: string;
account: string;
previous: string;
representative: string;
balance: number;
link: string;
link_as_account?: string;
linkAsAccount?: string;
signature: string;
work: string;
subtype: string;
};
subtype: string;
pending: number;
source_account: number;
}
export interface Transaction {
type: string;
account: string;
amount: number;
local_timestamp: number;
height: number;
hash: string;
confirmed: boolean;
}