The title sums it up ;-) I'd like to move EOS tokens (say EOSDAC for example but any token will do it for my education) using the eosjs API...

I've tried to use Scatter.js and did that but it's not working:

import ScatterJS from 'scatterjs-core';

const scatter = ScatterJS.scatter;

const account = scatter.identity.accounts.find(x => x.blockchain === 'eos');
const eos = scatter.eos(network, Eos, eosOptions);
const transactionOptions = { authorization:[`${account.name}@${account.authority}`] };
var res = await eos.transfer(account.name,'testacc','100.0000 EOSDAC','', transactionOptions);

When executing that code I get the following error:

    "message":"Internal Service Error",
    "error": {
        "what":"eosio_assert_message assertion failure",
                "message":"assertion failure with message: unable to find key",
                "message":"pending console output: ",

Can anybody help me figuring it out?

Many thanks in advance,


After searching the official doc and trying different approches I finally got it to work. I've used eos.transaction instead of eos.transfer and the following example is working for those interested:

var res = await eos.transaction({
    actions: [
        account: "eosjackscoin", //has to be the smart contract name of the token you want to transfer - eosio for EOS or eosjackscoin for JKR for example
        name: "transfer",
        authorization: [{
            actor: account.name,
            permission: account.authority
        data: {
            from: account.name,
            to: "destinationaccount",
            quantity: "50.0000 JKR",
            memo: ""

Not the answer you're looking for? Browse other questions tagged or ask your own question.