@solana/web3.js 1.48.0 → 1.49.0
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 +18 -4
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +18 -4
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +18 -4
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +20 -6
- package/lib/index.esm.js +18 -4
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +18 -4
- 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 +18 -4
- package/lib/index.native.js.map +1 -1
- package/package.json +1 -1
- package/src/connection.ts +30 -4
package/lib/index.d.ts
CHANGED
|
@@ -480,6 +480,15 @@ declare module '@solana/web3.js' {
|
|
|
480
480
|
/** The minimum slot that the request can be evaluated at */
|
|
481
481
|
minContextSlot?: number;
|
|
482
482
|
};
|
|
483
|
+
/**
|
|
484
|
+
* Configuration object for changing `getBlock` query behavior
|
|
485
|
+
*/
|
|
486
|
+
export type GetBlockConfig = {
|
|
487
|
+
/** The level of finality desired */
|
|
488
|
+
commitment?: Finality;
|
|
489
|
+
/** The max transaction version to return in responses. If the requested transaction is a higher version, an error will be returned */
|
|
490
|
+
maxSupportedTransactionVersion?: number;
|
|
491
|
+
};
|
|
483
492
|
/**
|
|
484
493
|
* Configuration object for changing `getBlockHeight` query behavior
|
|
485
494
|
*/
|
|
@@ -536,6 +545,15 @@ declare module '@solana/web3.js' {
|
|
|
536
545
|
/** The minimum slot that the request can be evaluated at */
|
|
537
546
|
minContextSlot?: number;
|
|
538
547
|
};
|
|
548
|
+
/**
|
|
549
|
+
* Configuration object for changing `getTransaction` query behavior
|
|
550
|
+
*/
|
|
551
|
+
export type GetTransactionConfig = {
|
|
552
|
+
/** The level of finality desired */
|
|
553
|
+
commitment?: Finality;
|
|
554
|
+
/** The max transaction version to return in responses. If the requested transaction is a higher version, an error will be returned */
|
|
555
|
+
maxSupportedTransactionVersion?: number;
|
|
556
|
+
};
|
|
539
557
|
/**
|
|
540
558
|
* Configuration object for changing `getLargestAccounts` query behavior
|
|
541
559
|
*/
|
|
@@ -1738,9 +1756,7 @@ declare module '@solana/web3.js' {
|
|
|
1738
1756
|
*/
|
|
1739
1757
|
getBlock(
|
|
1740
1758
|
slot: number,
|
|
1741
|
-
|
|
1742
|
-
commitment?: Finality;
|
|
1743
|
-
},
|
|
1759
|
+
rawConfig?: GetBlockConfig,
|
|
1744
1760
|
): Promise<BlockResponse | null>;
|
|
1745
1761
|
getBlockHeight(
|
|
1746
1762
|
commitmentOrConfig?: Commitment | GetBlockHeightConfig,
|
|
@@ -1753,9 +1769,7 @@ declare module '@solana/web3.js' {
|
|
|
1753
1769
|
*/
|
|
1754
1770
|
getTransaction(
|
|
1755
1771
|
signature: string,
|
|
1756
|
-
|
|
1757
|
-
commitment?: Finality;
|
|
1758
|
-
},
|
|
1772
|
+
rawConfig?: GetTransactionConfig,
|
|
1759
1773
|
): Promise<TransactionResponse | null>;
|
|
1760
1774
|
/**
|
|
1761
1775
|
* Fetch parsed transaction details for a confirmed or finalized transaction
|
package/lib/index.esm.js
CHANGED
|
@@ -7062,8 +7062,15 @@ class Connection {
|
|
|
7062
7062
|
*/
|
|
7063
7063
|
|
|
7064
7064
|
|
|
7065
|
-
async getBlock(slot,
|
|
7066
|
-
const
|
|
7065
|
+
async getBlock(slot, rawConfig) {
|
|
7066
|
+
const {
|
|
7067
|
+
commitment,
|
|
7068
|
+
config
|
|
7069
|
+
} = extractCommitmentFromConfig(rawConfig);
|
|
7070
|
+
|
|
7071
|
+
const args = this._buildArgsAtLeastConfirmed([slot], commitment, undefined
|
|
7072
|
+
/* encoding */
|
|
7073
|
+
, config);
|
|
7067
7074
|
|
|
7068
7075
|
const unsafeRes = await this._rpcRequest('getBlock', args);
|
|
7069
7076
|
const res = create(unsafeRes, GetBlockRpcResult);
|
|
@@ -7149,8 +7156,15 @@ class Connection {
|
|
|
7149
7156
|
*/
|
|
7150
7157
|
|
|
7151
7158
|
|
|
7152
|
-
async getTransaction(signature,
|
|
7153
|
-
const
|
|
7159
|
+
async getTransaction(signature, rawConfig) {
|
|
7160
|
+
const {
|
|
7161
|
+
commitment,
|
|
7162
|
+
config
|
|
7163
|
+
} = extractCommitmentFromConfig(rawConfig);
|
|
7164
|
+
|
|
7165
|
+
const args = this._buildArgsAtLeastConfirmed([signature], commitment, undefined
|
|
7166
|
+
/* encoding */
|
|
7167
|
+
, config);
|
|
7154
7168
|
|
|
7155
7169
|
const unsafeRes = await this._rpcRequest('getTransaction', args);
|
|
7156
7170
|
const res = create(unsafeRes, GetTransactionRpcResult);
|