1

I am trying to use a secondary account to pay for cpu/ram for the primary accounts eosio.tokens how do I do that using eosjs library

My current action looks like this

actions: [{
    account: 'eosio.token',
    name: 'transfer',
    authorization: [{
      actor: 'lionster1011',
      permission: 'active',
    }],
    data: {
      from: 'lionster1011',
      to: 'lionster1010',
      quantity: '10.0000 EOS',
      memo: 'EOS-TRANSFER',
    },
  }]

Please advice

1 Answer 1

1

You need to authorize the transaction with signatures for both accounts. 1. The ressource-paying-account and 2. the acting account.

Assuming that lionstester1010 should pay for the transaction but lionstester1011 is the acting account/the sender of the token:

actions: [{
   account: 'eosio.token',
   name: 'transfer',
   authorization: [{
      actor: 'lionster1010',
      permission: 'active'},{
      actor: 'lionster1011',
      permission: 'active',
}],
data: {
   from: 'lionster1011',
   to: 'lionster1010',
   quantity: '10.0000 EOS',
   memo: 'EOS-TRANSFER',
},
}]

Self-explanatory you need the keys of both accounts to sign the tx.

Your Answer

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

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