-
Notifications
You must be signed in to change notification settings - Fork 0
/
payment.go
75 lines (65 loc) · 2.2 KB
/
payment.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
package models
import (
"time"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type StatusObject struct {
Description string `json:"description,omitempty"`
Success bool `json:"success,omitempty"`
Error string `json:"error,omitempty"`
}
// SetTrustObject - used to handle json input
type SetTrustObject struct {
StatusObject
Account Account `json:"account"`
Asset Asset `json:"asset"`
Limit string `json:"limit,omitempty"`
}
// SetOptionsObject - used to handle json input
type SetOptionsObject struct {
StatusObject
MainAccount Account `json:"mainaccount"`
SignerAccount Account `json:"signeraccount,omitempty"`
Thresholds *ThresholdObject `json:"thresholds,omitempty"`
Weight int `json:"weight,omitempty"`
}
type ThresholdObject struct {
LowThreshold int `json:"lowthreshold"`
MediumThreshold int `json:"mediumthreshold"`
HighThreshold int `json:"highthreshold"`
}
// PaymentObject - used to handle json input
type PaymentObject struct {
StatusObject
FromAccount Account `json:"fromaccount"`
ToAccount Account `json:"toaccount"`
Asset Asset `json:"asset"`
Amount string `json:"amount"`
}
// SignObject - used to handle json input
type SignObject struct {
StatusObject
Transaction Transaction `json:"transaction,omitempty"`
SignerAccount Account `json:"signeraccount,omitempty"`
}
// TransObject - used to handle json input
type TransObject struct {
TransactionId primitive.ObjectID `json:"transactionid"`
Created time.Time `json:"created"`
Modified time.Time `json:"modified"`
Status string `json:"status"`
SourceAccount Account `json:"sourceaccount"`
MaxTime string `json:"maxtime"`
Envelope string `json:"envelope"`
TransactionWeight int `json:"transactionweight"`
CurrentWeight int `json:"currentweight"`
}
// OfferObject - used to handle json input
type OfferObject struct {
StatusObject
Seller Account `json:"seller"`
Selling Asset `json:"selling"`
Buying Asset `json:"buying"`
Amount string `json:"amount"`
Price string `json:"price"`
}