@solana/web3.js 1.64.0 → 1.66.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.d.ts CHANGED
@@ -50,7 +50,8 @@ declare module '@solana/web3.js' {
50
50
  */
51
51
  static unique(): PublicKey;
52
52
  /**
53
- * Default public key value. (All zeros)
53
+ * Default public key value. The base58-encoded string representation is all ones (as seen below)
54
+ * The underlying BN number is 32 bytes that are all zeros
54
55
  */
55
56
  static default: PublicKey;
56
57
  /**
@@ -2025,6 +2026,8 @@ declare module '@solana/web3.js' {
2025
2026
  commitment?: Commitment;
2026
2027
  /** The minimum slot that the request can be evaluated at */
2027
2028
  minContextSlot?: number;
2029
+ /** Optional data slice to limit the returned account data */
2030
+ dataSlice?: DataSlice;
2028
2031
  };
2029
2032
  /**
2030
2033
  * Configuration object for changing `getBalance` query behavior
@@ -2906,6 +2909,8 @@ declare module '@solana/web3.js' {
2906
2909
  commitment?: Commitment;
2907
2910
  /** The minimum slot that the request can be evaluated at */
2908
2911
  minContextSlot?: number;
2912
+ /** Optional data slice to limit the returned account data */
2913
+ dataSlice?: DataSlice;
2909
2914
  };
2910
2915
  /**
2911
2916
  * Configuration object for `getStakeActivation`
@@ -3263,6 +3268,15 @@ declare module '@solana/web3.js' {
3263
3268
  publicKey: PublicKey,
3264
3269
  commitmentOrConfig?: Commitment | GetAccountInfoConfig,
3265
3270
  ): Promise<AccountInfo<Buffer> | null>;
3271
+ /**
3272
+ * Fetch all the account info for multiple accounts specified by an array of public keys, return with context
3273
+ */
3274
+ getMultipleParsedAccounts(
3275
+ publicKeys: PublicKey[],
3276
+ rawConfig?: GetMultipleAccountsConfig,
3277
+ ): Promise<
3278
+ RpcResponseAndContext<(AccountInfo<Buffer | ParsedAccountData> | null)[]>
3279
+ >;
3266
3280
  /**
3267
3281
  * Fetch all the account info for multiple accounts specified by an array of public keys, return with context
3268
3282
  */
package/lib/index.esm.js CHANGED
@@ -166,7 +166,8 @@ class PublicKey extends Struct {
166
166
  return new PublicKey(key.toBuffer());
167
167
  }
168
168
  /**
169
- * Default public key value. (All zeros)
169
+ * Default public key value. The base58-encoded string representation is all ones (as seen below)
170
+ * The underlying BN number is 32 bytes that are all zeros
170
171
  */
171
172
 
172
173
 
@@ -5090,6 +5091,29 @@ class Connection {
5090
5091
  */
5091
5092
 
5092
5093
 
5094
+ async getMultipleParsedAccounts(publicKeys, rawConfig) {
5095
+ const {
5096
+ commitment,
5097
+ config
5098
+ } = extractCommitmentFromConfig(rawConfig);
5099
+ const keys = publicKeys.map(key => key.toBase58());
5100
+
5101
+ const args = this._buildArgs([keys], commitment, 'jsonParsed', config);
5102
+
5103
+ const unsafeRes = await this._rpcRequest('getMultipleAccounts', args);
5104
+ const res = create(unsafeRes, jsonRpcResultAndContext(array(nullable(ParsedAccountInfoResult))));
5105
+
5106
+ if ('error' in res) {
5107
+ throw new SolanaJSONRPCError(res.error, `failed to get info for accounts ${keys}`);
5108
+ }
5109
+
5110
+ return res.result;
5111
+ }
5112
+ /**
5113
+ * Fetch all the account info for multiple accounts specified by an array of public keys, return with context
5114
+ */
5115
+
5116
+
5093
5117
  async getMultipleAccountsInfoAndContext(publicKeys, commitmentOrConfig) {
5094
5118
  const {
5095
5119
  commitment,