0

when i try to put 2 authorities to updateauth i get this error Error: updateauth action should only have one declared authorization so how can i use another accounts cpu to change my keys not using bloks.io or another portal. i just want to use my accounts... on one i have resources... the other one doesn't!

thanks in advance

0

You can refer to how bloks.io does. They use dummy action payforcpu and include it as the first action of free transaction. (Transaction can have multiple actions) You can make dummy action with any name, and include signature with the account which you want to make pay resources.

eosjs may check whether dummy action exists in contract ABI, so you need to deploy contract with dummy action, or write transaction by yourself and sign manually.

actions: [{
  account: "SOME_ACCOUNT",
  name: "payforcpu",
  authorization: [{
    actor: "ACCOUNT_YOU_WANT_TO_MAKE_PAY",
    permission: "active",
  }],
  data: {
    /* ... */
  },
}, {
  account: "eosio",
  name: "updateauth",
  authorization: [{
    /* ... */
  }],
  data: {
    /* ... */
  }
}]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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