eosjs icon indicating copy to clipboard operation
eosjs copied to clipboard

Getting net_usage_words error when using eos.transfer()

Open outdoteth opened this issue 8 years ago • 3 comments

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.

outdoteth avatar May 14 '18 20:05 outdoteth

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: []
                };

ai-personas avatar May 15 '18 01:05 ai-personas

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

jcalfee avatar May 16 '18 01:05 jcalfee

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

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

outdoteth avatar May 16 '18 03:05 outdoteth