-
Notifications
You must be signed in to change notification settings - Fork 34
/
Sep6TransactionBuilder.java
205 lines (164 loc) · 5.03 KB
/
Sep6TransactionBuilder.java
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
package org.stellar.anchor.sep6;
import java.time.Instant;
import java.util.List;
import java.util.Map;
import org.stellar.anchor.api.shared.InstructionField;
import org.stellar.anchor.api.shared.Refunds;
public class Sep6TransactionBuilder {
final Sep6Transaction txn;
public Sep6TransactionBuilder(Sep6TransactionStore factory) {
txn = factory.newInstance();
}
public Sep6TransactionBuilder id(String id) {
txn.setId(id);
return this;
}
public Sep6TransactionBuilder transactionId(String txnId) {
txn.setTransactionId(txnId);
return this;
}
public Sep6TransactionBuilder stellarTransactionId(String txnId) {
txn.setStellarTransactionId(txnId);
return this;
}
public Sep6TransactionBuilder externalTransactionId(String txnId) {
txn.setExternalTransactionId(txnId);
return this;
}
public Sep6TransactionBuilder status(String status) {
txn.setStatus(status);
return this;
}
public Sep6TransactionBuilder statusEta(Long statusEta) {
txn.setStatusEta(statusEta);
return this;
}
public Sep6TransactionBuilder moreInfoUrl(String moreInfoUrl) {
txn.setMoreInfoUrl(moreInfoUrl);
return this;
}
public Sep6TransactionBuilder kind(String kind) {
txn.setKind(kind);
return this;
}
public Sep6TransactionBuilder startedAt(Instant time) {
txn.setStartedAt(time);
return this;
}
public Sep6TransactionBuilder completedAt(Instant time) {
txn.setCompletedAt(time);
return this;
}
public Sep6TransactionBuilder type(String type) {
txn.setType(type);
return this;
}
public Sep6TransactionBuilder assetCode(String assetCode) {
txn.setRequestAssetCode(assetCode);
return this;
}
public Sep6TransactionBuilder assetIssuer(String assetIssuer) {
txn.setRequestAssetIssuer(assetIssuer);
return this;
}
public Sep6TransactionBuilder amountIn(String amountIn) {
txn.setAmountIn(amountIn);
return this;
}
public Sep6TransactionBuilder amountInAsset(String amountInAsset) {
txn.setAmountInAsset(amountInAsset);
return this;
}
public Sep6TransactionBuilder amountOut(String amountOut) {
txn.setAmountOut(amountOut);
return this;
}
public Sep6TransactionBuilder amountOutAsset(String amountOutAsset) {
txn.setAmountOutAsset(amountOutAsset);
return this;
}
public Sep6TransactionBuilder amountFee(String amountFee) {
txn.setAmountFee(amountFee);
return this;
}
public Sep6TransactionBuilder amountFeeAsset(String amountFeeAsset) {
txn.setAmountFeeAsset(amountFeeAsset);
return this;
}
public Sep6TransactionBuilder amountExpected(String amountExpected) {
txn.setAmountExpected(amountExpected);
return this;
}
public Sep6TransactionBuilder sep10Account(String sep10Account) {
txn.setSep10Account(sep10Account);
return this;
}
public Sep6TransactionBuilder sep10AccountMemo(String sep10AccountMemo) {
txn.setSep10AccountMemo(sep10AccountMemo);
return this;
}
public Sep6TransactionBuilder withdrawAnchorAccount(String withdrawAnchorAccount) {
txn.setWithdrawAnchorAccount(withdrawAnchorAccount);
return this;
}
public Sep6TransactionBuilder fromAccount(String fromAccount) {
txn.setFromAccount(fromAccount);
return this;
}
public Sep6TransactionBuilder toAccount(String toAccount) {
txn.setToAccount(toAccount);
return this;
}
public Sep6TransactionBuilder memo(String memo) {
txn.setMemo(memo);
return this;
}
public Sep6TransactionBuilder memoType(String memoType) {
txn.setMemoType(memoType);
return this;
}
public Sep6TransactionBuilder quoteId(String quoteId) {
txn.setQuoteId(quoteId);
return this;
}
public Sep6TransactionBuilder message(String message) {
txn.setMessage(message);
return this;
}
public Sep6TransactionBuilder refunds(Refunds refunds) {
txn.setRefunds(refunds);
return this;
}
public Sep6TransactionBuilder refundMemo(String refundMemo) {
txn.setRefundMemo(refundMemo);
return this;
}
public Sep6TransactionBuilder refundMemoType(String refundMemoType) {
txn.setRefundMemoType(refundMemoType);
return this;
}
public Sep6TransactionBuilder requiredInfoMessage(String requiredInfoMessage) {
txn.setRequiredInfoMessage(requiredInfoMessage);
return this;
}
public Sep6TransactionBuilder requiredInfoUpdates(List<String> requiredInfoUpdates) {
txn.setRequiredInfoUpdates(requiredInfoUpdates);
return this;
}
public Sep6TransactionBuilder requiredCustomerInfoMessage(String requiredCustomerInfoMessage) {
txn.setRequiredCustomerInfoMessage(requiredCustomerInfoMessage);
return this;
}
public Sep6TransactionBuilder requiredCustomerInfoUpdates(
List<String> requiredCustomerInfoUpdates) {
txn.setRequiredCustomerInfoUpdates(requiredCustomerInfoUpdates);
return this;
}
public Sep6TransactionBuilder instructions(Map<String, InstructionField> instructions) {
txn.setInstructions(instructions);
return this;
}
public Sep6Transaction build() {
return txn;
}
}