2

When I try to call eos.transfer(..) I'm getting this error

{ message: 'assertion failure with message: unable to find key',
file: 'wasm_interface.cpp',
line_number: 930,
method: 'eosio_assert' }

That is the code:

Eos = require('eosjs')

config = {
    chainId: '038f4b0fc8ff18a4f0842a8f0564611f6e96e8535901dd45e43ac8691a1c4dca', 
    keyProvider: ['key1','key2'],
    httpEndpoint: 'http://dev.cryptolions.io:38888',
    expireInSeconds: 60,
    broadcast: true,
    verbose: false, 
    sign: true
  }

eos = Eos(config)

eos.transfer('token', 'wallet', '1.0000 TKN', '', (error, result) => {console.log(result)})

Any Ideas ?

3
  • are you using correct keys? and also the keys are imported in your wallet? Aug 9, 2018 at 12:13
  • Yes I'm using correct keys, keys are imported and account is broadcasted to jungle testnet.
    – iobeta123
    Aug 9, 2018 at 12:15
  • unable find key often means that the token or the user is not on the chain
    – Jimmy Guo
    Aug 9, 2018 at 14:34

1 Answer 1

2

I found another solution. I guess that there is problem in EOSJS

eos
 .transaction({
   actions: [
     {
       account: “tokencontract”,
       name: “transfer”,
       authorization: [
         {
           actor: “senderaccount”,
           permission: “active”
         }
       ],
       data: {
         from: “senderaccount”,
         to: “receiveraccount”,
         quantity: `5.0000 TKN`,
         memo: “some description of the transaction”
       }
     }
   ]
 })
1
  • btw I haven't changed config file.
    – iobeta123
    Aug 9, 2018 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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