Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guía sobre cómo preparar transacciones en LACCHAIN EOSIO #19

Open
ldrojas opened this issue May 18, 2021 · 0 comments
Open

Guía sobre cómo preparar transacciones en LACCHAIN EOSIO #19

ldrojas opened this issue May 18, 2021 · 0 comments
Assignees
Labels
contenido web contenido para el sitio S: 2 Size: Small tutorial
Milestone

Comments

@ldrojas
Copy link
Collaborator

ldrojas commented May 18, 2021

Using EOS JS For example

const { eosioConfig } = require('config')

const addTransaction = ({
  contractName = eosioConfig.eosioAccount,
  action = 'dispatch',
  eosio,
  ...data
}) =>
  eosio.transact(
    {
      actions: [
        {
          account: 'writer',
          name: 'run',
          authorization: [
            {
              actor: 'costarica',
              permission: 'writer'
            }
          ],
          'data': ''
        },
        {
          account: contractName,
          name: action,
          authorization: [
            {
              actor: contractName,
              permission: 'dispatch'
            }
          ],
          data
        }
      ]
    },
    {
      blocksBehind: 3,
      expireSeconds: 30
    }
  )

module.exports = {
  addTransaction
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contenido web contenido para el sitio S: 2 Size: Small tutorial
Projects
None yet
Development

No branches or pull requests

2 participants