@gnolang/tm2-js-client 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { Provider } from '../provider';
1
+ import { Provider, TransactionEndpoint } from '../provider';
2
2
  import { Signer } from './signer';
3
3
  import { LedgerConnector } from '@cosmjs/ledger-amino';
4
4
  import { Any, Tx } from '../proto';
@@ -85,8 +85,10 @@ export declare class Wallet {
85
85
  * The transaction needs to be signed beforehand.
86
86
  * Returns the transaction hash (base-64)
87
87
  * @param {Tx} tx the signed transaction
88
+ * @param {TransactionEndpoint} endpoint the transaction broadcast type (sync / commit).
89
+ * Defaults to broadcast_sync
88
90
  */
89
- sendTransaction: (tx: Tx) => Promise<string>;
91
+ sendTransaction: (tx: Tx, endpoint?: TransactionEndpoint.BROADCAST_TX_SYNC | TransactionEndpoint.BROADCAST_TX_COMMIT) => Promise<string>;
90
92
  /**
91
93
  * Returns the associated signer
92
94
  */
@@ -248,8 +248,10 @@ var Wallet = /** @class */ (function () {
248
248
  * The transaction needs to be signed beforehand.
249
249
  * Returns the transaction hash (base-64)
250
250
  * @param {Tx} tx the signed transaction
251
+ * @param {TransactionEndpoint} endpoint the transaction broadcast type (sync / commit).
252
+ * Defaults to broadcast_sync
251
253
  */
252
- this.sendTransaction = function (tx) { return __awaiter(_this, void 0, void 0, function () {
254
+ this.sendTransaction = function (tx, endpoint) { return __awaiter(_this, void 0, void 0, function () {
253
255
  var encodedTx;
254
256
  return __generator(this, function (_b) {
255
257
  if (!this.provider) {
@@ -257,7 +259,7 @@ var Wallet = /** @class */ (function () {
257
259
  }
258
260
  encodedTx = (0, provider_1.uint8ArrayToBase64)(proto_1.Tx.encode(tx).finish());
259
261
  // Send the encoded transaction
260
- return [2 /*return*/, this.provider.sendTransaction(encodedTx)];
262
+ return [2 /*return*/, this.provider.sendTransaction(encodedTx, endpoint)];
261
263
  });
262
264
  }); };
263
265
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gnolang/tm2-js-client",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Tendermint2 JS / TS Client",
5
5
  "main": "./bin/index.js",
6
6
  "repository": {