bytecoin icon indicating copy to clipboard operation
bytecoin copied to clipboard

Error -32602 Sum of amounts of all outgoing transfers cannot be 0

Open zool2003 opened this issue 6 years ago • 12 comments

Hi,

I have been connecting to the RPC and sending commands just fine with the exception of transfers.

I have modified the example to give you an idea of what it is that I am using to try and initiate a transfer.

curl -X POST http://:/json_rpc -H 'Content-Type: application/json-rpc' -d '{"jsonrpc": "2.0", "id": "", "method": "", "params": {"change_address":"","spend_address":"","spend_address":"","amount":"1"}}'

Response { "error": { "code": -32602, "message": "Sum of amounts of all outgoing transfers cannot be 0" }, "id": "0", "jsonrpc": "2.0"

I am using this through a Httpwebrequest .in VB

Sorry if I have missed something obvious but I have been stuck for 2 days trying to figure it out.

zool2003 avatar Mar 29 '18 07:03 zool2003

It's new walletd ? there are a new methods and little bit other parameters and methods check on wiki https://github.com/bcndev/bytecoin/wiki/Bytecoin-Wallet-Daemon-JSON-RPC-API#input-params-9 it's not well described, but in addition to that parameters you need to add array "transfers" with values amount and address to transaction array so carefuly read all the Create transaction paragraph

ghost avatar Mar 29 '18 08:03 ghost

Yeah it’s the new wallets file and I have been working through the new wiki and have most other things working.

I have to say the new walletd with the built in node is much better.

But the documentation on the transfers could do with updating because it does suggest a transfers array with the addresses and amounts.

I will have another try tonight.

zool2003 avatar Mar 29 '18 08:03 zool2003

This make single nodes run with wallet?

SoraKohaku avatar Mar 29 '18 09:03 SoraKohaku

Yes single node running from walletd.

I can get a list of transfers and the balance ok just cannot transfer.

I think there needs to be an example of how this is done?

zool2003 avatar Mar 29 '18 09:03 zool2003

Is this can make better on chain. What I know we need split supply chain by account, data n log. Where nodes have 3 function self....as we know some less bw can't full nodes. What we need change is task on chain split to some layer

SoraKohaku avatar Mar 29 '18 09:03 SoraKohaku

@virgeny

Tried to add "transfers":{} and I just get a parse error? to what I have and getting a parse error.

zool2003 avatar Mar 29 '18 17:03 zool2003

Still haven't managed to work out what the structure needs to be to send a transfer. If anyone knows or can point me in the direction of where I can find it then please let me know.

zool2003 avatar Apr 01 '18 04:04 zool2003

p2p?

SoraKohaku avatar Apr 01 '18 15:04 SoraKohaku

@zool2003 Initiation of a transfer seems to be nonsense wrt our model of money management. By transfer we mean the result of a transaction sending money from the sender to the receivers. So, you form transfers by creating transactions. List of transfers is available here.

bcndev avatar Apr 02 '18 16:04 bcndev

Hi thanks for getting back to me but I can view transfers done that’s working ok.

I cannot create a transaction. I add the address to send from and to but I don’t know how to put the value to send in as it’s not documented?

If someone could give me a json example of create I will understand how it’s done but it’s not listed in the wiki that I can see.

zool2003 avatar Apr 02 '18 16:04 zool2003

@zool2003 Hope these jsons will help you figure out how to create and send transactions.

bcndev avatar Apr 02 '18 17:04 bcndev

Those JSON commands were a massive help thank you.

I was able to construct a transfer and I have a broadcast response but when I check the wallet balance nothing is sent. I am currently trying to use a newer version of the wallet to see

zool2003 avatar Apr 11 '18 05:04 zool2003