Closed php-wizard closed 3 years ago
PHP code
$walletRPC = new walletRPC("127.0.0.1", "123", false);
try {
$walletRPC->close_wallet();
} catch(\Exception $e) {
// do nothing. wallet already closed
}
$open_wallet = $walletRPC->open_wallet($wallet_name, '');
$walletRPC->refresh();
$balanceJson = self::arrayToJson($walletRPC->get_balance());
var_dump($balanceJson);
$transfer = self::arrayToJson($walletRPC->transfer(sprintf("%.12f",$amount),$address));
I will give you an example stagenet wallet where i experience the issue, so that you can debug it yourself if you need
SOLVED: did not have enough balance to cover the fee, that's why. I was wrong
I have an issue when using monerophp's
transfer
call from a non multisig wallet ( hasmultisig_import_needed
tofalse
).getbalance
gives:transfer
gives:RuntimeException : Request have return error: not enough money;Request: {"jsonrpc":"2.0","method":"transfer","params":{"destinations":[{"amount":26352445130,"address":"73a4nWuvkYoYoksGurDjKZQcZkmaxLaKbbeiKzHnMmqKivrCzq5Q2JtJG1UZNZFqLPbQ3MiXCk2Q5bdwdUNSr7X9QrPubkn"}],"mixin":10,"get_tx_key":true,"account_index":0,"subaddr_indices":"","priority":2,"do_not_relay":false,"ringsize":11}};
The balance is sufficient and covers the fees IMO. My daemon version is
monero-x86_64-linux-gnu-v0.17.2.0/monerod
andmonero-x86_64-linux-gnu-v0.17.2.0/monero-wallet-rpc