I've successfully managed to use eosjs to transfer some EOS but when I'm trying to send something else (a token) it's no longer working.
For example that code is working:
import ScatterJS from 'scatterjs-core';
const scatter = ScatterJS.scatter;
const eos = scatter.eos(network, Eos, eosOptions);
const transactionOptions = { authorization:[`${account.name}@${account.authority}`] };
var res = await eos.transfer(account.name,'testacc','1.0000 EOS','', transactionOptions);
Whereas that code isn't working:
var res = await eos.transfer(account.name, 'testacc', '80.0000 EOSDAC', '', transactionOptions);
When executing that second code I get the error (caught in a try / catch handler):
{"code":500,"message":"Internal Service Error","error":{"code":3050003,"name":"eosio_assert_message_exception","what":"eosio_assert_message assertion failure","details":[{"message":"assertion failure with message: unable to find key","file":"wasm_interface.cpp","line_number":917,"method":"eosio_assert"},{"message":"pending console output: ","file":"apply_context.cpp","line_number":72,"method":"exec_one"}]}}
I honestly don't know what's wrong with my code... can anyone help me to get it to work?
const account = scatter.identity.accounts.find(x => x.blockchain === 'eos');
EOSDAC
is not supported unless you mint your own token. SO you have to send80.0000 EOS
.