Interface NFTService


  • public interface NFTService
    Contract function call object for NFTs
    Since:
    0.2.0
    Author:
    Alexandre Carvalho, Andre Bertolace
    • Method Detail

      • getTokenMetadata

        FunctionCallResult<NFTTokenMetadata> getTokenMetadata​(NearClient nearClient,
                                                              java.lang.String contractAccountId,
                                                              java.lang.String tokenId)
        Gets NFT metadata
        Parameters:
        nearClient - near rpc client to use
        contractAccountId - the contract's account id
        Returns:
        a FunctionCallResult for the call
      • getTokensForOwner

        FunctionCallResult<NFTTokenList> getTokensForOwner​(NearClient nearClient,
                                                           java.lang.String contractAccountId,
                                                           java.lang.String accountId,
                                                           java.lang.String fromIndex,
                                                           java.lang.Integer limit)
        Gets tokens for the given owner
        Parameters:
        nearClient - near rpc client to use
        accountId - the contract's account id
        fromIndex - the starting index
        limit - limit
        Returns:
        a FunctionCallResult for the call
      • getTokensForOwner

        FunctionCallResult<NFTTokenList> getTokensForOwner​(NearClient nearClient,
                                                           java.lang.String contractAccountId,
                                                           java.lang.String accountId,
                                                           java.lang.String fromIndex)
        Gets tokens for the given owner
        Parameters:
        nearClient - near rpc client to use
        accountId - the contract's account id
        fromIndex - the starting index
        Returns:
        a FunctionCallResult for the call
      • getTokens

        FunctionCallResult<com.fasterxml.jackson.databind.JsonNode> getTokens​(NearClient nearClient,
                                                                              java.lang.String contractAccountId,
                                                                              java.lang.String fromIndex,
                                                                              java.lang.Integer limit)
        Get tokens for given parameters
        Parameters:
        nearClient - near rpc client to use
        contractAccountId - the contract's account id
        fromIndex - the starting index
        limit - limit
        Returns:
        a FunctionCallResult for the call
      • getTokens

        FunctionCallResult<com.fasterxml.jackson.databind.JsonNode> getTokens​(NearClient nearClient,
                                                                              java.lang.String contractAccountId,
                                                                              java.lang.String fromIndex)
        Get tokens for given parameters
        Parameters:
        nearClient - near rpc client to use
        contractAccountId - the contract's account id
        fromIndex - the starting index
        Returns:
        a FunctionCallResult for the call
      • getTotalSupply

        FunctionCallResult<java.lang.String> getTotalSupply​(NearClient nearClient,
                                                            java.lang.String contractAccountId)
        Get total supply of NFT for given contract
        Parameters:
        nearClient - near rpc client to use
        contractAccountId - the contract's account id
        Returns:
        a FunctionCallResult for the call
      • getSupplyForOwner

        FunctionCallResult<java.lang.String> getSupplyForOwner​(NearClient nearClient,
                                                               java.lang.String contractAccountId,
                                                               java.lang.String accountId)
        Gets the supply of an NFT for an owner
        Parameters:
        nearClient - near rpc client to use
        contractAccountId - the contract's account id
        accountId - the user's account id
        Returns:
        a FunctionCallResult for the call
      • callTransfer

        TransactionAwait callTransfer​(NearClient nearClient,
                                      java.lang.String contractAccountId,
                                      java.lang.String receiverAccountId,
                                      java.lang.String tokenId,
                                      java.lang.String accountId,
                                      PublicKey publicKey,
                                      PrivateKey privateKey,
                                      java.math.BigInteger deposit)
        Synchronous contractCall to transfer nft
        Parameters:
        nearClient - the near service instance to use for the contract call
        contractAccountId - the contract's account id
        receiverAccountId - the receiver account id
        tokenId - the token id to transfer
        accountId - the arguments for the view method
        publicKey - the arguments for the view method
        privateKey - the arguments for the view method
        deposit - the deposit for the transfer (1 yocto)
        Returns:
        a TransactionAwait object
      • callTransferAsync

        EncodedHash callTransferAsync​(NearClient nearClient,
                                      java.lang.String contractAccountId,
                                      java.lang.String receiverAccountId,
                                      java.lang.String tokenId,
                                      java.lang.String accountId,
                                      PublicKey publicKey,
                                      PrivateKey privateKey,
                                      java.math.BigInteger deposit)
        Asynchronous contractCall to transfer nft
        Parameters:
        nearClient - the near service instance to use for the contract call
        contractAccountId - the contract's account id
        receiverAccountId - the receiver account id
        tokenId - the token id to transfer
        accountId - the arguments for the view method
        publicKey - the arguments for the view method
        privateKey - the arguments for the view method
        deposit - the deposit for the transfer (1 yocto)
        Returns:
        a EncodedHash object