koilib 4.1.1 → 4.1.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.
package/dist/koinos.js CHANGED
@@ -10391,9 +10391,15 @@ class Provider {
10391
10391
  /**
10392
10392
  * Function to call "chain.submit_transaction" to send a signed
10393
10393
  * transaction to the blockchain.
10394
+ * @returns It returns the receipt received from the RPC node
10395
+ * and the transaction with the arrow function "wait" (see [[wait]])
10394
10396
  */
10395
10397
  async sendTransaction(transaction) {
10396
- return this.call("chain.submit_transaction", { transaction });
10398
+ const response = await this.call("chain.submit_transaction", { transaction });
10399
+ transaction.wait = async (type = "byBlock", timeout = 60000) => {
10400
+ return this.wait(transaction.id, type, timeout);
10401
+ };
10402
+ return { ...response, transaction: transaction };
10397
10403
  }
10398
10404
  /**
10399
10405
  * Function to call "chain.submit_block" to send a signed
@@ -10957,13 +10963,7 @@ class Signer {
10957
10963
  tx = await this.signTransaction(tx);
10958
10964
  if (!this.provider)
10959
10965
  throw new Error("provider is undefined");
10960
- const { receipt } = await this.provider.sendTransaction(tx);
10961
- tx.wait = async (type = "byBlock", timeout = 60000) => {
10962
- if (!this.provider)
10963
- throw new Error("provider is undefined");
10964
- return this.provider.wait(tx.id, type, timeout);
10965
- };
10966
- return { receipt, transaction: tx };
10966
+ return this.provider.sendTransaction(tx);
10967
10967
  }
10968
10968
  /**
10969
10969
  * Function to recover the public key from hash and signature