mirror of
https://github.com/Qortal/qortal.git
synced 2025-05-06 01:37:51 +00:00
Include memo for incoming ARRR transactions.
This commit is contained in:
parent
57acf7dffe
commit
830a608b14
@ -534,7 +534,7 @@ public abstract class Bitcoiny implements ForeignBlockchain {
|
|||||||
amount = 0;
|
amount = 0;
|
||||||
}
|
}
|
||||||
long timestampMillis = t.timestamp * 1000L;
|
long timestampMillis = t.timestamp * 1000L;
|
||||||
return new SimpleTransaction(t.txHash, timestampMillis, amount, fee, inputs, outputs);
|
return new SimpleTransaction(t.txHash, timestampMillis, amount, fee, inputs, outputs, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -296,6 +296,7 @@ public class PirateChain extends Bitcoiny {
|
|||||||
Long timestamp = transactionJson.getLong("datetime");
|
Long timestamp = transactionJson.getLong("datetime");
|
||||||
Long amount = transactionJson.getLong("amount");
|
Long amount = transactionJson.getLong("amount");
|
||||||
Long fee = transactionJson.getLong("fee");
|
Long fee = transactionJson.getLong("fee");
|
||||||
|
String memo = null;
|
||||||
|
|
||||||
if (transactionJson.has("incoming_metadata")) {
|
if (transactionJson.has("incoming_metadata")) {
|
||||||
JSONArray incomingMetadatas = transactionJson.getJSONArray("incoming_metadata");
|
JSONArray incomingMetadatas = transactionJson.getJSONArray("incoming_metadata");
|
||||||
@ -305,10 +306,12 @@ public class PirateChain extends Bitcoiny {
|
|||||||
if (incomingMetadata.has("value")) {
|
if (incomingMetadata.has("value")) {
|
||||||
//String address = incomingMetadata.getString("address");
|
//String address = incomingMetadata.getString("address");
|
||||||
Long value = incomingMetadata.getLong("value");
|
Long value = incomingMetadata.getLong("value");
|
||||||
//String memo = incomingMetadata.getString("memo");
|
|
||||||
|
|
||||||
amount = value; // TODO: figure out how to parse transactions with multiple incomingMetadata entries
|
amount = value; // TODO: figure out how to parse transactions with multiple incomingMetadata entries
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (incomingMetadata.has("memo") && !incomingMetadata.isNull("memo")) {
|
||||||
|
memo = incomingMetadata.getString("memo");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -316,7 +319,7 @@ public class PirateChain extends Bitcoiny {
|
|||||||
// TODO: JSONArray outgoingMetadatas = transactionJson.getJSONArray("outgoing_metadata");
|
// TODO: JSONArray outgoingMetadatas = transactionJson.getJSONArray("outgoing_metadata");
|
||||||
|
|
||||||
long timestampMillis = Math.toIntExact(timestamp) * 1000L;
|
long timestampMillis = Math.toIntExact(timestamp) * 1000L;
|
||||||
SimpleTransaction transaction = new SimpleTransaction(txId, timestampMillis, amount, fee, null, null);
|
SimpleTransaction transaction = new SimpleTransaction(txId, timestampMillis, amount, fee, null, null, memo);
|
||||||
transactions.add(transaction);
|
transactions.add(transaction);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ public class SimpleTransaction {
|
|||||||
private long feeAmount;
|
private long feeAmount;
|
||||||
private List<Input> inputs;
|
private List<Input> inputs;
|
||||||
private List<Output> outputs;
|
private List<Output> outputs;
|
||||||
|
private String memo;
|
||||||
|
|
||||||
|
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
@ -74,13 +75,14 @@ public class SimpleTransaction {
|
|||||||
public SimpleTransaction() {
|
public SimpleTransaction() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public SimpleTransaction(String txHash, Long timestamp, long totalAmount, long feeAmount, List<Input> inputs, List<Output> outputs) {
|
public SimpleTransaction(String txHash, Long timestamp, long totalAmount, long feeAmount, List<Input> inputs, List<Output> outputs, String memo) {
|
||||||
this.txHash = txHash;
|
this.txHash = txHash;
|
||||||
this.timestamp = timestamp;
|
this.timestamp = timestamp;
|
||||||
this.totalAmount = totalAmount;
|
this.totalAmount = totalAmount;
|
||||||
this.feeAmount = feeAmount;
|
this.feeAmount = feeAmount;
|
||||||
this.inputs = inputs;
|
this.inputs = inputs;
|
||||||
this.outputs = outputs;
|
this.outputs = outputs;
|
||||||
|
this.memo = memo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTxHash() {
|
public String getTxHash() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user