Interface FTService
-
public interface FTService
Contract function call object for FTs (Tokens)- Since:
- 0.2.0
- Author:
- Alexandre Carvalho, Andre Bertolace
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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 ftTransactionAwait
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 ftEncodedHash
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 ftEncodedHash
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 ftTransactionAwait
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 ftTransactionAwait
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 ftEncodedHash
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 ftEncodedHash
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 ftFunctionCallResult<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 accountFunctionCallResult<FTTokenMetadata>
getMetadata(NearClient nearClient, java.lang.String tokenId)
NEP-148 containing the metadata for the tokenFunctionCallResult<java.lang.String>
getTotalSupply(NearClient nearClient, java.lang.String tokenId)
NEP-141 method to get the total supply of the given token
-
-
-
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 usetokenId
- 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 usetokenId
- the token's account idaccountId
- 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 usetokenId
- 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 usetokenId
- the token's account idamount
- the amount to transferreceiverId
- the receiver idaccountId
- the arguments for the view methodpublicKey
- the arguments for the view methodprivateKey
- 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 usetokenId
- the token's account idamount
- the amount to transferreceiverId
- the receiver idaccountId
- the arguments for the view methodpublicKey
- the arguments for the view methodprivateKey
- 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 usetokenId
- the token's account idamount
- the amount to transferreceiverId
- the receiver idaccountId
- the arguments for the view methodpublicKey
- the arguments for the view methodprivateKey
- the arguments for the view methodmemo
- 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 usetokenId
- the token's account idamount
- the amount to transferreceiverId
- the receiver idaccountId
- the arguments for the view methodpublicKey
- the arguments for the view methodprivateKey
- the arguments for the view methodmemo
- 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 usetokenId
- the token's account idamount
- the amount to transferreceiverId
- the receiver idaccountId
- the arguments for the view methodmsg
- the optional messagepublicKey
- the arguments for the view methodprivateKey
- 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 usetokenId
- the token's account idamount
- the amount to transferreceiverId
- the receiver idaccountId
- the arguments for the view methodmsg
- the optional messagepublicKey
- the arguments for the view methodprivateKey
- 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 usetokenId
- the token's account idamount
- the amount to transferreceiverId
- the receiver idaccountId
- the arguments for the view methodmsg
- the optional messagepublicKey
- the arguments for the view methodprivateKey
- the arguments for the view methodmemo
- 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 usetokenId
- the token's account idamount
- the amount to transferreceiverId
- the receiver idaccountId
- the arguments for the view methodmsg
- the optional messagepublicKey
- the arguments for the view methodprivateKey
- the arguments for the view methodmemo
- the optional memo- Returns:
- EncodedHash object
-
-