Skip to content

Commit

Permalink
fix: tx rest client
Browse files Browse the repository at this point in the history
  • Loading branch information
bangjelkoski committed May 31, 2022
1 parent fe6bb16 commit 35028d0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/injective-tx/src/clients/TxRestClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ export class TxRestClient {

public async broadcast(txRaw: TxRaw): Promise<any /** TODO */> {
try {
return await this.httpClient.post('cosmos/tx/v1beta1/txs', {
const response = await this.httpClient.post('cosmos/tx/v1beta1/txs', {
tx_bytes: Buffer.from(txRaw.serializeBinary()).toString('base64'),
mode: 'BROADCAST_MODE_BLOCK',
mode: 'BROADCAST_MODE_SYNC',
})

return (response as any).data
} catch (e: any) {
throw new Error(e.message)
}
Expand Down

0 comments on commit 35028d0

Please sign in to comment.