Issue creating transaction and sending to tendermint from node
I’m trying to create a transaction to interact with a cosmos based application (MESG https://github.com/mesg-foundation/engine ). Most of the libraries to sign are using the cosmos APIs but I would like to directly use tendermint `broadcast_tx_[a]sync`. I’ve tried different libraries like `cosmosjs` or `cosmos-api` but they have issues running on node (because of buffers) or relying on cosmos apis. The workflow is the following: • import an account from a seed • create a message with the transfer (type: cosmos-sdk/MsgSend) • sign the transaction with the private key of the account • create the transaction • encode the transaction with amino.js • broadcast the transaction to tendermint `broadcast_tx_sync` For some reason, my transaction is not correctly decoded. ``` { jsonrpc: '2.0', id: '', result: { code: 2, data: '', log: '{"codespace":"sdk","code":2,"message":"error decoding transaction"}', hash: '30F7FEC03609C0A841414186A9AA5E4020B67CF46F1991ABDEEEFB4DA297390F' } } ``` Here is the actual script running ``` const bip39 = require('bip39') const bip32 = require('bip32') const bech32 = require('bech32') const secp256k1 =…
Excerpt (1186 of 4563 characters). Read the whole post on the forum ↗