coreum-js 2.17.1 → 2.17.2

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.
@@ -108,7 +108,7 @@ export declare class Client {
108
108
  * @param memo An arbitrary string to add as Memo for the transaction
109
109
  * @returns TxRaw object to be submitted to the chain
110
110
  */
111
- signTx(msgs: readonly EncodeObject[], memo?: string): Promise<TxRaw>;
111
+ signTx(msgs: readonly EncodeObject[], memo?: string, custom_sequence?: number): Promise<TxRaw>;
112
112
  /**
113
113
  *
114
114
  * @param event String describing the event to subscribe to.
@@ -230,13 +230,36 @@ class Client {
230
230
  };
231
231
  }
232
232
  }
233
+ // async signTx(msgs, memo, custom_sequence) {
234
+ // try {
235
+ // this._isSigningClientInit();
236
+ // const signingClient = this._client;
237
+ // const { accountNumber, sequence } = await this._client.getAccount(this.address);
238
+ // const { fee } = await this.getTxFee(msgs);
239
+ // const signerData = {
240
+ // accountNumber,
241
+ // sequence: custom_sequence || sequence,
242
+ // chainId: this.config.chain_id,
243
+ // };
244
+ // const signed = await signingClient.sign(this.address, msgs, fee, this._tx_memo
245
+ // ? `${this._tx_memo} ${memo ? `- ${memo}` : ""}`
246
+ // : memo || "", signerData);
247
+ // return signed;
248
+ // }
249
+ // catch (e) {
250
+ // throw {
251
+ // thrower: e.thrower || "addSignature",
252
+ // error: e.error || e,
253
+ // };
254
+ // }
255
+ // }
233
256
  /**
234
257
  *
235
258
  * @param msgs An array of messages for the Transaction
236
259
  * @param memo An arbitrary string to add as Memo for the transaction
237
260
  * @returns TxRaw object to be submitted to the chain
238
261
  */
239
- async signTx(msgs, memo) {
262
+ async signTx(msgs, memo = "", custom_sequence) {
240
263
  try {
241
264
  this._isSigningClientInit();
242
265
  const signingClient = this._client;
@@ -244,7 +267,7 @@ class Client {
244
267
  const { fee } = await this.getTxFee(msgs);
245
268
  const signerData = {
246
269
  accountNumber,
247
- sequence,
270
+ sequence: custom_sequence || sequence,
248
271
  chainId: this.config.chain_id,
249
272
  };
250
273
  const signed = await signingClient.sign(this.address, msgs, fee, this._tx_memo
@@ -108,7 +108,7 @@ export declare class Client {
108
108
  * @param memo An arbitrary string to add as Memo for the transaction
109
109
  * @returns TxRaw object to be submitted to the chain
110
110
  */
111
- signTx(msgs: readonly EncodeObject[], memo?: string): Promise<TxRaw>;
111
+ signTx(msgs: readonly EncodeObject[], memo?: string, custom_sequence?: number): Promise<TxRaw>;
112
112
  /**
113
113
  *
114
114
  * @param event String describing the event to subscribe to.
@@ -234,13 +234,36 @@ export class Client {
234
234
  };
235
235
  }
236
236
  }
237
+ // async signTx(msgs, memo, custom_sequence) {
238
+ // try {
239
+ // this._isSigningClientInit();
240
+ // const signingClient = this._client;
241
+ // const { accountNumber, sequence } = await this._client.getAccount(this.address);
242
+ // const { fee } = await this.getTxFee(msgs);
243
+ // const signerData = {
244
+ // accountNumber,
245
+ // sequence: custom_sequence || sequence,
246
+ // chainId: this.config.chain_id,
247
+ // };
248
+ // const signed = await signingClient.sign(this.address, msgs, fee, this._tx_memo
249
+ // ? `${this._tx_memo} ${memo ? `- ${memo}` : ""}`
250
+ // : memo || "", signerData);
251
+ // return signed;
252
+ // }
253
+ // catch (e) {
254
+ // throw {
255
+ // thrower: e.thrower || "addSignature",
256
+ // error: e.error || e,
257
+ // };
258
+ // }
259
+ // }
237
260
  /**
238
261
  *
239
262
  * @param msgs An array of messages for the Transaction
240
263
  * @param memo An arbitrary string to add as Memo for the transaction
241
264
  * @returns TxRaw object to be submitted to the chain
242
265
  */
243
- async signTx(msgs, memo) {
266
+ async signTx(msgs, memo = "", custom_sequence) {
244
267
  try {
245
268
  this._isSigningClientInit();
246
269
  const signingClient = this._client;
@@ -248,7 +271,7 @@ export class Client {
248
271
  const { fee } = await this.getTxFee(msgs);
249
272
  const signerData = {
250
273
  accountNumber,
251
- sequence,
274
+ sequence: custom_sequence || sequence,
252
275
  chainId: this.config.chain_id,
253
276
  };
254
277
  const signed = await signingClient.sign(this.address, msgs, fee, this._tx_memo
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coreum-js",
3
- "version": "2.17.1",
3
+ "version": "2.17.2",
4
4
  "description": "JS/TS Library to to easily make use of the Coreum Blockchain",
5
5
  "main": "dist/main/index.js",
6
6
  "module": "dist/module/index.js",