-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.go
177 lines (158 loc) · 5.28 KB
/
types.go
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
package lnpay
// Webhook types
// "wallet_created" webhook payload
// https://docs.lnpay.co/webhooks/getting-started#payloads
type WebhookWalletCreated struct {
CreatedAt int `json:"created_at"`
ID string `json:"id"`
Event Event `json:"event"`
Data struct {
Wal Wal `json:"wal"`
} `json:"data"`
}
// "wallet_send" webhook payload
// https://docs.lnpay.co/webhooks/getting-started#payloads
type WebhookWalletSend struct {
CreatedAt int `json:"created_at"`
ID string `json:"id"`
Event Event `json:"event"`
Data struct {
Wtx Wtx `json:"wtx"`
} `json:"data"`
}
// "wallet_receive" webhook payload
// https://docs.lnpay.co/webhooks/getting-started#payloads
type WebhookWalletInternalTransfer struct {
ID string `json:"id"`
CreatedAt int `json:"created_at"`
Event Event `json:"event"`
Data struct {
Wtx Wtx `json:"wtx"`
} `json:"data"`
}
// "wallet_transfer_IN/OUT" webhook payload
// https://docs.lnpay.co/webhooks/getting-started#payloads
type WebhookWalletReceive struct {
CreatedAt int `json:"created_at"`
ID string `json:"id"`
Event Event `json:"event"`
Data struct {
Wtx Wtx `json:"wtx"`
} `json:"data"`
}
// "paywall_created" webhook payload
// https://docs.lnpay.co/webhooks/getting-started#paywalls
type WebhookPaywallCreated struct {
ID string `json:"id"`
CreatedAt int `json:"created_at"`
Event Event `json:"event"`
Data struct {
Pywl Pywl `json:"pywl"`
} `json:"data"`
}
// "paywall_conversion" webhook payload
// https://docs.lnpay.co/webhooks/getting-started#paywalls
type WebhookPaywallConversion struct {
ID string `json:"id"`
CreatedAt int `json:"created_at"`
Event Event `json:"event"`
Data struct {
Pywl Pywl `json:"pywl"`
Wtx Wtx `json:"wtx"`
} `json:"data"`
}
// Primary types
type Error struct {
Name string `json:"name"`
Message string `json:"message"`
Code int `json:"code"`
Status int `json:"status"`
}
func (err Error) Error() string {
return err.Message
}
type Wal struct {
ID string `json:"id"`
UserLabel string `json:"user_label"`
CreatedAt int `json:"created_at"`
UpdatedAt int `json:"updated_at"`
Balance int64 `json:"balance"`
StatusType StatusType `json:"statusType"`
AccessKeys *AccessKeys `json:"accessKeys"`
}
type Wtx struct {
UserLabel string `json:"user_label"`
CreatedAt int `json:"created_at"`
ID string `json:"id"`
Wal Wal `json:"wal"`
WtxType WtxType `json:"wtxType"`
LnTx LnTx `json:"lnTx"`
PassThru map[string]interface{} `json:"passThru"`
}
type LnTx struct {
ID string `json:"id"`
CreatedAt int `json:"created_at"`
DestPubkey string `json:"dest_pubkey"`
PaymentRequest string `json:"payment_request"`
RHashDecoded string `json:"r_hash_decoded"`
Memo string `json:"memo"`
DescriptionHash string `json:"description_hash"`
NumSatoshis int64 `json:"num_satoshis"`
Expiry int `json:"expiry"`
ExpiresAt int `json:"expires_at"`
PaymentPreimage string `json:"payment_preimage"`
Settled int `json:"settled"`
SettledAt int `json:"settled_at"`
IsKeysend bool `json:"is_keysend"`
CustomRecords map[string]interface{} `json:"custom_records"`
}
type Pywl struct {
DestinationURL string `json:"destination_url"`
Memo string `json:"memo"`
ShortURL string `json:"short_url"`
NumSatoshis int64 `json:"lnd_value"`
CreatedAt int `json:"created_at"`
UpdatedAt int `json:"updated_at"`
Metadata map[string]interface{} `json:"metadata"`
ID string `json:"id"`
PaywallLink string `json:"paywall_link"`
CustyDomain struct {
DomainName string `json:"domain_name"`
} `json:"custyDomain"`
StatusType StatusType `json:"statusType"`
PaywallType struct {
Name string `json:"name"`
DisplayName string `json:"display_name"`
Description string `json:"description"`
} `json:"paywallType"`
Template struct {
Layout string `json:"layout"`
} `json:"template"`
LinkExpRule struct {
Type string `json:"type"`
Name string `json:"name"`
DisplayName string `json:"display_name"`
TimeMinutes int `json:"time_minutes"`
} `json:"linkExpRule"`
}
// Secondary/helper types
type Event struct {
Type string `json:"type"`
Name string `json:"name"`
DisplayName string `json:"display_name"`
}
type AccessKeys struct {
WalletAdmin []string `json:"Wallet Admin"`
WalletInvoice []string `json:"Wallet Invoice"`
WalletRead []string `json:"Wallet Read"`
}
type StatusType struct {
Type string `json:"type"`
Name string `json:"name"`
DisplayName string `json:"display_name"`
}
type WtxType struct {
Layer string `json:"layer"`
Name string `json:"name"`
DisplayName string `json:"display_name"`
}