openmarket-sdk
v0.0.21
Published
Open Market API SDK
Downloads
5
Readme
openmarket-sdk
Open Market API SDK
Usage
# install dependencies
$ npm install openmarket-sdk
import { OpenMarketTxAPI } from 'openmarket-sdk'
let api = new OpenMarketTxAPI({
lcdUrl: 'http://localhost:1317', // rest server url
chainId: 'mpchain',
})
//...
const mnemonic = 'abra kadabra ...'
const address = api.getAddress(mnemonic)
const ecpairPriv = api.getECPairPriv(mnemonic)
//...
let someTxMsg = {
//...
}
const signedTx = api.sign(someTxMsg, Buffer.from(ecpairPriv))
let tx = await api.broadcast(signedTx)