name() β string
Returns the name of the token.tokenResponse.getName();
balanceOf(address token,address account) β uint256
Returns the number of tokens owned by the account.tokenResponse.getBalance();
Credentials creds = org.web3j.crypto.Credentials.create(PRIVATE_KEY);
transfer(address token, address recipient, uint256 amount) β
Moves tokens from the callerβs account to the recipient. It will return a transaction hash.String trasaction_hash = XDCClient.getInstance().TransferXdc(private_key, sender_address, receiver_address, new BigInteger(String.valueOf(token_totransfer), Long.parseLong(gasprice), Long.parseLong(gaslimit;
approve(address token, address spender, uint256 amount) β
Sets amount as the allowance of spender over the callerβs tokens. It will return a transaction hash.approved_hash = XDCClient.getInstance().approveXRC20Token(Spender_address, privatekey, allownce_spender, value_approve);
decreaseAllowance(XDCAccount account, address token, address owner, address spender, uint256 subtractedValue)
approved_hash = XDCClient.getInstance().decreaseAllowance(decrease_owner, decrease_spender, privatekey, decrease_allowance, Spender_address);
name() β string
Returns the name of the token.symbol() β string
Returns the symbol of the token, usually a shorter version of the name.decimals() β uint8
Returns the number of decimals used to get its user representation. For example, if decimal equals 2, a balance of 505 tokens should be displayed to a user as 5,05 (505 / 10 ** 2).
Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei.totalSupply() β uint256
Returns the number of tokens in existence.balanceOf(address account) β uint256
Returns the number of tokens owned by the account.allowance(address owner, address spender) β uint256
Returns the remaining number of tokens that the spender will be allowed to spend on behalf of the owner through transferFrom
. It is zero by default.approve(address spender, uint256 amount)
Sets amount as the allowance of spender over the callerβs tokens.transfer(address recipient, uint256 amount)
Moves tokens from the callerβs account to the recipient.transferFrom(address sender, address recipient, uint256 amount)
Moves tokens from sender to recipient using the allowance mechanism. The amount is deducted from the callerβs allowance.increaseAllowance(address spender, uint256 addedValue)
Automatically increases the allowance granted to spender by the caller.decreaseAllowance(address spender, uint256 addedValue)
Automatically decreases the allowance granted to spender by the caller.