@openocean.finance/openocean-sdk 1.7.34 → 1.7.35

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.
@@ -73,26 +73,38 @@ function sendRawTransaction(connection, serializedTransaction, n) {
73
73
  }
74
74
  function getTransaction(connection, txid, n) {
75
75
  return __awaiter(this, void 0, void 0, function () {
76
- var response;
76
+ var response, error_1;
77
77
  return __generator(this, function (_a) {
78
78
  switch (_a.label) {
79
79
  case 0:
80
80
  if (n > 2)
81
81
  return [2 /*return*/];
82
+ _a.label = 1;
83
+ case 1:
84
+ _a.trys.push([1, 7, , 10]);
82
85
  return [4 /*yield*/, connection.getTransaction(txid, {
83
86
  commitment: "confirmed",
84
87
  maxSupportedTransactionVersion: 0,
85
88
  })];
86
- case 1:
89
+ case 2:
87
90
  response = _a.sent();
88
91
  console.log('getTransaction', response);
89
- if (!!response) return [3 /*break*/, 4];
92
+ if (!!response) return [3 /*break*/, 5];
90
93
  return [4 /*yield*/, sleep(3000)];
91
- case 2:
94
+ case 3:
92
95
  _a.sent();
93
96
  return [4 /*yield*/, getTransaction(connection, txid, n++)];
94
- case 3: return [2 /*return*/, _a.sent()];
95
- case 4: return [2 /*return*/, response];
97
+ case 4: return [2 /*return*/, _a.sent()];
98
+ case 5: return [2 /*return*/, response];
99
+ case 6: return [3 /*break*/, 10];
100
+ case 7:
101
+ error_1 = _a.sent();
102
+ return [4 /*yield*/, sleep(3000)];
103
+ case 8:
104
+ _a.sent();
105
+ return [4 /*yield*/, getTransaction(connection, txid, n++)];
106
+ case 9: return [2 /*return*/, _a.sent()];
107
+ case 10: return [2 /*return*/];
96
108
  }
97
109
  });
98
110
  });
@@ -109,8 +121,11 @@ function transactionSenderAndConfirmationWaiter(_a) {
109
121
  if (!txid) {
110
122
  throw new Error('Transaction not confirmed.');
111
123
  }
112
- return [4 /*yield*/, getTransaction(connection, txid, 0)];
124
+ return [4 /*yield*/, sleep(2000)];
113
125
  case 2:
126
+ _c.sent();
127
+ return [4 /*yield*/, getTransaction(connection, txid, 0)];
128
+ case 3:
114
129
  response = _c.sent();
115
130
  if (!response) {
116
131
  throw new Error('Transaction not confirmed.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openocean.finance/openocean-sdk",
3
- "version": "1.7.34",
3
+ "version": "1.7.35",
4
4
  "description": "Openocean sdk",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {