@solana/web3.js 1.3.1 → 1.4.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 +40 -4
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +40 -4
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +53 -2
- package/lib/index.esm.js +40 -4
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +40 -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/module.flow.js +87 -2
- package/package.json +1 -1
- package/src/connection.ts +101 -3
package/lib/index.browser.esm.js
CHANGED
|
@@ -5441,8 +5441,29 @@ class Connection {
|
|
|
5441
5441
|
*/
|
|
5442
5442
|
|
|
5443
5443
|
|
|
5444
|
-
async getProgramAccounts(programId,
|
|
5445
|
-
const
|
|
5444
|
+
async getProgramAccounts(programId, configOrCommitment) {
|
|
5445
|
+
const extra = {};
|
|
5446
|
+
let commitment;
|
|
5447
|
+
let encoding;
|
|
5448
|
+
|
|
5449
|
+
if (configOrCommitment) {
|
|
5450
|
+
if (typeof configOrCommitment === 'string') {
|
|
5451
|
+
commitment = configOrCommitment;
|
|
5452
|
+
} else {
|
|
5453
|
+
commitment = configOrCommitment.commitment;
|
|
5454
|
+
encoding = configOrCommitment.encoding;
|
|
5455
|
+
|
|
5456
|
+
if (configOrCommitment.dataSlice) {
|
|
5457
|
+
extra.dataSlice = configOrCommitment.dataSlice;
|
|
5458
|
+
}
|
|
5459
|
+
|
|
5460
|
+
if (configOrCommitment.filters) {
|
|
5461
|
+
extra.filters = configOrCommitment.filters;
|
|
5462
|
+
}
|
|
5463
|
+
}
|
|
5464
|
+
}
|
|
5465
|
+
|
|
5466
|
+
const args = this._buildArgs([programId.toBase58()], commitment, encoding || 'base64', extra);
|
|
5446
5467
|
|
|
5447
5468
|
const unsafeRes = await this._rpcRequest('getProgramAccounts', args);
|
|
5448
5469
|
const res = create(unsafeRes, jsonRpcResult(array(KeyedAccountInfoResult)));
|
|
@@ -5460,8 +5481,23 @@ class Connection {
|
|
|
5460
5481
|
*/
|
|
5461
5482
|
|
|
5462
5483
|
|
|
5463
|
-
async getParsedProgramAccounts(programId,
|
|
5464
|
-
const
|
|
5484
|
+
async getParsedProgramAccounts(programId, configOrCommitment) {
|
|
5485
|
+
const extra = {};
|
|
5486
|
+
let commitment;
|
|
5487
|
+
|
|
5488
|
+
if (configOrCommitment) {
|
|
5489
|
+
if (typeof configOrCommitment === 'string') {
|
|
5490
|
+
commitment = configOrCommitment;
|
|
5491
|
+
} else {
|
|
5492
|
+
commitment = configOrCommitment.commitment;
|
|
5493
|
+
|
|
5494
|
+
if (configOrCommitment.filters) {
|
|
5495
|
+
extra.filters = configOrCommitment.filters;
|
|
5496
|
+
}
|
|
5497
|
+
}
|
|
5498
|
+
}
|
|
5499
|
+
|
|
5500
|
+
const args = this._buildArgs([programId.toBase58()], commitment, 'jsonParsed', extra);
|
|
5465
5501
|
|
|
5466
5502
|
const unsafeRes = await this._rpcRequest('getProgramAccounts', args);
|
|
5467
5503
|
const res = create(unsafeRes, jsonRpcResult(array(KeyedParsedAccountInfoResult)));
|