forked from OpenBazaar/openbazaar-go
-
Notifications
You must be signed in to change notification settings - Fork 8
/
models.go
138 lines (126 loc) · 4.88 KB
/
models.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
package repo
import (
"time"
)
type SettingsData struct {
PaymentDataInQR *bool `json:"paymentDataInQR"`
ShowNotifications *bool `json:"showNotifications"`
ShowNsfw *bool `json:"showNsfw"`
ShippingAddresses *[]ShippingAddress `json:"shippingAddresses"`
LocalCurrency *string `json:"localCurrency"`
Country *string `json:"country"`
TermsAndConditions *string `json:"termsAndConditions"`
RefundPolicy *string `json:"refundPolicy"`
BlockedNodes *[]string `json:"blockedNodes"`
StoreModerators *[]string `json:"storeModerators"`
MisPaymentBuffer *float32 `json:"mispaymentBuffer"`
SMTPSettings *SMTPSettings `json:"smtpSettings"`
Version *string `json:"version"`
PreferredCurrencies *[]string `json:"preferredCurrencies"`
}
type ShippingAddress struct {
Name string `json:"name"`
Company string `json:"company"`
AddressLineOne string `json:"addressLineOne"`
AddressLineTwo string `json:"addressLineTwo"`
City string `json:"city"`
State string `json:"state"`
Country string `json:"country"`
PostalCode string `json:"postalCode"`
AddressNotes string `json:"addressNotes"`
}
type SMTPSettings struct {
Notifications bool `json:"notifications"`
ServerAddress string `json:"serverAddress"`
Username string `json:"username"`
Password string `json:"password"`
SenderEmail string `json:"senderEmail"`
RecipientEmail string `json:"recipientEmail"`
OpenBazaarName string `json:"openBazaarName"`
}
type Follower struct {
PeerId string `json:"peerId"`
Proof []byte `json:"proof"`
}
type Coupon struct {
Slug string
Code string
Hash string
}
type Metadata struct {
Txid string
Address string
Memo string
OrderId string
Thumbnail string
CanBumpFee bool
}
type Purchase struct {
OrderId string `json:"orderId"`
Slug string `json:"slug"`
Timestamp time.Time `json:"timestamp"`
Title string `json:"title"`
Thumbnail string `json:"thumbnail"`
Total CurrencyValue `json:"total"`
VendorId string `json:"vendorId"`
VendorHandle string `json:"vendorHandle"`
ShippingName string `json:"shippingName"`
ShippingAddress string `json:"shippingAddress"`
CoinType string `json:"coinType"`
PaymentCoin string `json:"paymentCoin"`
State string `json:"state"`
Read bool `json:"read"`
Moderated bool `json:"moderated"`
UnreadChatMessages int `json:"unreadChatMessages"`
}
type Sale struct {
OrderId string `json:"orderId"`
Slug string `json:"slug"`
Timestamp time.Time `json:"timestamp"`
Title string `json:"title"`
Thumbnail string `json:"thumbnail"`
Total CurrencyValue `json:"total"`
BuyerId string `json:"buyerId"`
BuyerHandle string `json:"buyerHandle"`
ShippingName string `json:"shippingName"`
ShippingAddress string `json:"shippingAddress"`
CoinType string `json:"coinType"`
PaymentCoin string `json:"paymentCoin"`
State string `json:"state"`
Read bool `json:"read"`
Moderated bool `json:"moderated"`
UnreadChatMessages int `json:"unreadChatMessages"`
}
type Case struct {
CaseId string `json:"caseId"`
Slug string `json:"slug"`
Timestamp time.Time `json:"timestamp"`
Title string `json:"title"`
Thumbnail string `json:"thumbnail"`
Total CurrencyValue `json:"total"`
BuyerId string `json:"buyerId"`
BuyerHandle string `json:"buyerHandle"`
VendorId string `json:"vendorId"`
VendorHandle string `json:"vendorHandle"`
CoinType string `json:"coinType"`
PaymentCoin string `json:"paymentCoin"`
BuyerOpened bool `json:"buyerOpened"`
State string `json:"state"`
Read bool `json:"read"`
UnreadChatMessages int `json:"unreadChatMessages"`
}
type UnfundedOrder struct {
OrderId string
Timestamp time.Time
PaymentCoin string
PaymentAddress string
}
type OrderMessage struct {
MessageID string `json:"messageID"`
OrderID string `json:"orderID"`
MessageType int32 `json:"message_type"`
Message []byte `json:"message"`
MsgErr string `json:"error"`
PeerID string `json:"peerID"`
PeerPubkey []byte `json:"pubkey"`
}