@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/lib/index.esm.js
CHANGED
|
@@ -5246,7 +5246,7 @@ class Connection {
|
|
|
5246
5246
|
}
|
|
5247
5247
|
|
|
5248
5248
|
assert(decodedSignature.length === 64, 'signature has invalid length');
|
|
5249
|
-
const
|
|
5249
|
+
const confirmationCommitment = commitment || this.commitment;
|
|
5250
5250
|
let timeoutId;
|
|
5251
5251
|
let signatureSubscriptionId;
|
|
5252
5252
|
let disposeSignatureSubscriptionStateChangeObserver;
|
|
@@ -5264,7 +5264,7 @@ class Connection {
|
|
|
5264
5264
|
__type: TransactionStatus.PROCESSED,
|
|
5265
5265
|
response
|
|
5266
5266
|
});
|
|
5267
|
-
},
|
|
5267
|
+
}, confirmationCommitment);
|
|
5268
5268
|
const subscriptionSetupPromise = new Promise(resolveSubscriptionSetup => {
|
|
5269
5269
|
if (signatureSubscriptionId == null) {
|
|
5270
5270
|
resolveSubscriptionSetup();
|
|
@@ -5292,11 +5292,41 @@ class Connection {
|
|
|
5292
5292
|
value
|
|
5293
5293
|
} = response;
|
|
5294
5294
|
|
|
5295
|
+
if (value == null) {
|
|
5296
|
+
return;
|
|
5297
|
+
}
|
|
5298
|
+
|
|
5295
5299
|
if (value !== null && value !== void 0 && value.err) {
|
|
5296
5300
|
reject(value.err);
|
|
5297
|
-
}
|
|
5301
|
+
} else {
|
|
5302
|
+
switch (confirmationCommitment) {
|
|
5303
|
+
case 'confirmed':
|
|
5304
|
+
case 'single':
|
|
5305
|
+
case 'singleGossip':
|
|
5306
|
+
{
|
|
5307
|
+
if (value.confirmationStatus === 'processed') {
|
|
5308
|
+
return;
|
|
5309
|
+
}
|
|
5310
|
+
|
|
5311
|
+
break;
|
|
5312
|
+
}
|
|
5313
|
+
|
|
5314
|
+
case 'finalized':
|
|
5315
|
+
case 'max':
|
|
5316
|
+
case 'root':
|
|
5317
|
+
{
|
|
5318
|
+
if (value.confirmationStatus === 'processed' || value.confirmationStatus === 'confirmed') {
|
|
5319
|
+
return;
|
|
5320
|
+
}
|
|
5321
|
+
|
|
5322
|
+
break;
|
|
5323
|
+
}
|
|
5324
|
+
// exhaust enums to ensure full coverage
|
|
5325
|
+
|
|
5326
|
+
case 'processed':
|
|
5327
|
+
case 'recent':
|
|
5328
|
+
}
|
|
5298
5329
|
|
|
5299
|
-
if (value) {
|
|
5300
5330
|
done = true;
|
|
5301
5331
|
resolve({
|
|
5302
5332
|
__type: TransactionStatus.PROCESSED,
|
|
@@ -5315,7 +5345,7 @@ class Connection {
|
|
|
5315
5345
|
if (typeof strategy === 'string') {
|
|
5316
5346
|
let timeoutMs = this._confirmTransactionInitialTimeout || 60 * 1000;
|
|
5317
5347
|
|
|
5318
|
-
switch (
|
|
5348
|
+
switch (confirmationCommitment) {
|
|
5319
5349
|
case 'processed':
|
|
5320
5350
|
case 'recent':
|
|
5321
5351
|
case 'single':
|