@solana/web3.js 1.66.4 → 1.66.5
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/lib/index.browser.cjs.js +35 -5
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +35 -5
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +35 -5
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.esm.js +35 -5
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +35 -5
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +1 -1
- package/lib/index.iife.min.js.map +1 -1
- package/lib/index.native.js +35 -5
- package/lib/index.native.js.map +1 -1
- package/package.json +1 -1
- package/src/connection.ts +31 -5
package/package.json
CHANGED
package/src/connection.ts
CHANGED
|
@@ -3386,7 +3386,7 @@ export class Connection {
|
|
|
3386
3386
|
|
|
3387
3387
|
assert(decodedSignature.length === 64, 'signature has invalid length');
|
|
3388
3388
|
|
|
3389
|
-
const
|
|
3389
|
+
const confirmationCommitment = commitment || this.commitment;
|
|
3390
3390
|
let timeoutId;
|
|
3391
3391
|
let signatureSubscriptionId: number | undefined;
|
|
3392
3392
|
let disposeSignatureSubscriptionStateChangeObserver:
|
|
@@ -3410,7 +3410,7 @@ export class Connection {
|
|
|
3410
3410
|
done = true;
|
|
3411
3411
|
resolve({__type: TransactionStatus.PROCESSED, response});
|
|
3412
3412
|
},
|
|
3413
|
-
|
|
3413
|
+
confirmationCommitment,
|
|
3414
3414
|
);
|
|
3415
3415
|
const subscriptionSetupPromise = new Promise<void>(
|
|
3416
3416
|
resolveSubscriptionSetup => {
|
|
@@ -3438,10 +3438,36 @@ export class Connection {
|
|
|
3438
3438
|
return;
|
|
3439
3439
|
}
|
|
3440
3440
|
const {context, value} = response;
|
|
3441
|
+
if (value == null) {
|
|
3442
|
+
return;
|
|
3443
|
+
}
|
|
3441
3444
|
if (value?.err) {
|
|
3442
3445
|
reject(value.err);
|
|
3443
|
-
}
|
|
3444
|
-
|
|
3446
|
+
} else {
|
|
3447
|
+
switch (confirmationCommitment) {
|
|
3448
|
+
case 'confirmed':
|
|
3449
|
+
case 'single':
|
|
3450
|
+
case 'singleGossip': {
|
|
3451
|
+
if (value.confirmationStatus === 'processed') {
|
|
3452
|
+
return;
|
|
3453
|
+
}
|
|
3454
|
+
break;
|
|
3455
|
+
}
|
|
3456
|
+
case 'finalized':
|
|
3457
|
+
case 'max':
|
|
3458
|
+
case 'root': {
|
|
3459
|
+
if (
|
|
3460
|
+
value.confirmationStatus === 'processed' ||
|
|
3461
|
+
value.confirmationStatus === 'confirmed'
|
|
3462
|
+
) {
|
|
3463
|
+
return;
|
|
3464
|
+
}
|
|
3465
|
+
break;
|
|
3466
|
+
}
|
|
3467
|
+
// exhaust enums to ensure full coverage
|
|
3468
|
+
case 'processed':
|
|
3469
|
+
case 'recent':
|
|
3470
|
+
}
|
|
3445
3471
|
done = true;
|
|
3446
3472
|
resolve({
|
|
3447
3473
|
__type: TransactionStatus.PROCESSED,
|
|
@@ -3463,7 +3489,7 @@ export class Connection {
|
|
|
3463
3489
|
>(resolve => {
|
|
3464
3490
|
if (typeof strategy === 'string') {
|
|
3465
3491
|
let timeoutMs = this._confirmTransactionInitialTimeout || 60 * 1000;
|
|
3466
|
-
switch (
|
|
3492
|
+
switch (confirmationCommitment) {
|
|
3467
3493
|
case 'processed':
|
|
3468
3494
|
case 'recent':
|
|
3469
3495
|
case 'single':
|