Class ContractMethodProxyClient

  • All Implemented Interfaces:
    ContractMethodProxy

    public class ContractMethodProxyClient
    extends java.lang.Object
    implements ContractMethodProxy
    The default contract method client for proxies
    Since:
    0.2.0
    Author:
    Alexandre Carvalho, Andre Bertolace
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T> FunctionCallResult<T> invoke​(NearClient nearClient, java.lang.String contractAccountId, java.lang.String methodName, ContractMethodType methodType, Base64String arguments, java.lang.Class<T> returnClass)
      Proxy invoke the contracts view methods by sending the Base64String
      TransactionAwait invoke​(NearClient nearClient, java.lang.String contractAccountId, java.lang.String methodName, ContractMethodType methodType, java.lang.String accountId, PublicKey accountPublicKey, PrivateKey accountPrivateKey, com.fasterxml.jackson.databind.node.ObjectNode arguments, java.math.BigInteger deposit)
      Proxy invoke the contracts call methods via signed transactions
      EncodedHash invokeAsync​(NearClient nearClient, java.lang.String contractAccountId, java.lang.String methodName, ContractMethodType methodType, java.lang.String accountId, PublicKey accountPublicKey, PrivateKey accountPrivateKey, com.fasterxml.jackson.databind.node.ObjectNode arguments, java.math.BigInteger deposit)
      Proxy invoke the contracts call methods via signed transactions async
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ContractMethodProxyClient

        public ContractMethodProxyClient()
    • Method Detail

      • invoke

        public <T> FunctionCallResult<T> invoke​(NearClient nearClient,
                                                java.lang.String contractAccountId,
                                                java.lang.String methodName,
                                                ContractMethodType methodType,
                                                Base64String arguments,
                                                java.lang.Class<T> returnClass)
                                         throws java.lang.Throwable
        Description copied from interface: ContractMethodProxy
        Proxy invoke the contracts view methods by sending the Base64String
        Specified by:
        invoke in interface ContractMethodProxy
        Type Parameters:
        T - type
        Parameters:
        nearClient - near client instance
        contractAccountId - contract id
        methodName - view method to call
        methodType - view or call
        arguments - contract arguments
        returnClass - return object class
        Returns:
        a functioncallresult object with type T
        Throws:
        java.lang.Throwable - thrown if fails to invoke
      • invoke

        public TransactionAwait invoke​(NearClient nearClient,
                                       java.lang.String contractAccountId,
                                       java.lang.String methodName,
                                       ContractMethodType methodType,
                                       java.lang.String accountId,
                                       PublicKey accountPublicKey,
                                       PrivateKey accountPrivateKey,
                                       com.fasterxml.jackson.databind.node.ObjectNode arguments,
                                       java.math.BigInteger deposit)
                                throws java.lang.Throwable
        Description copied from interface: ContractMethodProxy
        Proxy invoke the contracts call methods via signed transactions
        Specified by:
        invoke in interface ContractMethodProxy
        Parameters:
        nearClient - near client instance
        contractAccountId - contract id
        methodName - view method to call
        methodType - view or call
        accountId - user accountId
        accountPublicKey - user publicKey
        accountPrivateKey - user privateKey to sign the contract
        arguments - contract arguments
        deposit - transaction deposit
        Returns:
        a transactionAwait
        Throws:
        java.lang.Throwable - thrown if fails to invoke
      • invokeAsync

        public EncodedHash invokeAsync​(NearClient nearClient,
                                       java.lang.String contractAccountId,
                                       java.lang.String methodName,
                                       ContractMethodType methodType,
                                       java.lang.String accountId,
                                       PublicKey accountPublicKey,
                                       PrivateKey accountPrivateKey,
                                       com.fasterxml.jackson.databind.node.ObjectNode arguments,
                                       java.math.BigInteger deposit)
                                throws java.lang.Throwable
        Description copied from interface: ContractMethodProxy
        Proxy invoke the contracts call methods via signed transactions async
        Specified by:
        invokeAsync in interface ContractMethodProxy
        Parameters:
        nearClient - near client instance
        contractAccountId - contract id
        methodName - view method to call
        methodType - view or call
        accountId - user accountId
        accountPublicKey - user publicKey
        accountPrivateKey - user privateKey to sign the contract
        arguments - contract arguments
        deposit - transaction deposit
        Returns:
        an EncodedHash of the future transaction
        Throws:
        java.lang.Throwable - thrown if fails to invoke