Interface FTService


  • public interface FTService
    Contract function call object for FTs (Tokens)
    Since:
    0.2.0
    Author:
    Alexandre Carvalho, Andre Bertolace
    • Method Detail

      • getTotalSupply

        FunctionCallResult<java.lang.String> getTotalSupply​(NearClient nearClient,
                                                            java.lang.String tokenId)
        NEP-141 method to get the total supply of the given token
        Parameters:
        nearClient - near rpc client to use
        tokenId - the token's account id
        Returns:
        the total token supply as a string
      • getBalanceOf

        FunctionCallResult<java.math.BigInteger> getBalanceOf​(NearClient nearClient,
                                                              java.lang.String tokenId,
                                                              java.lang.String accountId)
        NEP-141 method to get the balance of the given token for the given account
        Parameters:
        nearClient - near rpc client to use
        tokenId - the token's account id
        accountId - the accountId
        Returns:
        the total token supply as a string
      • getMetadata

        FunctionCallResult<FTTokenMetadata> getMetadata​(NearClient nearClient,
                                                        java.lang.String tokenId)
        NEP-148 containing the metadata for the token
        Parameters:
        nearClient - near rpc client to use
        tokenId - the token's account id
        Returns:
        an object with the token's metadata
      • callTransfer

        TransactionAwait callTransfer​(NearClient nearClient,
                                      java.lang.String tokenId,
                                      java.lang.String amount,
                                      java.lang.String receiverId,
                                      java.lang.String accountId,
                                      PublicKey publicKey,
                                      PrivateKey privateKey)
        Synchronous contractCall to transfer ft
        Parameters:
        nearClient - near rpc client to use
        tokenId - the token's account id
        amount - the amount to transfer
        receiverId - the receiver id
        accountId - the arguments for the view method
        publicKey - the arguments for the view method
        privateKey - the arguments for the view method
        Returns:
        TransactionAwait object
      • callTransferAsync

        EncodedHash callTransferAsync​(NearClient nearClient,
                                      java.lang.String tokenId,
                                      java.lang.String amount,
                                      java.lang.String receiverId,
                                      java.lang.String accountId,
                                      PublicKey publicKey,
                                      PrivateKey privateKey)
        Asynchronous contractCall to transfer ft
        Parameters:
        nearClient - near rpc client to use
        tokenId - the token's account id
        amount - the amount to transfer
        receiverId - the receiver id
        accountId - the arguments for the view method
        publicKey - the arguments for the view method
        privateKey - the arguments for the view method
        Returns:
        EncodedHash object
      • callTransfer

        TransactionAwait callTransfer​(NearClient nearClient,
                                      java.lang.String tokenId,
                                      java.lang.String amount,
                                      java.lang.String receiverId,
                                      java.lang.String accountId,
                                      PublicKey publicKey,
                                      PrivateKey privateKey,
                                      java.lang.String memo)
        Synchronous contractCall to transfer ft
        Parameters:
        nearClient - near rpc client to use
        tokenId - the token's account id
        amount - the amount to transfer
        receiverId - the receiver id
        accountId - the arguments for the view method
        publicKey - the arguments for the view method
        privateKey - the arguments for the view method
        memo - the optional memo
        Returns:
        TransactionAwait object
      • callTransferAsync

        EncodedHash callTransferAsync​(NearClient nearClient,
                                      java.lang.String tokenId,
                                      java.lang.String amount,
                                      java.lang.String receiverId,
                                      java.lang.String accountId,
                                      PublicKey publicKey,
                                      PrivateKey privateKey,
                                      java.lang.String memo)
        Asynchronous contractCall to transfer ft
        Parameters:
        nearClient - near rpc client to use
        tokenId - the token's account id
        amount - the amount to transfer
        receiverId - the receiver id
        accountId - the arguments for the view method
        publicKey - the arguments for the view method
        privateKey - the arguments for the view method
        memo - the optional memo
        Returns:
        EncodedHash object
      • callTransferCall

        TransactionAwait callTransferCall​(NearClient nearClient,
                                          java.lang.String tokenId,
                                          java.lang.String amount,
                                          java.lang.String receiverId,
                                          java.lang.String accountId,
                                          java.lang.String msg,
                                          PublicKey publicKey,
                                          PrivateKey privateKey)
        Synchronous contractCall to transfer_call ft
        Parameters:
        nearClient - near rpc client to use
        tokenId - the token's account id
        amount - the amount to transfer
        receiverId - the receiver id
        accountId - the arguments for the view method
        msg - the optional message
        publicKey - the arguments for the view method
        privateKey - the arguments for the view method
        Returns:
        TransactionAwait object
      • callTransferCallAsync

        EncodedHash callTransferCallAsync​(NearClient nearClient,
                                          java.lang.String tokenId,
                                          java.lang.String amount,
                                          java.lang.String receiverId,
                                          java.lang.String accountId,
                                          java.lang.String msg,
                                          PublicKey publicKey,
                                          PrivateKey privateKey)
        Asynchronous contractCall to transfer_call ft
        Parameters:
        nearClient - near rpc client to use
        tokenId - the token's account id
        amount - the amount to transfer
        receiverId - the receiver id
        accountId - the arguments for the view method
        msg - the optional message
        publicKey - the arguments for the view method
        privateKey - the arguments for the view method
        Returns:
        EncodedHash object
      • callTransferCall

        TransactionAwait callTransferCall​(NearClient nearClient,
                                          java.lang.String tokenId,
                                          java.lang.String amount,
                                          java.lang.String receiverId,
                                          java.lang.String accountId,
                                          java.lang.String msg,
                                          PublicKey publicKey,
                                          PrivateKey privateKey,
                                          java.lang.String memo)
        Synchronous contractCall to transfer_call ft
        Parameters:
        nearClient - near rpc client to use
        tokenId - the token's account id
        amount - the amount to transfer
        receiverId - the receiver id
        accountId - the arguments for the view method
        msg - the optional message
        publicKey - the arguments for the view method
        privateKey - the arguments for the view method
        memo - the optional memo
        Returns:
        TransactionAwait object
      • callTransferCallAsync

        EncodedHash callTransferCallAsync​(NearClient nearClient,
                                          java.lang.String tokenId,
                                          java.lang.String amount,
                                          java.lang.String receiverId,
                                          java.lang.String accountId,
                                          java.lang.String msg,
                                          PublicKey publicKey,
                                          PrivateKey privateKey,
                                          java.lang.String memo)
        Asynchronous contractCall to transfer_call ft
        Parameters:
        nearClient - near rpc client to use
        tokenId - the token's account id
        amount - the amount to transfer
        receiverId - the receiver id
        accountId - the arguments for the view method
        msg - the optional message
        publicKey - the arguments for the view method
        privateKey - the arguments for the view method
        memo - the optional memo
        Returns:
        EncodedHash object