@drift-labs/sdk 2.97.0-beta.29 → 2.97.0-beta.30

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/VERSION CHANGED
@@ -1 +1 @@
1
- 2.97.0-beta.29
1
+ 2.97.0-beta.30
@@ -249,7 +249,7 @@ class BaseTxSender {
249
249
  }
250
250
  async checkConfirmationResultForError(txSig, result) {
251
251
  var _a;
252
- if (result.err) {
252
+ if (result === null || result === void 0 ? void 0 : result.err) {
253
253
  await (0, reportTransactionError_1.throwTransactionError)(txSig, this.connection, (_a = this.opts) === null || _a === void 0 ? void 0 : _a.commitment);
254
254
  }
255
255
  return;
@@ -64,14 +64,14 @@ class FastSingleTxSender extends baseTxSender_1.BaseTxSender {
64
64
  this.confirmTransaction(txid, opts.commitment).then(async (result) => {
65
65
  var _a;
66
66
  (_a = this.txSigCache) === null || _a === void 0 ? void 0 : _a.set(txid, true);
67
- await this.checkConfirmationResultForError(txid, result.value);
67
+ await this.checkConfirmationResultForError(txid, result === null || result === void 0 ? void 0 : result.value);
68
68
  slot = result.context.slot;
69
69
  });
70
70
  }
71
71
  else {
72
72
  const result = await this.confirmTransaction(txid, opts.commitment);
73
73
  (_b = this.txSigCache) === null || _b === void 0 ? void 0 : _b.set(txid, true);
74
- await this.checkConfirmationResultForError(txid, result.value);
74
+ await this.checkConfirmationResultForError(txid, result === null || result === void 0 ? void 0 : result.value);
75
75
  slot = result.context.slot;
76
76
  }
77
77
  }
@@ -70,7 +70,7 @@ class RetryTxSender extends baseTxSender_1.BaseTxSender {
70
70
  try {
71
71
  const result = await this.confirmTransaction(txid, opts.commitment);
72
72
  (_b = this.txSigCache) === null || _b === void 0 ? void 0 : _b.set(txid, true);
73
- await this.checkConfirmationResultForError(txid, result.value);
73
+ await this.checkConfirmationResultForError(txid, result === null || result === void 0 ? void 0 : result.value);
74
74
  slot = result.context.slot;
75
75
  // eslint-disable-next-line no-useless-catch
76
76
  }
@@ -142,7 +142,7 @@ class WhileValidTxSender extends baseTxSender_1.BaseTxSender {
142
142
  try {
143
143
  const result = await this.confirmTransaction(txid, opts.commitment);
144
144
  (_b = this.txSigCache) === null || _b === void 0 ? void 0 : _b.set(txid, true);
145
- await this.checkConfirmationResultForError(txid, result.value);
145
+ await this.checkConfirmationResultForError(txid, result === null || result === void 0 ? void 0 : result.value);
146
146
  if ((_c = result === null || result === void 0 ? void 0 : result.value) === null || _c === void 0 ? void 0 : _c.err) {
147
147
  // Fallback error handling if there's a problem reporting the error in checkConfirmationResultForError
148
148
  throw new web3_js_1.SendTransactionError({
@@ -249,7 +249,7 @@ class BaseTxSender {
249
249
  }
250
250
  async checkConfirmationResultForError(txSig, result) {
251
251
  var _a;
252
- if (result.err) {
252
+ if (result === null || result === void 0 ? void 0 : result.err) {
253
253
  await (0, reportTransactionError_1.throwTransactionError)(txSig, this.connection, (_a = this.opts) === null || _a === void 0 ? void 0 : _a.commitment);
254
254
  }
255
255
  return;
@@ -64,14 +64,14 @@ class FastSingleTxSender extends baseTxSender_1.BaseTxSender {
64
64
  this.confirmTransaction(txid, opts.commitment).then(async (result) => {
65
65
  var _a;
66
66
  (_a = this.txSigCache) === null || _a === void 0 ? void 0 : _a.set(txid, true);
67
- await this.checkConfirmationResultForError(txid, result.value);
67
+ await this.checkConfirmationResultForError(txid, result === null || result === void 0 ? void 0 : result.value);
68
68
  slot = result.context.slot;
69
69
  });
70
70
  }
71
71
  else {
72
72
  const result = await this.confirmTransaction(txid, opts.commitment);
73
73
  (_b = this.txSigCache) === null || _b === void 0 ? void 0 : _b.set(txid, true);
74
- await this.checkConfirmationResultForError(txid, result.value);
74
+ await this.checkConfirmationResultForError(txid, result === null || result === void 0 ? void 0 : result.value);
75
75
  slot = result.context.slot;
76
76
  }
77
77
  }
@@ -70,7 +70,7 @@ class RetryTxSender extends baseTxSender_1.BaseTxSender {
70
70
  try {
71
71
  const result = await this.confirmTransaction(txid, opts.commitment);
72
72
  (_b = this.txSigCache) === null || _b === void 0 ? void 0 : _b.set(txid, true);
73
- await this.checkConfirmationResultForError(txid, result.value);
73
+ await this.checkConfirmationResultForError(txid, result === null || result === void 0 ? void 0 : result.value);
74
74
  slot = result.context.slot;
75
75
  // eslint-disable-next-line no-useless-catch
76
76
  }
@@ -142,7 +142,7 @@ class WhileValidTxSender extends baseTxSender_1.BaseTxSender {
142
142
  try {
143
143
  const result = await this.confirmTransaction(txid, opts.commitment);
144
144
  (_b = this.txSigCache) === null || _b === void 0 ? void 0 : _b.set(txid, true);
145
- await this.checkConfirmationResultForError(txid, result.value);
145
+ await this.checkConfirmationResultForError(txid, result === null || result === void 0 ? void 0 : result.value);
146
146
  if ((_c = result === null || result === void 0 ? void 0 : result.value) === null || _c === void 0 ? void 0 : _c.err) {
147
147
  // Fallback error handling if there's a problem reporting the error in checkConfirmationResultForError
148
148
  throw new web3_js_1.SendTransactionError({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.97.0-beta.29",
3
+ "version": "2.97.0-beta.30",
4
4
  "main": "lib/node/index.js",
5
5
  "types": "lib/node/index.d.ts",
6
6
  "browser": "./lib/browser/index.js",
@@ -415,7 +415,7 @@ export abstract class BaseTxSender implements TxSender {
415
415
  txSig: string,
416
416
  result: SignatureResult
417
417
  ): Promise<void> {
418
- if (result.err) {
418
+ if (result?.err) {
419
419
  await throwTransactionError(
420
420
  txSig,
421
421
  this.connection,
@@ -121,14 +121,14 @@ export class FastSingleTxSender extends BaseTxSender {
121
121
  this.confirmTransaction(txid, opts.commitment).then(
122
122
  async (result) => {
123
123
  this.txSigCache?.set(txid, true);
124
- await this.checkConfirmationResultForError(txid, result.value);
124
+ await this.checkConfirmationResultForError(txid, result?.value);
125
125
  slot = result.context.slot;
126
126
  }
127
127
  );
128
128
  } else {
129
129
  const result = await this.confirmTransaction(txid, opts.commitment);
130
130
  this.txSigCache?.set(txid, true);
131
- await this.checkConfirmationResultForError(txid, result.value);
131
+ await this.checkConfirmationResultForError(txid, result?.value);
132
132
  slot = result.context.slot;
133
133
  }
134
134
  } catch (e) {
@@ -120,7 +120,7 @@ export class RetryTxSender extends BaseTxSender {
120
120
  const result = await this.confirmTransaction(txid, opts.commitment);
121
121
  this.txSigCache?.set(txid, true);
122
122
 
123
- await this.checkConfirmationResultForError(txid, result.value);
123
+ await this.checkConfirmationResultForError(txid, result?.value);
124
124
 
125
125
  slot = result.context.slot;
126
126
  // eslint-disable-next-line no-useless-catch
@@ -238,7 +238,7 @@ export class WhileValidTxSender extends BaseTxSender {
238
238
 
239
239
  this.txSigCache?.set(txid, true);
240
240
 
241
- await this.checkConfirmationResultForError(txid, result.value);
241
+ await this.checkConfirmationResultForError(txid, result?.value);
242
242
 
243
243
  if (result?.value?.err) {
244
244
  // Fallback error handling if there's a problem reporting the error in checkConfirmationResultForError