@solana/web3.js 1.49.0 → 1.50.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.cjs.js CHANGED
@@ -7220,8 +7220,13 @@ class Connection {
7220
7220
  */
7221
7221
 
7222
7222
 
7223
- async getParsedTransaction(signature, commitment) {
7224
- const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed');
7223
+ async getParsedTransaction(signature, commitmentOrConfig) {
7224
+ const {
7225
+ commitment,
7226
+ config
7227
+ } = extractCommitmentFromConfig(commitmentOrConfig);
7228
+
7229
+ const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed', config);
7225
7230
 
7226
7231
  const unsafeRes = await this._rpcRequest('getTransaction', args);
7227
7232
  const res = superstruct.create(unsafeRes, GetParsedTransactionRpcResult);
@@ -7237,9 +7242,13 @@ class Connection {
7237
7242
  */
7238
7243
 
7239
7244
 
7240
- async getParsedTransactions(signatures, commitment) {
7245
+ async getParsedTransactions(signatures, commitmentOrConfig) {
7246
+ const {
7247
+ commitment,
7248
+ config
7249
+ } = extractCommitmentFromConfig(commitmentOrConfig);
7241
7250
  const batch = signatures.map(signature => {
7242
- const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed');
7251
+ const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed', config);
7243
7252
 
7244
7253
  return {
7245
7254
  methodName: 'getTransaction',
@@ -7264,9 +7273,15 @@ class Connection {
7264
7273
  */
7265
7274
 
7266
7275
 
7267
- async getTransactions(signatures, commitment) {
7276
+ async getTransactions(signatures, commitmentOrConfig) {
7277
+ const {
7278
+ commitment,
7279
+ config
7280
+ } = extractCommitmentFromConfig(commitmentOrConfig);
7268
7281
  const batch = signatures.map(signature => {
7269
- const args = this._buildArgsAtLeastConfirmed([signature], commitment);
7282
+ const args = this._buildArgsAtLeastConfirmed([signature], commitment, undefined
7283
+ /* encoding */
7284
+ , config);
7270
7285
 
7271
7286
  return {
7272
7287
  methodName: 'getTransaction',
@@ -7708,6 +7723,28 @@ class Connection {
7708
7723
  this._pollingBlockhash = false;
7709
7724
  }
7710
7725
  }
7726
+ /**
7727
+ * get the stake minimum delegation
7728
+ */
7729
+
7730
+
7731
+ async getStakeMinimumDelegation(config) {
7732
+ const {
7733
+ commitment,
7734
+ config: configArg
7735
+ } = extractCommitmentFromConfig(config);
7736
+
7737
+ const args = this._buildArgs([], commitment, 'base64', configArg);
7738
+
7739
+ const unsafeRes = await this._rpcRequest('getStakeMinimumDelegation', args);
7740
+ const res = superstruct.create(unsafeRes, jsonRpcResultAndContext(superstruct.number()));
7741
+
7742
+ if ('error' in res) {
7743
+ throw new SolanaJSONRPCError(res.error, `failed to get stake minimum delegation`);
7744
+ }
7745
+
7746
+ return res.result;
7747
+ }
7711
7748
  /**
7712
7749
  * Simulate a transaction
7713
7750
  */