EOSIO / eosjs

General purpose library for the EOSIO blockchain.
http://eosio.github.io/eosjs
MIT License
1.43k stars 463 forks source link

Getting net_usage_words error when using eos.transfer() #86

Closed outdoteth closed 6 years ago

outdoteth commented 6 years ago

I run this: eos.transfer("tester1234", "dylan2", "0 EOS", "", {sign: true, broadcast: true}).then(res=>{ console.log(res)})

And get this error: Error: Required varuint32 transaction_header.net_usage_words transaction.

I'm using slim branch.

ai-personas commented 6 years ago

Tried it in master and getting the same kind of error Error: Required varuint32 transaction_header.net_usage_words transaction.

If i override header with below seems its working

const headers = {
                    expiration: expiration.toISOString().split('.')[0],
                    region: 0,
                    ref_block_num: ref_block_num,
                    ref_block_prefix: block.ref_block_prefix,
                    // max_net_usage_words: 0,
                    // max_kcpu_usage: 0,
                    net_usage_words: 0,
                    max_cpu_usage_ms: 0,
                    delay_sec: 0,
                    context_free_actions: [],
                    actions: [],
                    signatures: [],
                    transaction_extensions: []
                };
jcalfee commented 6 years ago

I just published npm eosjs@dawn4 (version 11) .. This version is compatible with eosio/eos:dawn-v4.0.0 ..

outdoteth commented 6 years ago

Awesome! I will try this now... at 4am in the morning lol.

EDIT: Yes, this seems to be working fine now.