@solana/web3.js 1.70.2 → 1.71.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.d.ts CHANGED
@@ -1872,9 +1872,11 @@ declare module '@solana/web3.js' {
1872
1872
  */
1873
1873
  addSignature(pubkey: PublicKey, signature: Buffer): void;
1874
1874
  /**
1875
- * Verify signatures of a complete, signed Transaction
1875
+ * Verify signatures of a Transaction
1876
+ * Optional parameter specifies if we're expecting a fully signed Transaction or a partially signed one.
1877
+ * If no boolean is provided, we expect a fully signed Transaction by default.
1876
1878
  */
1877
- verifySignatures(): boolean;
1879
+ verifySignatures(requireAllSignatures?: boolean): boolean;
1878
1880
  /**
1879
1881
  * Serialize the Transaction in the wire format.
1880
1882
  */
@@ -2051,6 +2053,12 @@ declare module '@solana/web3.js' {
2051
2053
  abortSignal?: AbortSignal;
2052
2054
  signature: TransactionSignature;
2053
2055
  }>;
2056
+ /**
2057
+ * This type represents all transaction confirmation strategies
2058
+ */
2059
+ type TransactionConfirmationStrategy =
2060
+ | BlockheightBasedTransactionConfirmationStrategy
2061
+ | DurableNonceTransactionConfirmationStrategy;
2054
2062
  /**
2055
2063
  * The level of commitment desired when querying state
2056
2064
  * <pre>
@@ -3496,12 +3504,10 @@ declare module '@solana/web3.js' {
3496
3504
  }>
3497
3505
  >;
3498
3506
  confirmTransaction(
3499
- strategy:
3500
- | BlockheightBasedTransactionConfirmationStrategy
3501
- | DurableNonceTransactionConfirmationStrategy,
3507
+ strategy: TransactionConfirmationStrategy,
3502
3508
  commitment?: Commitment,
3503
3509
  ): Promise<RpcResponseAndContext<SignatureResult>>;
3504
- /** @deprecated Instead, call `confirmTransaction` using a `TransactionConfirmationConfig` */
3510
+ /** @deprecated Instead, call `confirmTransaction` and pass in {@link TransactionConfirmationStrategy} */
3505
3511
  confirmTransaction(
3506
3512
  strategy: TransactionSignature,
3507
3513
  commitment?: Commitment,
@@ -4360,14 +4366,14 @@ declare module '@solana/web3.js' {
4360
4366
  *
4361
4367
  * @param {Connection} connection
4362
4368
  * @param {Buffer} rawTransaction
4363
- * @param {BlockheightBasedTransactionConfirmationStrategy} confirmationStrategy
4369
+ * @param {TransactionConfirmationStrategy} confirmationStrategy
4364
4370
  * @param {ConfirmOptions} [options]
4365
4371
  * @returns {Promise<TransactionSignature>}
4366
4372
  */
4367
4373
  export function sendAndConfirmRawTransaction(
4368
4374
  connection: Connection,
4369
4375
  rawTransaction: Buffer,
4370
- confirmationStrategy: BlockheightBasedTransactionConfirmationStrategy,
4376
+ confirmationStrategy: TransactionConfirmationStrategy,
4371
4377
  options?: ConfirmOptions,
4372
4378
  ): Promise<TransactionSignature>;
4373
4379
  /**
package/lib/index.esm.js CHANGED
@@ -202,7 +202,8 @@ class PublicKey extends Struct {
202
202
 
203
203
 
204
204
  toBytes() {
205
- return this.toBuffer();
205
+ const buf = this.toBuffer();
206
+ return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);
206
207
  }
207
208
  /**
208
209
  * Return the Buffer representation of the public key in big endian
@@ -1843,12 +1844,14 @@ class Transaction {
1843
1844
  this.signatures[index].signature = Buffer.from(signature);
1844
1845
  }
1845
1846
  /**
1846
- * Verify signatures of a complete, signed Transaction
1847
+ * Verify signatures of a Transaction
1848
+ * Optional parameter specifies if we're expecting a fully signed Transaction or a partially signed one.
1849
+ * If no boolean is provided, we expect a fully signed Transaction by default.
1847
1850
  */
1848
1851
 
1849
1852
 
1850
- verifySignatures() {
1851
- return this._verifySignatures(this.serializeMessage(), true);
1853
+ verifySignatures(requireAllSignatures) {
1854
+ return this._verifySignatures(this.serializeMessage(), requireAllSignatures === undefined ? true : requireAllSignatures);
1852
1855
  }
1853
1856
  /**
1854
1857
  * @internal
@@ -12709,7 +12712,7 @@ function clusterApiUrl(cluster, tls) {
12709
12712
  *
12710
12713
  * @param {Connection} connection
12711
12714
  * @param {Buffer} rawTransaction
12712
- * @param {BlockheightBasedTransactionConfirmationStrategy} confirmationStrategy
12715
+ * @param {TransactionConfirmationStrategy} confirmationStrategy
12713
12716
  * @param {ConfirmOptions} [options]
12714
12717
  * @returns {Promise<TransactionSignature>}
12715
12718
  */