mirror of
https://github.com/Qortal/qortal.git
synced 2025-06-17 13:21:21 +00:00
No need for DB.executeUsingBytes as it was only a specific use-case for DB.checkedExecute. Callers now refactored to use DB.checkedExecute instead. Minor tidying up of BlockTransactions in light of above. In the HSQLDB database, asset keys/IDs are now "asset_id" (previously: "asset"). Added initial Asset/Order/Trade classes. Added CreateOrderTransaction class. Renamed some asset-related fields back to old gen1 names, e.g. haveAmount -> amount, wantAmount -> price. Added Accounts and AccountBalances to database. Added get/set confirmed balance support to Account. Added get/set last reference support to Account. Added Block.toJSON() - untested at this time. Fleshed out some Transaction sub-classes' process() and orphan() methods. Fleshed out PaymentTransaction.isValid(). Added Transaction.delete() - untested.
48 lines
817 B
Java
48 lines
817 B
Java
package qora.assets;
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigInteger;
|
|
|
|
public class Trade {
|
|
|
|
// Properties
|
|
private BigInteger initiator;
|
|
private BigInteger target;
|
|
private BigDecimal amount;
|
|
private BigDecimal price;
|
|
private long timestamp;
|
|
|
|
// Constructors
|
|
|
|
public Trade(BigInteger initiator, BigInteger target, BigDecimal amount, BigDecimal price, long timestamp) {
|
|
this.initiator = initiator;
|
|
this.target = target;
|
|
this.amount = amount;
|
|
this.price = price;
|
|
this.timestamp = timestamp;
|
|
}
|
|
|
|
// Getters/setters
|
|
|
|
public BigInteger getInitiator() {
|
|
return initiator;
|
|
}
|
|
|
|
public BigInteger getTarget() {
|
|
return target;
|
|
}
|
|
|
|
public BigDecimal getAmount() {
|
|
return amount;
|
|
}
|
|
|
|
public BigDecimal getPrice() {
|
|
return price;
|
|
}
|
|
|
|
public long getTimestamp() {
|
|
return timestamp;
|
|
}
|
|
|
|
}
|