@Test(expected = IllegalArgumentException.class) public void testTransfer_InvalidAmount() throws IOException { neoToken.transfer(Wallet.createWallet(), RECIPIENT_SCRIPT_HASH, new BigDecimal(-1)); }
public TransactionBuilder transfer(Wallet wallet, ScriptHash to, BigDecimal amount) throws IOException { if (amount.signum() < 0) { throw new IllegalArgumentException( "The parameter amount must be greater than or equal to 0"); } List<Account> accountsOrdered = new ArrayList<>(wallet.getAccounts()); accountsOrdered.remove(wallet.getDefaultAccount()); accountsOrdered.add(0, wallet.getDefaultAccount()); return buildMultiTransferInvocation(wallet, to, amount, accountsOrdered); }
Nep5Token extends SmartContract { public TransactionBuilder transfer(Wallet wallet, ScriptHash to, BigDecimal amount) throws IOException { if (amount.signum() < 0) { throw new IllegalArgumentException( "The parameter amount must be greater than or equal to 0"); } List<Account> accountsOrdered = new ArrayList<>(wallet.getAccounts()); accountsOrdered.remove(wallet.getDefaultAccount()); accountsOrdered.add(0, wallet.getDefaultAccount()); return buildMultiTransferInvocation(wallet, to, amount, accountsOrdered); } }
Nep5Token extends SmartContract { public TransactionBuilder transfer(Wallet wallet, ScriptHash to, BigDecimal amount) throws IOException { if (amount.signum() < 0) { throw new IllegalArgumentException( "The parameter amount must be greater than or equal to 0"); } List<Account> accountsOrdered = new ArrayList<>(wallet.getAccounts()); accountsOrdered.remove(wallet.getDefaultAccount()); accountsOrdered.add(0, wallet.getDefaultAccount()); return buildMultiTransferInvocation(wallet, to, amount, accountsOrdered); } Nep5Token(ScriptHash scriptHash, Neow3j neow); }
Nep5Token extends SmartContract { public TransactionBuilder transfer(Wallet wallet, ScriptHash to, BigDecimal amount) throws IOException { if (amount.signum() < 0) { throw new IllegalArgumentException( "The parameter amount must be greater than or equal to 0"); } List<Account> accountsOrdered = new ArrayList<>(wallet.getAccounts()); accountsOrdered.remove(wallet.getDefaultAccount()); accountsOrdered.add(0, wallet.getDefaultAccount()); return buildMultiTransferInvocation(wallet, to, amount, accountsOrdered); } Nep5Token(ScriptHash scriptHash, Neow3j neow); String getName(); String getSymbol(); BigInteger getTotalSupply(); int getDecimals(); BigInteger getBalanceOf(ScriptHash scriptHash); BigInteger getBalanceOf(Wallet wallet); TransactionBuilder transfer(Wallet wallet, ScriptHash to, BigDecimal amount); TransactionBuilder transferFromSpecificAccounts(Wallet wallet, ScriptHash to,
            BigDecimal amount, ScriptHash... from); TransactionBuilder transferFromDefaultAccount(Wallet wallet, ScriptHash to,
            BigDecimal amount); }
Nep5Token extends SmartContract { public TransactionBuilder transfer(Wallet wallet, ScriptHash to, BigDecimal amount) throws IOException { if (amount.signum() < 0) { throw new IllegalArgumentException( "The parameter amount must be greater than or equal to 0"); } List<Account> accountsOrdered = new ArrayList<>(wallet.getAccounts()); accountsOrdered.remove(wallet.getDefaultAccount()); accountsOrdered.add(0, wallet.getDefaultAccount()); return buildMultiTransferInvocation(wallet, to, amount, accountsOrdered); } Nep5Token(ScriptHash scriptHash, Neow3j neow); String getName(); String getSymbol(); BigInteger getTotalSupply(); int getDecimals(); BigInteger getBalanceOf(ScriptHash scriptHash); BigInteger getBalanceOf(Wallet wallet); TransactionBuilder transfer(Wallet wallet, ScriptHash to, BigDecimal amount); TransactionBuilder transferFromSpecificAccounts(Wallet wallet, ScriptHash to,
            BigDecimal amount, ScriptHash... from); TransactionBuilder transferFromDefaultAccount(Wallet wallet, ScriptHash to,
            BigDecimal amount);  }