@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.iife.js CHANGED
@@ -18023,8 +18023,29 @@ var solanaWeb3 = (function (exports) {
18023
18023
  */
18024
18024
 
18025
18025
 
18026
- async getProgramAccounts(programId, commitment) {
18027
- const args = this._buildArgs([programId.toBase58()], commitment, 'base64');
18026
+ async getProgramAccounts(programId, configOrCommitment) {
18027
+ const extra = {};
18028
+ let commitment;
18029
+ let encoding;
18030
+
18031
+ if (configOrCommitment) {
18032
+ if (typeof configOrCommitment === 'string') {
18033
+ commitment = configOrCommitment;
18034
+ } else {
18035
+ commitment = configOrCommitment.commitment;
18036
+ encoding = configOrCommitment.encoding;
18037
+
18038
+ if (configOrCommitment.dataSlice) {
18039
+ extra.dataSlice = configOrCommitment.dataSlice;
18040
+ }
18041
+
18042
+ if (configOrCommitment.filters) {
18043
+ extra.filters = configOrCommitment.filters;
18044
+ }
18045
+ }
18046
+ }
18047
+
18048
+ const args = this._buildArgs([programId.toBase58()], commitment, encoding || 'base64', extra);
18028
18049
 
18029
18050
  const unsafeRes = await this._rpcRequest('getProgramAccounts', args);
18030
18051
  const res = create(unsafeRes, jsonRpcResult(array(KeyedAccountInfoResult)));
@@ -18042,8 +18063,23 @@ var solanaWeb3 = (function (exports) {
18042
18063
  */
18043
18064
 
18044
18065
 
18045
- async getParsedProgramAccounts(programId, commitment) {
18046
- const args = this._buildArgs([programId.toBase58()], commitment, 'jsonParsed');
18066
+ async getParsedProgramAccounts(programId, configOrCommitment) {
18067
+ const extra = {};
18068
+ let commitment;
18069
+
18070
+ if (configOrCommitment) {
18071
+ if (typeof configOrCommitment === 'string') {
18072
+ commitment = configOrCommitment;
18073
+ } else {
18074
+ commitment = configOrCommitment.commitment;
18075
+
18076
+ if (configOrCommitment.filters) {
18077
+ extra.filters = configOrCommitment.filters;
18078
+ }
18079
+ }
18080
+ }
18081
+
18082
+ const args = this._buildArgs([programId.toBase58()], commitment, 'jsonParsed', extra);
18047
18083
 
18048
18084
  const unsafeRes = await this._rpcRequest('getProgramAccounts', args);
18049
18085
  const res = create(unsafeRes, jsonRpcResult(array(KeyedParsedAccountInfoResult)));