Interface Transaction

All Known Subinterfaces:
AccountDelete, AccountSet, AmmBid, AmmClawback, AmmCreate, AmmDelete, AmmDeposit, AmmVote, AmmWithdraw, Batch, CheckCancel, CheckCash, CheckCreate, Clawback, CredentialAccept, CredentialCreate, CredentialDelete, DelegateSet, DepositPreAuth, DidDelete, DidSet, EnableAmendment, EscrowCancel, EscrowCreate, EscrowFinish, MpTokenAuthorize, MpTokenIssuanceCreate, MpTokenIssuanceDestroy, MpTokenIssuanceSet, NfTokenAcceptOffer, NfTokenBurn, NfTokenCancelOffer, NfTokenCreateOffer, NfTokenMint, OfferCancel, OfferCreate, OracleDelete, OracleSet, Payment, PaymentChannelClaim, PaymentChannelCreate, PaymentChannelFund, PermissionedDomainDelete, PermissionedDomainSet, SetFee, SetRegularKey, SignerListSet, TicketCreate, TrustSet, UnknownTransaction, UnlModify, XChainAccountCreateCommit, XChainAddAccountCreateAttestation, XChainAddClaimAttestation, XChainClaim, XChainCommit, XChainCreateBridge, XChainCreateClaimId, XChainModifyBridge
All Known Implementing Classes:
ImmutableAccountDelete, ImmutableAccountSet, ImmutableAmmBid, ImmutableAmmClawback, ImmutableAmmCreate, ImmutableAmmDelete, ImmutableAmmDeposit, ImmutableAmmVote, ImmutableAmmWithdraw, ImmutableBatch, ImmutableCheckCancel, ImmutableCheckCash, ImmutableCheckCreate, ImmutableClawback, ImmutableCredentialAccept, ImmutableCredentialCreate, ImmutableCredentialDelete, ImmutableDelegateSet, ImmutableDepositPreAuth, ImmutableDidDelete, ImmutableDidSet, ImmutableEnableAmendment, ImmutableEscrowCancel, ImmutableEscrowCreate, ImmutableEscrowFinish, ImmutableMpTokenAuthorize, ImmutableMpTokenIssuanceCreate, ImmutableMpTokenIssuanceDestroy, ImmutableMpTokenIssuanceSet, ImmutableNfTokenAcceptOffer, ImmutableNfTokenBurn, ImmutableNfTokenCancelOffer, ImmutableNfTokenCreateOffer, ImmutableNfTokenMint, ImmutableOfferCancel, ImmutableOfferCreate, ImmutableOracleDelete, ImmutableOracleSet, ImmutablePayment, ImmutablePaymentChannelClaim, ImmutablePaymentChannelCreate, ImmutablePaymentChannelFund, ImmutablePermissionedDomainDelete, ImmutablePermissionedDomainSet, ImmutableSetFee, ImmutableSetRegularKey, ImmutableSignerListSet, ImmutableTicketCreate, ImmutableTrustSet, ImmutableUnknownTransaction, ImmutableUnlModify, ImmutableXChainAccountCreateCommit, ImmutableXChainAddAccountCreateAttestation, ImmutableXChainAddClaimAttestation, ImmutableXChainClaim, ImmutableXChainCommit, ImmutableXChainCreateBridge, ImmutableXChainCreateClaimId, ImmutableXChainModifyBridge

