@solana/web3.js 1.35.2 → 1.36.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.esm.js +14 -17
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +14 -17
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +9 -2
- package/lib/index.esm.js +14 -17
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +14 -17
- 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/module.flow.js +10 -2
- package/package.json +2 -2
- package/src/connection.ts +21 -20
package/lib/index.d.ts
CHANGED
|
@@ -1527,13 +1527,20 @@ declare module '@solana/web3.js' {
|
|
|
1527
1527
|
publicKey: PublicKey,
|
|
1528
1528
|
commitment?: Commitment,
|
|
1529
1529
|
): Promise<AccountInfo<Buffer> | null>;
|
|
1530
|
+
/**
|
|
1531
|
+
* Fetch all the account info for multiple accounts specified by an array of public keys, return with context
|
|
1532
|
+
*/
|
|
1533
|
+
getMultipleAccountsInfoAndContext(
|
|
1534
|
+
publicKeys: PublicKey[],
|
|
1535
|
+
commitment?: Commitment,
|
|
1536
|
+
): Promise<RpcResponseAndContext<(AccountInfo<Buffer> | null)[]>>;
|
|
1530
1537
|
/**
|
|
1531
1538
|
* Fetch all the account info for multiple accounts specified by an array of public keys
|
|
1532
1539
|
*/
|
|
1533
1540
|
getMultipleAccountsInfo(
|
|
1534
1541
|
publicKeys: PublicKey[],
|
|
1535
|
-
|
|
1536
|
-
): Promise<(AccountInfo<Buffer
|
|
1542
|
+
commitment?: Commitment,
|
|
1543
|
+
): Promise<(AccountInfo<Buffer> | null)[]>;
|
|
1537
1544
|
/**
|
|
1538
1545
|
* Returns epoch activation information for a stake account that has been delegated
|
|
1539
1546
|
*/
|
package/lib/index.esm.js
CHANGED
|
@@ -5503,35 +5503,32 @@ class Connection {
|
|
|
5503
5503
|
}
|
|
5504
5504
|
}
|
|
5505
5505
|
/**
|
|
5506
|
-
* Fetch all the account info for multiple accounts specified by an array of public keys
|
|
5506
|
+
* Fetch all the account info for multiple accounts specified by an array of public keys, return with context
|
|
5507
5507
|
*/
|
|
5508
5508
|
|
|
5509
5509
|
|
|
5510
|
-
async
|
|
5510
|
+
async getMultipleAccountsInfoAndContext(publicKeys, commitment) {
|
|
5511
5511
|
const keys = publicKeys.map(key => key.toBase58());
|
|
5512
|
-
let commitment;
|
|
5513
|
-
let encoding = 'base64';
|
|
5514
5512
|
|
|
5515
|
-
|
|
5516
|
-
if (typeof configOrCommitment === 'string') {
|
|
5517
|
-
commitment = configOrCommitment;
|
|
5518
|
-
encoding = 'base64';
|
|
5519
|
-
} else {
|
|
5520
|
-
commitment = configOrCommitment.commitment;
|
|
5521
|
-
encoding = configOrCommitment.encoding || 'base64';
|
|
5522
|
-
}
|
|
5523
|
-
}
|
|
5524
|
-
|
|
5525
|
-
const args = this._buildArgs([keys], commitment, encoding);
|
|
5513
|
+
const args = this._buildArgs([keys], commitment, 'base64');
|
|
5526
5514
|
|
|
5527
5515
|
const unsafeRes = await this._rpcRequest('getMultipleAccounts', args);
|
|
5528
|
-
const res = create(unsafeRes, jsonRpcResultAndContext(array(nullable(
|
|
5516
|
+
const res = create(unsafeRes, jsonRpcResultAndContext(array(nullable(AccountInfoResult))));
|
|
5529
5517
|
|
|
5530
5518
|
if ('error' in res) {
|
|
5531
5519
|
throw new Error('failed to get info for accounts ' + keys + ': ' + res.error.message);
|
|
5532
5520
|
}
|
|
5533
5521
|
|
|
5534
|
-
return res.result
|
|
5522
|
+
return res.result;
|
|
5523
|
+
}
|
|
5524
|
+
/**
|
|
5525
|
+
* Fetch all the account info for multiple accounts specified by an array of public keys
|
|
5526
|
+
*/
|
|
5527
|
+
|
|
5528
|
+
|
|
5529
|
+
async getMultipleAccountsInfo(publicKeys, commitment) {
|
|
5530
|
+
const res = await this.getMultipleAccountsInfoAndContext(publicKeys, commitment);
|
|
5531
|
+
return res.value;
|
|
5535
5532
|
}
|
|
5536
5533
|
/**
|
|
5537
5534
|
* Returns epoch activation information for a stake account that has been delegated
|