@solana/web3.js 1.50.0 → 1.52.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/README.md +4 -0
- package/lib/index.browser.cjs.js +22 -4
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +22 -4
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +22 -4
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +17 -2
- package/lib/index.esm.js +22 -4
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +22 -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 +22 -4
- package/lib/index.native.js.map +1 -1
- package/package.json +2 -2
- package/src/connection.ts +30 -2
- package/src/fee-calculator.ts +2 -0
package/lib/index.d.ts
CHANGED
|
@@ -184,6 +184,8 @@ declare module '@solana/web3.js' {
|
|
|
184
184
|
|
|
185
185
|
/**
|
|
186
186
|
* Calculator for transaction fees.
|
|
187
|
+
*
|
|
188
|
+
* @deprecated Deprecated since Solana v1.8.0.
|
|
187
189
|
*/
|
|
188
190
|
interface FeeCalculator {
|
|
189
191
|
/** Cost in lamports to validate a signature. */
|
|
@@ -719,6 +721,13 @@ declare module '@solana/web3.js' {
|
|
|
719
721
|
* @deprecated Deprecated since Solana v1.8.0. Please use {@link ParsedTransactionMeta} instead.
|
|
720
722
|
*/
|
|
721
723
|
export type ParsedConfirmedTransactionMeta = ParsedTransactionMeta;
|
|
724
|
+
/**
|
|
725
|
+
* Collection of addresses loaded by a transaction using address table lookups
|
|
726
|
+
*/
|
|
727
|
+
export type LoadedAddresses = {
|
|
728
|
+
writable: Array<PublicKey>;
|
|
729
|
+
readonly: Array<PublicKey>;
|
|
730
|
+
};
|
|
722
731
|
/**
|
|
723
732
|
* Metadata for a parsed transaction on the ledger
|
|
724
733
|
*/
|
|
@@ -739,6 +748,8 @@ declare module '@solana/web3.js' {
|
|
|
739
748
|
postTokenBalances?: Array<TokenBalance> | null;
|
|
740
749
|
/** The error result of transaction processing */
|
|
741
750
|
err: TransactionError | null;
|
|
751
|
+
/** The collection of addresses loaded using address lookup tables */
|
|
752
|
+
loadedAddresses?: LoadedAddresses;
|
|
742
753
|
};
|
|
743
754
|
export type CompiledInnerInstruction = {
|
|
744
755
|
index: number;
|
|
@@ -785,6 +796,8 @@ declare module '@solana/web3.js' {
|
|
|
785
796
|
};
|
|
786
797
|
/**
|
|
787
798
|
* A confirmed transaction on the ledger
|
|
799
|
+
*
|
|
800
|
+
* @deprecated Deprecated since Solana v1.8.0.
|
|
788
801
|
*/
|
|
789
802
|
export type ConfirmedTransaction = {
|
|
790
803
|
/** The slot during which the transaction was processed */
|
|
@@ -905,7 +918,9 @@ declare module '@solana/web3.js' {
|
|
|
905
918
|
blockTime: number | null;
|
|
906
919
|
};
|
|
907
920
|
/**
|
|
908
|
-
* A
|
|
921
|
+
* A confirmed block on the ledger
|
|
922
|
+
*
|
|
923
|
+
* @deprecated Deprecated since Solana v1.8.0.
|
|
909
924
|
*/
|
|
910
925
|
export type ConfirmedBlock = {
|
|
911
926
|
/** Blockhash of this block */
|
|
@@ -1537,7 +1552,7 @@ declare module '@solana/web3.js' {
|
|
|
1537
1552
|
*/
|
|
1538
1553
|
getParsedAccountInfo(
|
|
1539
1554
|
publicKey: PublicKey,
|
|
1540
|
-
|
|
1555
|
+
commitmentOrConfig?: Commitment | GetAccountInfoConfig,
|
|
1541
1556
|
): Promise<
|
|
1542
1557
|
RpcResponseAndContext<AccountInfo<Buffer | ParsedAccountData> | null>
|
|
1543
1558
|
>;
|
package/lib/index.esm.js
CHANGED
|
@@ -2254,6 +2254,8 @@ function decodeData(type, buffer) {
|
|
|
2254
2254
|
const FeeCalculatorLayout = BufferLayout.nu64('lamportsPerSignature');
|
|
2255
2255
|
/**
|
|
2256
2256
|
* Calculator for transaction fees.
|
|
2257
|
+
*
|
|
2258
|
+
* @deprecated Deprecated since Solana v1.8.0.
|
|
2257
2259
|
*/
|
|
2258
2260
|
|
|
2259
2261
|
/**
|
|
@@ -5709,6 +5711,10 @@ const TokenBalanceResult = type({
|
|
|
5709
5711
|
owner: optional(string()),
|
|
5710
5712
|
uiTokenAmount: TokenAmountResult
|
|
5711
5713
|
});
|
|
5714
|
+
const LoadedAddressesResult = type({
|
|
5715
|
+
writable: array(PublicKeyFromString),
|
|
5716
|
+
readonly: array(PublicKeyFromString)
|
|
5717
|
+
});
|
|
5712
5718
|
/**
|
|
5713
5719
|
* @internal
|
|
5714
5720
|
*/
|
|
@@ -5728,7 +5734,8 @@ const ConfirmedTransactionMetaResult = type({
|
|
|
5728
5734
|
postBalances: array(number()),
|
|
5729
5735
|
logMessages: optional(nullable(array(string()))),
|
|
5730
5736
|
preTokenBalances: optional(nullable(array(TokenBalanceResult))),
|
|
5731
|
-
postTokenBalances: optional(nullable(array(TokenBalanceResult)))
|
|
5737
|
+
postTokenBalances: optional(nullable(array(TokenBalanceResult))),
|
|
5738
|
+
loadedAddresses: optional(LoadedAddressesResult)
|
|
5732
5739
|
});
|
|
5733
5740
|
/**
|
|
5734
5741
|
* @internal
|
|
@@ -5745,7 +5752,8 @@ const ParsedConfirmedTransactionMetaResult = type({
|
|
|
5745
5752
|
postBalances: array(number()),
|
|
5746
5753
|
logMessages: optional(nullable(array(string()))),
|
|
5747
5754
|
preTokenBalances: optional(nullable(array(TokenBalanceResult))),
|
|
5748
|
-
postTokenBalances: optional(nullable(array(TokenBalanceResult)))
|
|
5755
|
+
postTokenBalances: optional(nullable(array(TokenBalanceResult))),
|
|
5756
|
+
loadedAddresses: optional(LoadedAddressesResult)
|
|
5749
5757
|
});
|
|
5750
5758
|
/**
|
|
5751
5759
|
* Expected JSON RPC response for the "getBlock" message
|
|
@@ -6341,8 +6349,13 @@ class Connection {
|
|
|
6341
6349
|
*/
|
|
6342
6350
|
|
|
6343
6351
|
|
|
6344
|
-
async getParsedAccountInfo(publicKey,
|
|
6345
|
-
const
|
|
6352
|
+
async getParsedAccountInfo(publicKey, commitmentOrConfig) {
|
|
6353
|
+
const {
|
|
6354
|
+
commitment,
|
|
6355
|
+
config
|
|
6356
|
+
} = extractCommitmentFromConfig(commitmentOrConfig);
|
|
6357
|
+
|
|
6358
|
+
const args = this._buildArgs([publicKey.toBase58()], commitment, 'jsonParsed', config);
|
|
6346
6359
|
|
|
6347
6360
|
const unsafeRes = await this._rpcRequest('getAccountInfo', args);
|
|
6348
6361
|
const res = create(unsafeRes, jsonRpcResultAndContext(nullable(ParsedAccountInfoResult)));
|
|
@@ -7942,6 +7955,11 @@ class Connection {
|
|
|
7942
7955
|
this._rpcWebSocketConnected = false;
|
|
7943
7956
|
this._rpcWebSocketGeneration++;
|
|
7944
7957
|
|
|
7958
|
+
if (this._rpcWebSocketIdleTimeout) {
|
|
7959
|
+
clearTimeout(this._rpcWebSocketIdleTimeout);
|
|
7960
|
+
this._rpcWebSocketIdleTimeout = null;
|
|
7961
|
+
}
|
|
7962
|
+
|
|
7945
7963
|
if (this._rpcWebSocketHeartbeat) {
|
|
7946
7964
|
clearInterval(this._rpcWebSocketHeartbeat);
|
|
7947
7965
|
this._rpcWebSocketHeartbeat = null;
|