public class TransactionHeader extends Object
AccountTransaction.| Modifier and Type | Class and Description |
|---|---|
static class |
TransactionHeader.TransactionHeaderBuilder |
| Modifier and Type | Field and Description |
|---|---|
static int |
BYTES |
static int |
COST_CONSTANT_A
The "A" constant for NRG assignment.
|
static int |
COST_CONSTANT_B
The "B" constant for NRG assignment.
|
| Constructor and Description |
|---|
TransactionHeader(@NonNull AccountAddress sender,
@NonNull Nonce nonce,
@NonNull UInt64 maxEnergyCost,
@NonNull UInt32 payloadSize,
@NonNull Expiry expiry) |
| Modifier and Type | Method and Description |
|---|---|
static TransactionHeader.TransactionHeaderBuilder |
builder() |
static UInt64 |
calculateMaxEnergyCost(int signatureCount,
int payloadSize,
UInt64 transactionSpecificCost)
Calculate the maximum amount of energy that can be spent on executing a transaction.
|
protected boolean |
canEqual(Object other) |
boolean |
equals(Object o) |
static TransactionHeader |
fromBytes(ByteBuffer source) |
@NonNull Expiry |
getExpiry()
A Unix timestamp indicating when the transaction should expire.
|
@NonNull UInt64 |
getMaxEnergyCost()
The amount of energy allocated for executing this transaction.
|
@NonNull Nonce |
getNonce()
The sequence number of the transaction, sender (source) account nonce.
|
@NonNull UInt32 |
getPayloadSize()
The size of the transaction payload in bytes.
|
@NonNull AccountAddress |
getSender()
The address of the account that is the source of the transaction.
|
int |
hashCode() |
TransactionHeader.TransactionHeaderBuilder |
toBuilder() |
String |
toString() |
public static final int COST_CONSTANT_A
public static final int COST_CONSTANT_B
public static int BYTES
public TransactionHeader(@NonNull
@NonNull AccountAddress sender,
@NonNull
@NonNull Nonce nonce,
@NonNull
@NonNull UInt64 maxEnergyCost,
@NonNull
@NonNull UInt32 payloadSize,
@NonNull
@NonNull Expiry expiry)
public static TransactionHeader fromBytes(ByteBuffer source)
public static UInt64 calculateMaxEnergyCost(int signatureCount, int payloadSize, UInt64 transactionSpecificCost)
signatureCount - number of signatures in the transaction (TransactionSigner.size())payloadSize - size of the transaction payload in bytestransactionSpecificCost - cost of the specific transaction (payload) typeTransactionTypeCostpublic static TransactionHeader.TransactionHeaderBuilder builder()
public TransactionHeader.TransactionHeaderBuilder toBuilder()
@NonNull public @NonNull AccountAddress getSender()
@NonNull public @NonNull Nonce getNonce()
@NonNull public @NonNull UInt64 getMaxEnergyCost()
calculateMaxEnergyCost(int, int, UInt64)@NonNull public @NonNull UInt32 getPayloadSize()
@NonNull public @NonNull Expiry getExpiry()
protected boolean canEqual(Object other)
Copyright © 2026. All rights reserved.