forked from bitsoex/bitso-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBitsoTransferQuote.java
More file actions
30 lines (24 loc) · 838 Bytes
/
Copy pathBitsoTransferQuote.java
File metadata and controls
30 lines (24 loc) · 838 Bytes
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
package com.bitso;
import java.math.BigDecimal;
import org.json.JSONObject;
import com.bitso.helpers.Helpers;
public class BitsoTransferQuote {
public BigDecimal gross;
public BigDecimal rate;
public BigDecimal btcAmount;
public String currency;
public long timestamp;
public long expiresEpoch;
public BitsoTransferQuote(JSONObject json) {
JSONObject o = json.getJSONObject("quote");
gross = new BigDecimal(o.getString("gross"));
rate = new BigDecimal(o.getString("rate"));
btcAmount = new BigDecimal(o.getString("btc_amount"));
currency = o.getString("currency");
timestamp = Long.valueOf(o.getString("timestamp"));
expiresEpoch = o.getLong("expires_epoch");
}
public String toString() {
return Helpers.fieldPrinter(this);
}
}