mirror of
https://github.com/Qortal/qortal.git
synced 2025-02-11 17:55:50 +00:00
Transaction-specific info in API results
This commit is contained in:
parent
cfd8b53fc1
commit
dcd19f8e42
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,3 +1,7 @@
|
||||
/db*
|
||||
/bin/
|
||||
/target/
|
||||
/log.txt.*
|
||||
/arbitrary*
|
||||
/Qora-BTC*
|
||||
/.factorypath
|
||||
|
@ -3,6 +3,8 @@ package api.models;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
|
||||
import api.ApiError;
|
||||
@ -15,6 +17,7 @@ import repository.DataException;
|
||||
import repository.Repository;
|
||||
|
||||
@Schema(description = "Block with (optional) transactions")
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class BlockWithTransactions {
|
||||
|
||||
@Schema(implementation = BlockData.class, name = "block", title = "block data")
|
||||
@ -24,8 +27,7 @@ public class BlockWithTransactions {
|
||||
public List<TransactionData> transactions;
|
||||
|
||||
// For JAX-RS
|
||||
@SuppressWarnings("unused")
|
||||
private BlockWithTransactions() {
|
||||
protected BlockWithTransactions() {
|
||||
}
|
||||
|
||||
public BlockWithTransactions(Repository repository, BlockData blockData, boolean includeTransactions) throws DataException {
|
||||
|
15
src/api/models/TransactionClassExtractor.java
Normal file
15
src/api/models/TransactionClassExtractor.java
Normal file
@ -0,0 +1,15 @@
|
||||
package api.models;
|
||||
|
||||
import org.eclipse.persistence.descriptors.ClassExtractor;
|
||||
import org.eclipse.persistence.sessions.Record;
|
||||
import org.eclipse.persistence.sessions.Session;
|
||||
|
||||
public class TransactionClassExtractor extends ClassExtractor {
|
||||
|
||||
@Override
|
||||
public Class extractClassFromRow(Record record, Session session) {
|
||||
// Never called anyway?
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
@ -2,6 +2,11 @@ package data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
//All properties to be converted to JSON via JAX-RS
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class PaymentData {
|
||||
|
||||
// Properties
|
||||
@ -11,6 +16,10 @@ public class PaymentData {
|
||||
|
||||
// Constructors
|
||||
|
||||
// For JAX-RS
|
||||
protected PaymentData() {
|
||||
}
|
||||
|
||||
public PaymentData(String recipient, long assetId, BigDecimal amount) {
|
||||
this.recipient = recipient;
|
||||
this.assetId = assetId;
|
||||
|
@ -2,9 +2,16 @@ package data.transaction;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import qora.account.GenesisAccount;
|
||||
import qora.transaction.Transaction.TransactionType;
|
||||
|
||||
// All properties to be converted to JSON via JAX-RS
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@Schema(allOf = { TransactionData.class })
|
||||
public class ATTransactionData extends TransactionData {
|
||||
|
||||
// Properties
|
||||
@ -16,6 +23,10 @@ public class ATTransactionData extends TransactionData {
|
||||
|
||||
// Constructors
|
||||
|
||||
// For JAX-RS
|
||||
protected ATTransactionData() {
|
||||
}
|
||||
|
||||
public ATTransactionData(String atAddress, String recipient, BigDecimal amount, Long assetId, byte[] message, BigDecimal fee, long timestamp,
|
||||
byte[] reference, byte[] signature) {
|
||||
super(TransactionType.AT, fee, GenesisAccount.PUBLIC_KEY, timestamp, reference, signature);
|
||||
|
@ -3,9 +3,16 @@ package data.transaction;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
import data.PaymentData;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import qora.transaction.Transaction.TransactionType;
|
||||
|
||||
// All properties to be converted to JSON via JAX-RS
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@Schema(allOf = { TransactionData.class })
|
||||
public class ArbitraryTransactionData extends TransactionData {
|
||||
|
||||
// "data" field types
|
||||
@ -24,6 +31,10 @@ public class ArbitraryTransactionData extends TransactionData {
|
||||
|
||||
// Constructors
|
||||
|
||||
// For JAX-RS
|
||||
protected ArbitraryTransactionData() {
|
||||
}
|
||||
|
||||
/** Reconstructing a V3 arbitrary transaction with signature */
|
||||
public ArbitraryTransactionData(int version, byte[] senderPublicKey, int service, byte[] data, DataType dataType, List<PaymentData> payments,
|
||||
BigDecimal fee, long timestamp, byte[] reference, byte[] signature) {
|
||||
|
@ -2,8 +2,15 @@ package data.transaction;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import qora.transaction.Transaction.TransactionType;
|
||||
|
||||
// All properties to be converted to JSON via JAX-RS
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@Schema(allOf = { TransactionData.class })
|
||||
public class BuyNameTransactionData extends TransactionData {
|
||||
|
||||
// Properties
|
||||
@ -15,6 +22,10 @@ public class BuyNameTransactionData extends TransactionData {
|
||||
|
||||
// Constructors
|
||||
|
||||
// For JAX-RS
|
||||
protected BuyNameTransactionData() {
|
||||
}
|
||||
|
||||
public BuyNameTransactionData(byte[] buyerPublicKey, String name, BigDecimal amount, String seller, byte[] nameReference, BigDecimal fee, long timestamp,
|
||||
byte[] reference, byte[] signature) {
|
||||
super(TransactionType.BUY_NAME, fee, buyerPublicKey, timestamp, reference, signature);
|
||||
|
@ -2,8 +2,15 @@ package data.transaction;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import qora.transaction.Transaction;
|
||||
|
||||
// All properties to be converted to JSON via JAX-RS
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@Schema(allOf = { TransactionData.class })
|
||||
public class CancelOrderTransactionData extends TransactionData {
|
||||
|
||||
// Properties
|
||||
@ -11,6 +18,10 @@ public class CancelOrderTransactionData extends TransactionData {
|
||||
|
||||
// Constructors
|
||||
|
||||
// For JAX-RS
|
||||
protected CancelOrderTransactionData() {
|
||||
}
|
||||
|
||||
public CancelOrderTransactionData(byte[] creatorPublicKey, byte[] orderId, BigDecimal fee, long timestamp, byte[] reference, byte[] signature) {
|
||||
super(Transaction.TransactionType.CANCEL_ASSET_ORDER, fee, creatorPublicKey, timestamp, reference, signature);
|
||||
|
||||
|
@ -2,8 +2,15 @@ package data.transaction;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import qora.transaction.Transaction.TransactionType;
|
||||
|
||||
// All properties to be converted to JSON via JAX-RS
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@Schema(allOf = { TransactionData.class })
|
||||
public class CancelSellNameTransactionData extends TransactionData {
|
||||
|
||||
// Properties
|
||||
@ -12,6 +19,10 @@ public class CancelSellNameTransactionData extends TransactionData {
|
||||
|
||||
// Constructors
|
||||
|
||||
// For JAX-RS
|
||||
protected CancelSellNameTransactionData() {
|
||||
}
|
||||
|
||||
public CancelSellNameTransactionData(byte[] ownerPublicKey, String name, BigDecimal fee, long timestamp, byte[] reference, byte[] signature) {
|
||||
super(TransactionType.CANCEL_SELL_NAME, fee, ownerPublicKey, timestamp, reference, signature);
|
||||
|
||||
|
@ -2,8 +2,15 @@ package data.transaction;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import qora.transaction.Transaction.TransactionType;
|
||||
|
||||
// All properties to be converted to JSON via JAX-RS
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@Schema(allOf = { TransactionData.class })
|
||||
public class CreateOrderTransactionData extends TransactionData {
|
||||
|
||||
// Properties
|
||||
@ -14,6 +21,10 @@ public class CreateOrderTransactionData extends TransactionData {
|
||||
|
||||
// Constructors
|
||||
|
||||
// For JAX-RS
|
||||
protected CreateOrderTransactionData() {
|
||||
}
|
||||
|
||||
public CreateOrderTransactionData(byte[] creatorPublicKey, long haveAssetId, long wantAssetId, BigDecimal amount, BigDecimal price, BigDecimal fee,
|
||||
long timestamp, byte[] reference, byte[] signature) {
|
||||
super(TransactionType.CREATE_ASSET_ORDER, fee, creatorPublicKey, timestamp, reference, signature);
|
||||
|
@ -3,9 +3,16 @@ package data.transaction;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
import data.voting.PollOptionData;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import qora.transaction.Transaction;
|
||||
|
||||
// All properties to be converted to JSON via JAX-RS
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@Schema(allOf = { TransactionData.class })
|
||||
public class CreatePollTransactionData extends TransactionData {
|
||||
|
||||
// Properties
|
||||
@ -16,6 +23,10 @@ public class CreatePollTransactionData extends TransactionData {
|
||||
|
||||
// Constructors
|
||||
|
||||
// For JAX-RS
|
||||
protected CreatePollTransactionData() {
|
||||
}
|
||||
|
||||
public CreatePollTransactionData(byte[] creatorPublicKey, String owner, String pollName, String description, List<PollOptionData> pollOptions,
|
||||
BigDecimal fee, long timestamp, byte[] reference, byte[] signature) {
|
||||
super(Transaction.TransactionType.CREATE_POLL, fee, creatorPublicKey, timestamp, reference, signature);
|
||||
|
@ -2,8 +2,15 @@ package data.transaction;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import qora.transaction.Transaction.TransactionType;
|
||||
|
||||
// All properties to be converted to JSON via JAX-RS
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@Schema(allOf = { TransactionData.class })
|
||||
public class DeployATTransactionData extends TransactionData {
|
||||
|
||||
// Properties
|
||||
@ -18,6 +25,10 @@ public class DeployATTransactionData extends TransactionData {
|
||||
|
||||
// Constructors
|
||||
|
||||
// For JAX-RS
|
||||
protected DeployATTransactionData() {
|
||||
}
|
||||
|
||||
public DeployATTransactionData(String ATAddress, byte[] creatorPublicKey, String name, String description, String ATType, String tags, byte[] creationBytes,
|
||||
BigDecimal amount, long assetId, BigDecimal fee, long timestamp, byte[] reference, byte[] signature) {
|
||||
super(TransactionType.DEPLOY_AT, fee, creatorPublicKey, timestamp, reference, signature);
|
||||
|
@ -11,7 +11,7 @@ import qora.transaction.Transaction.TransactionType;
|
||||
|
||||
// All properties to be converted to JSON via JAX-RS
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@Schema( allOf = { TransactionData.class } )
|
||||
@Schema(allOf = { TransactionData.class })
|
||||
public class GenesisTransactionData extends TransactionData {
|
||||
|
||||
// Properties
|
||||
|
@ -2,8 +2,15 @@ package data.transaction;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import qora.transaction.Transaction.TransactionType;
|
||||
|
||||
// All properties to be converted to JSON via JAX-RS
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@Schema(allOf = { TransactionData.class })
|
||||
public class IssueAssetTransactionData extends TransactionData {
|
||||
|
||||
// Properties
|
||||
@ -18,6 +25,10 @@ public class IssueAssetTransactionData extends TransactionData {
|
||||
|
||||
// Constructors
|
||||
|
||||
// For JAX-RS
|
||||
protected IssueAssetTransactionData() {
|
||||
}
|
||||
|
||||
public IssueAssetTransactionData(Long assetId, byte[] issuerPublicKey, String owner, String assetName, String description, long quantity,
|
||||
boolean isDivisible, BigDecimal fee, long timestamp, byte[] reference, byte[] signature) {
|
||||
super(TransactionType.ISSUE_ASSET, fee, issuerPublicKey, timestamp, reference, signature);
|
||||
|
@ -2,9 +2,16 @@ package data.transaction;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import qora.assets.Asset;
|
||||
import qora.transaction.Transaction.TransactionType;
|
||||
|
||||
// All properties to be converted to JSON via JAX-RS
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@Schema(allOf = { TransactionData.class })
|
||||
public class MessageTransactionData extends TransactionData {
|
||||
|
||||
// Properties
|
||||
@ -19,6 +26,10 @@ public class MessageTransactionData extends TransactionData {
|
||||
|
||||
// Constructors
|
||||
|
||||
// For JAX-RS
|
||||
protected MessageTransactionData() {
|
||||
}
|
||||
|
||||
public MessageTransactionData(int version, byte[] senderPublicKey, String recipient, Long assetId, BigDecimal amount, byte[] data, boolean isText,
|
||||
boolean isEncrypted, BigDecimal fee, long timestamp, byte[] reference, byte[] signature) {
|
||||
super(TransactionType.MESSAGE, fee, senderPublicKey, timestamp, reference, signature);
|
||||
|
@ -3,9 +3,16 @@ package data.transaction;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
import data.PaymentData;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import qora.transaction.Transaction;
|
||||
|
||||
// All properties to be converted to JSON via JAX-RS
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@Schema(allOf = { TransactionData.class })
|
||||
public class MultiPaymentTransactionData extends TransactionData {
|
||||
|
||||
// Properties
|
||||
@ -14,6 +21,10 @@ public class MultiPaymentTransactionData extends TransactionData {
|
||||
|
||||
// Constructors
|
||||
|
||||
// For JAX-RS
|
||||
protected MultiPaymentTransactionData() {
|
||||
}
|
||||
|
||||
public MultiPaymentTransactionData(byte[] senderPublicKey, List<PaymentData> payments, BigDecimal fee, long timestamp, byte[] reference, byte[] signature) {
|
||||
super(Transaction.TransactionType.MULTIPAYMENT, fee, senderPublicKey, timestamp, reference, signature);
|
||||
|
||||
|
@ -2,8 +2,15 @@ package data.transaction;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import qora.transaction.Transaction.TransactionType;
|
||||
|
||||
// All properties to be converted to JSON via JAX-RS
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@Schema(allOf = { TransactionData.class })
|
||||
public class RegisterNameTransactionData extends TransactionData {
|
||||
|
||||
// Properties
|
||||
@ -14,6 +21,10 @@ public class RegisterNameTransactionData extends TransactionData {
|
||||
|
||||
// Constructors
|
||||
|
||||
// For JAX-RS
|
||||
protected RegisterNameTransactionData() {
|
||||
}
|
||||
|
||||
public RegisterNameTransactionData(byte[] registrantPublicKey, String owner, String name, String data, BigDecimal fee, long timestamp, byte[] reference,
|
||||
byte[] signature) {
|
||||
super(TransactionType.REGISTER_NAME, fee, registrantPublicKey, timestamp, reference, signature);
|
||||
|
@ -2,8 +2,15 @@ package data.transaction;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import qora.transaction.Transaction.TransactionType;
|
||||
|
||||
// All properties to be converted to JSON via JAX-RS
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@Schema(allOf = { TransactionData.class })
|
||||
public class SellNameTransactionData extends TransactionData {
|
||||
|
||||
// Properties
|
||||
@ -13,6 +20,10 @@ public class SellNameTransactionData extends TransactionData {
|
||||
|
||||
// Constructors
|
||||
|
||||
// For JAX-RS
|
||||
protected SellNameTransactionData() {
|
||||
}
|
||||
|
||||
public SellNameTransactionData(byte[] ownerPublicKey, String name, BigDecimal amount, BigDecimal fee, long timestamp, byte[] reference, byte[] signature) {
|
||||
super(TransactionType.SELL_NAME, fee, ownerPublicKey, timestamp, reference, signature);
|
||||
|
||||
|
@ -6,10 +6,27 @@ import java.util.Arrays;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlSeeAlso;
|
||||
|
||||
import org.eclipse.persistence.oxm.annotations.XmlClassExtractor;
|
||||
|
||||
import api.models.TransactionClassExtractor;
|
||||
import qora.transaction.Transaction.TransactionType;
|
||||
|
||||
// All properties to be converted to JSON via JAX-RS
|
||||
/*
|
||||
* If you encounter an error like:
|
||||
*
|
||||
* MessageBodyWriter not found for <some class>
|
||||
*
|
||||
* then chances are that class is missing a no-argument constructor!
|
||||
*/
|
||||
|
||||
@XmlClassExtractor(TransactionClassExtractor.class)
|
||||
@XmlSeeAlso({ArbitraryTransactionData.class, ATTransactionData.class, BuyNameTransactionData.class, CancelOrderTransactionData.class, CancelSellNameTransactionData.class,
|
||||
CreateOrderTransactionData.class, CreatePollTransactionData.class, DeployATTransactionData.class, GenesisTransactionData.class, IssueAssetTransactionData.class,
|
||||
MessageTransactionData.class, MultiPaymentTransactionData.class, PaymentTransactionData.class, RegisterNameTransactionData.class, SellNameTransactionData.class,
|
||||
TransferAssetTransactionData.class, UpdateNameTransactionData.class, VoteOnPollTransactionData.class})
|
||||
//All properties to be converted to JSON via JAX-RS
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public abstract class TransactionData {
|
||||
|
||||
|
@ -2,8 +2,15 @@ package data.transaction;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import qora.transaction.Transaction.TransactionType;
|
||||
|
||||
// All properties to be converted to JSON via JAX-RS
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@Schema(allOf = { TransactionData.class })
|
||||
public class TransferAssetTransactionData extends TransactionData {
|
||||
|
||||
// Properties
|
||||
@ -14,6 +21,10 @@ public class TransferAssetTransactionData extends TransactionData {
|
||||
|
||||
// Constructors
|
||||
|
||||
// For JAX-RS
|
||||
protected TransferAssetTransactionData() {
|
||||
}
|
||||
|
||||
public TransferAssetTransactionData(byte[] senderPublicKey, String recipient, BigDecimal amount, long assetId, BigDecimal fee, long timestamp,
|
||||
byte[] reference, byte[] signature) {
|
||||
super(TransactionType.TRANSFER_ASSET, fee, senderPublicKey, timestamp, reference, signature);
|
||||
|
@ -2,8 +2,15 @@ package data.transaction;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import qora.transaction.Transaction.TransactionType;
|
||||
|
||||
// All properties to be converted to JSON via JAX-RS
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@Schema(allOf = { TransactionData.class })
|
||||
public class UpdateNameTransactionData extends TransactionData {
|
||||
|
||||
// Properties
|
||||
@ -15,6 +22,10 @@ public class UpdateNameTransactionData extends TransactionData {
|
||||
|
||||
// Constructors
|
||||
|
||||
// For JAX-RS
|
||||
protected UpdateNameTransactionData() {
|
||||
}
|
||||
|
||||
public UpdateNameTransactionData(byte[] ownerPublicKey, String newOwner, String name, String newData, byte[] nameReference, BigDecimal fee, long timestamp,
|
||||
byte[] reference, byte[] signature) {
|
||||
super(TransactionType.UPDATE_NAME, fee, ownerPublicKey, timestamp, reference, signature);
|
||||
|
@ -1,8 +1,16 @@
|
||||
package data.transaction;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import qora.transaction.Transaction.TransactionType;
|
||||
|
||||
// All properties to be converted to JSON via JAX-RS
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@Schema(allOf = { TransactionData.class })
|
||||
public class VoteOnPollTransactionData extends TransactionData {
|
||||
|
||||
// Properties
|
||||
@ -13,6 +21,10 @@ public class VoteOnPollTransactionData extends TransactionData {
|
||||
|
||||
// Constructors
|
||||
|
||||
// For JAX-RS
|
||||
protected VoteOnPollTransactionData() {
|
||||
}
|
||||
|
||||
public VoteOnPollTransactionData(byte[] voterPublicKey, String pollName, int optionIndex, Integer previousOptionIndex, BigDecimal fee, long timestamp,
|
||||
byte[] reference, byte[] signature) {
|
||||
super(TransactionType.VOTE_ON_POLL, fee, voterPublicKey, timestamp, reference, signature);
|
||||
|
@ -1,5 +1,10 @@
|
||||
package data.voting;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
//All properties to be converted to JSON via JAX-RS
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class PollOptionData {
|
||||
|
||||
// Properties
|
||||
@ -7,6 +12,10 @@ public class PollOptionData {
|
||||
|
||||
// Constructors
|
||||
|
||||
// For JAX-RS
|
||||
protected PollOptionData() {
|
||||
}
|
||||
|
||||
public PollOptionData(String optionName) {
|
||||
this.optionName = optionName;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user