Interface ContractMethodProxy

  • All Known Implementing Classes:
    ContractMethodProxyClient

    public interface ContractMethodProxy
    The interface for contract method clients
    Since:
    0.2.0
    Author:
    Alexandre Carvalho, Andre Bertolace
    • Method Detail

      • invoke

        <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
        Proxy invoke the contracts view methods by sending the Base64String
        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

        TransactionAwait invoke​(NearClient nearClient,
                                java.lang.String contractAccountId,
                                java.lang.String methodName,
                                ContractMethodType methodType,
                                java.lang.String accountId,
                                PublicKey publicKey,
                                PrivateKey privateKey,
                                com.fasterxml.jackson.databind.node.ObjectNode arguments,
                                java.math.BigInteger deposit)
                         throws java.lang.Throwable
        Proxy invoke the contracts call methods via signed transactions
        Parameters:
        nearClient - near client instance
        contractAccountId - contract id
        methodName - view method to call
        methodType - view or call
        accountId - user accountId
        publicKey - user publicKey
        privateKey - 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

        EncodedHash invokeAsync​(NearClient nearClient,
                                java.lang.String contractAccountId,
                                java.lang.String methodName,
                                ContractMethodType methodType,
                                java.lang.String accountId,
                                PublicKey publicKey,
                                PrivateKey privateKey,
                                com.fasterxml.jackson.databind.node.ObjectNode arguments,
                                java.math.BigInteger deposit)
                         throws java.lang.Throwable
        Proxy invoke the contracts call methods via signed transactions async
        Parameters:
        nearClient - near client instance
        contractAccountId - contract id
        methodName - view method to call
        methodType - view or call
        accountId - user accountId
        publicKey - user publicKey
        privateKey - 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