@solana/web3.js 1.48.0 → 1.50.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
@@ -21836,8 +21836,15 @@ var solanaWeb3 = (function (exports) {
21836
21836
  */
21837
21837
 
21838
21838
 
21839
- async getBlock(slot, opts) {
21840
- const args = this._buildArgsAtLeastConfirmed([slot], opts && opts.commitment);
21839
+ async getBlock(slot, rawConfig) {
21840
+ const {
21841
+ commitment,
21842
+ config
21843
+ } = extractCommitmentFromConfig(rawConfig);
21844
+
21845
+ const args = this._buildArgsAtLeastConfirmed([slot], commitment, undefined
21846
+ /* encoding */
21847
+ , config);
21841
21848
 
21842
21849
  const unsafeRes = await this._rpcRequest('getBlock', args);
21843
21850
  const res = create(unsafeRes, GetBlockRpcResult);
@@ -21923,8 +21930,15 @@ var solanaWeb3 = (function (exports) {
21923
21930
  */
21924
21931
 
21925
21932
 
21926
- async getTransaction(signature, opts) {
21927
- const args = this._buildArgsAtLeastConfirmed([signature], opts && opts.commitment);
21933
+ async getTransaction(signature, rawConfig) {
21934
+ const {
21935
+ commitment,
21936
+ config
21937
+ } = extractCommitmentFromConfig(rawConfig);
21938
+
21939
+ const args = this._buildArgsAtLeastConfirmed([signature], commitment, undefined
21940
+ /* encoding */
21941
+ , config);
21928
21942
 
21929
21943
  const unsafeRes = await this._rpcRequest('getTransaction', args);
21930
21944
  const res = create(unsafeRes, GetTransactionRpcResult);
@@ -21946,8 +21960,13 @@ var solanaWeb3 = (function (exports) {
21946
21960
  */
21947
21961
 
21948
21962
 
21949
- async getParsedTransaction(signature, commitment) {
21950
- const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed');
21963
+ async getParsedTransaction(signature, commitmentOrConfig) {
21964
+ const {
21965
+ commitment,
21966
+ config
21967
+ } = extractCommitmentFromConfig(commitmentOrConfig);
21968
+
21969
+ const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed', config);
21951
21970
 
21952
21971
  const unsafeRes = await this._rpcRequest('getTransaction', args);
21953
21972
  const res = create(unsafeRes, GetParsedTransactionRpcResult);
@@ -21963,9 +21982,13 @@ var solanaWeb3 = (function (exports) {
21963
21982
  */
21964
21983
 
21965
21984
 
21966
- async getParsedTransactions(signatures, commitment) {
21985
+ async getParsedTransactions(signatures, commitmentOrConfig) {
21986
+ const {
21987
+ commitment,
21988
+ config
21989
+ } = extractCommitmentFromConfig(commitmentOrConfig);
21967
21990
  const batch = signatures.map(signature => {
21968
- const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed');
21991
+ const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed', config);
21969
21992
 
21970
21993
  return {
21971
21994
  methodName: 'getTransaction',
@@ -21990,9 +22013,15 @@ var solanaWeb3 = (function (exports) {
21990
22013
  */
21991
22014
 
21992
22015
 
21993
- async getTransactions(signatures, commitment) {
22016
+ async getTransactions(signatures, commitmentOrConfig) {
22017
+ const {
22018
+ commitment,
22019
+ config
22020
+ } = extractCommitmentFromConfig(commitmentOrConfig);
21994
22021
  const batch = signatures.map(signature => {
21995
- const args = this._buildArgsAtLeastConfirmed([signature], commitment);
22022
+ const args = this._buildArgsAtLeastConfirmed([signature], commitment, undefined
22023
+ /* encoding */
22024
+ , config);
21996
22025
 
21997
22026
  return {
21998
22027
  methodName: 'getTransaction',
@@ -22434,6 +22463,28 @@ var solanaWeb3 = (function (exports) {
22434
22463
  this._pollingBlockhash = false;
22435
22464
  }
22436
22465
  }
22466
+ /**
22467
+ * get the stake minimum delegation
22468
+ */
22469
+
22470
+
22471
+ async getStakeMinimumDelegation(config) {
22472
+ const {
22473
+ commitment,
22474
+ config: configArg
22475
+ } = extractCommitmentFromConfig(config);
22476
+
22477
+ const args = this._buildArgs([], commitment, 'base64', configArg);
22478
+
22479
+ const unsafeRes = await this._rpcRequest('getStakeMinimumDelegation', args);
22480
+ const res = create(unsafeRes, jsonRpcResultAndContext(number()));
22481
+
22482
+ if ('error' in res) {
22483
+ throw new SolanaJSONRPCError(res.error, `failed to get stake minimum delegation`);
22484
+ }
22485
+
22486
+ return res.result;
22487
+ }
22437
22488
  /**
22438
22489
  * Simulate a transaction
22439
22490
  */
@@ -22665,6 +22716,11 @@ var solanaWeb3 = (function (exports) {
22665
22716
  this._rpcWebSocketConnected = false;
22666
22717
  this._rpcWebSocketGeneration++;
22667
22718
 
22719
+ if (this._rpcWebSocketIdleTimeout) {
22720
+ clearTimeout(this._rpcWebSocketIdleTimeout);
22721
+ this._rpcWebSocketIdleTimeout = null;
22722
+ }
22723
+
22668
22724
  if (this._rpcWebSocketHeartbeat) {
22669
22725
  clearInterval(this._rpcWebSocketHeartbeat);
22670
22726
  this._rpcWebSocketHeartbeat = null;