public interface Transaction
Provides an abstract interface for all concrete XRPL transactions.
  • Field Details

    • typeMap

      static final com.google.common.collect.BiMap<Class<? extends Transaction>,TransactionType> typeMap
      A bidirectional map of immutable transaction types to their corresponding TransactionType.

      This is useful for polymorphic Jackson deserialization.

  • Method Details

    • account

      Address account()
      The unique Address of the account that initiated this transaction.
      Returns:
      The Address of the account submitting this transaction.
    • transactionType

      @Default default TransactionType transactionType()
      The type of transaction.
      Returns:
      A TransactionType.
    • fee

      The String representation of an integer amount of XRP, in drops, to be destroyed as a cost for distributing this Payment transaction to the network.

      This field is auto-fillable

      Returns:
      An XrpCurrencyAmount representing the transaction cost.
      See Also:
      • "https://xrpl.org/transaction-common-fields.html#auto-fillable-fields"
    • sequence

      @Default default com.google.common.primitives.UnsignedInteger sequence()
      The sequence number of the account submitting the Transaction. A Transaction is only valid if the Sequence number is exactly 1 greater than the previous transaction from the same account.

      This field is auto-fillable

      Returns:
      An UnsignedInteger representing the sequence of the transaction.
      See Also:
      • "https://xrpl.org/transaction-common-fields.html#auto-fillable-fields"
    • ticketSequence

      Optional<com.google.common.primitives.UnsignedInteger> ticketSequence()
      The sequence number of the TicketObject to use in place of a sequence() number. If this is provided, sequence() must be 0. Cannot be used with accountTransactionId().
      Returns:
      An UnsignedInteger representing the ticket sequence of the transaction.
    • accountTransactionId

      Optional<Hash256> accountTransactionId()
      Hash value identifying another transaction. If provided, this Transaction is only valid if the sending account's previously-sent transaction matches the provided hash.
      Returns:
      An Optional of type Hash256 containing the account transaction ID.
    • lastLedgerSequence

      Optional<com.google.common.primitives.UnsignedInteger> lastLedgerSequence()
      Highest ledger index this transaction can appear in. Specifying this field places a strict upper limit on how long the transaction can wait to be validated or rejected.
      Returns:
      An Optional of type UnsignedInteger representing the last ledger sequence.
    • memos

      List<MemoWrapper> memos()
      Additional arbitrary information used to identify this Transaction.
      Returns:
      A List of MemoWrappers.
    • signers

      List<SignerWrapper> signers()
      Array of SignerWrappers that represent a multi-signature which authorizes this Transaction.
      Returns:
      A List of SignerWrappers.
    • sourceTag

      Optional<com.google.common.primitives.UnsignedInteger> sourceTag()
      Arbitrary UnsignedInteger used to identify the reason for this Transaction, or a sender on whose behalf this Transaction is made.
      Returns:
      An Optional UnsignedInteger representing the source account's tag.
    • signingPublicKey

      @Default default PublicKey signingPublicKey()
      The PublicKey that corresponds to the private key used to sign this transaction. If an empty string, ie PublicKey.MULTI_SIGN_PUBLIC_KEY, indicates a multi-signature is present in the signers() field instead.
      Returns:
      A PublicKey containing the public key of the account submitting the transaction, or PublicKey.MULTI_SIGN_PUBLIC_KEY if the transaction is multi-signed.
    • transactionSignature

      Optional<Signature> transactionSignature()
      The signature that verifies this transaction as originating from the account it says it is from.

      This field is automatically added when signing this Transaction.

      Returns:
      An Optional String containing the transaction signature.
    • networkId

      Optional<NetworkId> networkId()
    • delegate

      Optional<Address> delegate()
      The delegate account that is sending the transaction on behalf of the account().

      The way the Delegate field works is somewhat akin to RegularKey. The account() field is the delegating account, the Delegate field is the delegate, and the signingPublicKey() and transactionSignature() are based on the delegate's keys.

      If a Delegate has multisign enabled, they can also use that multisign setup on their delegated transactions.

      The delegate will pay the fees on the transaction, to prevent a delegate from draining an account's XRP via fees. Only the account()'s sequence number is incremented, not the Delegate's.

      This field is part of the Permission Delegation feature (XLS-75).

      Returns:
      An Optional Address of the delegate account.
      See Also:
      • "https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0075-permission-delegation"
    • validateDelegateNotSameAsAccount

      @Check default void validateDelegateNotSameAsAccount()
      Validate that the delegate() field is not the same as the account() field.
    • unknownFields

      Map<String,Object> unknownFields()
    • transactionFlags

      @Auxiliary default TransactionFlags transactionFlags()
      Get the transaction flags polymorphically. Each transaction type implements its own flags() method with a specific return type.
      Returns:
      The TransactionFlags for this transaction type.