Class TransactionService


  • public class TransactionService
    extends java.lang.Object
    Transaction service provides methods to easily work with transactions
    Since:
    0.0.1
    Author:
    Alexandre Carvalho, Andre Bertolace
    • Constructor Detail

      • TransactionService

        public TransactionService()
    • Method Detail

      • sendTransferActionAwait

        public static TransactionAwait sendTransferActionAwait​(NearService nearService,
                                                               java.lang.String signerId,
                                                               java.lang.String receiverId,
                                                               PublicKey signerPublicKey,
                                                               PrivateKey signerPrivateKey,
                                                               java.math.BigInteger amount)
                                                        throws java.security.GeneralSecurityException
        Sends a TransferAction transaction waiting for result using NearService.sendTransactionAwait(String)
        Parameters:
        nearService - the near service instance to use
        signerId - the signer id
        receiverId - the receiver id
        signerPublicKey - signer public key
        signerPrivateKey - signer private key
        amount - the amount to transfer
        Returns:
        TransactionAwait object with the result
        Throws:
        java.security.GeneralSecurityException - thrown if failed to sign the transaction
      • sendTransferActionAsync

        public static EncodedHash sendTransferActionAsync​(NearService nearService,
                                                          java.lang.String signerId,
                                                          java.lang.String receiverId,
                                                          PublicKey signerPublicKey,
                                                          PrivateKey signerPrivateKey,
                                                          java.math.BigInteger amount)
                                                   throws java.security.GeneralSecurityException
        Parameters:
        nearService - the near service instance to use
        signerId - the signer id
        receiverId - the receiver id
        signerPublicKey - signer public key
        signerPrivateKey - signer private key
        amount - the amount to transfer
        Returns:
        transaction Hash
        Throws:
        java.security.GeneralSecurityException - thrown if failed to sign the transaction
      • sendTransactionAwait

        public static TransactionAwait sendTransactionAwait​(NearService nearService,
                                                            java.lang.String signerId,
                                                            java.lang.String receiverId,
                                                            PublicKey signerPublicKey,
                                                            PrivateKey signerPrivateKey,
                                                            java.util.List<Action> actionList)
                                                     throws java.security.GeneralSecurityException
        Sends a list of Action transaction waiting for result using NearService.sendTransactionAwait(String)
        Parameters:
        nearService - the near service instance to use
        signerId - the signer id
        receiverId - the receiver id
        signerPublicKey - signer public key
        signerPrivateKey - signer private key
        actionList - list of Action to send
        Returns:
        TransactionAwait object with the result
        Throws:
        java.security.GeneralSecurityException - thrown if failed to sign the transaction
      • sendTransactionAsync

        public static EncodedHash sendTransactionAsync​(NearService nearService,
                                                       java.lang.String signerId,
                                                       java.lang.String receiverId,
                                                       PublicKey signerPublicKey,
                                                       PrivateKey signerPrivateKey,
                                                       java.util.List<Action> actionList)
                                                throws java.security.GeneralSecurityException
        Sends a list of Action transaction waiting for result using NearService.sendTransactionAsync(String)
        Parameters:
        nearService - the near service instance to use
        signerId - the signer id
        receiverId - the receiver id
        signerPublicKey - signer public key
        signerPrivateKey - signer private key
        actionList - list of Action to send
        Returns:
        TransactionAwait object with the result
        Throws:
        java.security.GeneralSecurityException - thrown if failed to sign the transaction