2

when I create actions like this,and prapare to use JsSignatureProvider to sign

(async()=>{
  let actions = [{
    account: 'tommy',
    name: 'hi',
    authorization: [{
      actor: 'tommy',
      permission: 'active',
    }],
    data: {
      user: 'tommy'
    },
  }
  let seActions = await api.serializeActions(actions)   
  console.log(seActions)
})()

 let seActions =  api.serializeActions(tx) ;
 console.log(seActions);

but nodejs report this error:

TypeError: actions.map is not a function

1 Answer 1

1

It looks like you forgot to add the closing square bracket after your action. I assume this is the problem. It should instead look like this:

(async()=>{
  let actions = [{
    account: 'tommy',
    name: 'hi',
    authorization: [{
      actor: 'tommy',
      permission: 'active',
    }],
    data: {
      user: 'tommy'
    },
  }]
  let seActions = await api.serializeActions(actions)   
  console.log(seActions)
})()

 let seActions =  api.serializeActions(tx) ;
 console.log(seActions);

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.