@solana/web3.js 1.48.1 → 1.49.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/lib/index.browser.cjs.js +1393 -1171
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +1393 -1171
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +1404 -1172
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +20 -6
- package/lib/index.esm.js +1404 -1172
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +1384 -1162
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +2 -2
- package/lib/index.iife.min.js.map +1 -1
- package/lib/index.native.js +1393 -1171
- package/lib/index.native.js.map +1 -1
- package/package.json +1 -1
- package/src/connection.ts +30 -4
package/package.json
CHANGED
package/src/connection.ts
CHANGED
|
@@ -443,6 +443,16 @@ export type GetBalanceConfig = {
|
|
|
443
443
|
minContextSlot?: number;
|
|
444
444
|
};
|
|
445
445
|
|
|
446
|
+
/**
|
|
447
|
+
* Configuration object for changing `getBlock` query behavior
|
|
448
|
+
*/
|
|
449
|
+
export type GetBlockConfig = {
|
|
450
|
+
/** The level of finality desired */
|
|
451
|
+
commitment?: Finality;
|
|
452
|
+
/** The max transaction version to return in responses. If the requested transaction is a higher version, an error will be returned */
|
|
453
|
+
maxSupportedTransactionVersion?: number;
|
|
454
|
+
};
|
|
455
|
+
|
|
446
456
|
/**
|
|
447
457
|
* Configuration object for changing `getBlockHeight` query behavior
|
|
448
458
|
*/
|
|
@@ -505,6 +515,16 @@ export type GetSlotLeaderConfig = {
|
|
|
505
515
|
minContextSlot?: number;
|
|
506
516
|
};
|
|
507
517
|
|
|
518
|
+
/**
|
|
519
|
+
* Configuration object for changing `getTransaction` query behavior
|
|
520
|
+
*/
|
|
521
|
+
export type GetTransactionConfig = {
|
|
522
|
+
/** The level of finality desired */
|
|
523
|
+
commitment?: Finality;
|
|
524
|
+
/** The max transaction version to return in responses. If the requested transaction is a higher version, an error will be returned */
|
|
525
|
+
maxSupportedTransactionVersion?: number;
|
|
526
|
+
};
|
|
527
|
+
|
|
508
528
|
/**
|
|
509
529
|
* Configuration object for changing `getLargestAccounts` query behavior
|
|
510
530
|
*/
|
|
@@ -3592,11 +3612,14 @@ export class Connection {
|
|
|
3592
3612
|
*/
|
|
3593
3613
|
async getBlock(
|
|
3594
3614
|
slot: number,
|
|
3595
|
-
|
|
3615
|
+
rawConfig?: GetBlockConfig,
|
|
3596
3616
|
): Promise<BlockResponse | null> {
|
|
3617
|
+
const {commitment, config} = extractCommitmentFromConfig(rawConfig);
|
|
3597
3618
|
const args = this._buildArgsAtLeastConfirmed(
|
|
3598
3619
|
[slot],
|
|
3599
|
-
|
|
3620
|
+
commitment as Finality,
|
|
3621
|
+
undefined /* encoding */,
|
|
3622
|
+
config,
|
|
3600
3623
|
);
|
|
3601
3624
|
const unsafeRes = await this._rpcRequest('getBlock', args);
|
|
3602
3625
|
const res = create(unsafeRes, GetBlockRpcResult);
|
|
@@ -3684,11 +3707,14 @@ export class Connection {
|
|
|
3684
3707
|
*/
|
|
3685
3708
|
async getTransaction(
|
|
3686
3709
|
signature: string,
|
|
3687
|
-
|
|
3710
|
+
rawConfig?: GetTransactionConfig,
|
|
3688
3711
|
): Promise<TransactionResponse | null> {
|
|
3712
|
+
const {commitment, config} = extractCommitmentFromConfig(rawConfig);
|
|
3689
3713
|
const args = this._buildArgsAtLeastConfirmed(
|
|
3690
3714
|
[signature],
|
|
3691
|
-
|
|
3715
|
+
commitment as Finality,
|
|
3716
|
+
undefined /* encoding */,
|
|
3717
|
+
config,
|
|
3692
3718
|
);
|
|
3693
3719
|
const unsafeRes = await this._rpcRequest('getTransaction', args);
|
|
3694
3720
|
const res = create(unsafeRes, GetTransactionRpcResult);
|