koilib 7.0.0 → 7.1.1

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
@@ -23682,7 +23682,32 @@ class Provider {
23682
23682
  * and the transaction with the arrow function "wait" (see [[wait]])
23683
23683
  */
23684
23684
  async sendTransaction(transaction, broadcast = true) {
23685
- const response = await this.call("chain.submit_transaction", { transaction, broadcast });
23685
+ let response;
23686
+ try {
23687
+ response = await this.call("chain.submit_transaction", { transaction, broadcast });
23688
+ }
23689
+ catch (error) {
23690
+ if (!error.message.includes("rpc failed, context deadline exceeded")) {
23691
+ throw error;
23692
+ }
23693
+ response = {
23694
+ receipt: {
23695
+ id: transaction.id,
23696
+ payer: transaction.header.payer,
23697
+ max_payer_rc: "",
23698
+ rc_limit: transaction.header.rc_limit.toString(),
23699
+ rc_used: "",
23700
+ disk_storage_used: "",
23701
+ network_bandwidth_used: "",
23702
+ compute_bandwidth_used: "",
23703
+ reverted: false,
23704
+ events: [],
23705
+ state_delta_entries: [],
23706
+ logs: [],
23707
+ rpc_error: JSON.parse(error.message),
23708
+ },
23709
+ };
23710
+ }
23686
23711
  if (broadcast) {
23687
23712
  transaction.wait = async (type = "byBlock", timeout = 15000) => {
23688
23713
  return this.wait(transaction.id, type, timeout);