@solana/web3.js 1.22.1 → 1.23.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/README.md CHANGED
@@ -114,3 +114,44 @@ and [npmjs.com](https://www.npmjs.com/package/@solana/web3.js)
114
114
  Each Github release features a tarball containing API documentation and a
115
115
  minified version of the module suitable for direct use in a browser environment
116
116
  (`<script>` tag)
117
+
118
+ ## Disclaimer
119
+
120
+ All claims, content, designs, algorithms, estimates, roadmaps,
121
+ specifications, and performance measurements described in this project
122
+ are done with the Solana Foundation's ("SF") best efforts. It is up to
123
+ the reader to check and validate their accuracy and truthfulness.
124
+ Furthermore nothing in this project constitutes a solicitation for
125
+ investment.
126
+
127
+ Any content produced by SF or developer resources that SF provides, are
128
+ for educational and inspiration purposes only. SF does not encourage,
129
+ induce or sanction the deployment, integration or use of any such
130
+ applications (including the code comprising the Solana blockchain
131
+ protocol) in violation of applicable laws or regulations and hereby
132
+ prohibits any such deployment, integration or use. This includes use of
133
+ any such applications by the reader (a) in violation of export control
134
+ or sanctions laws of the United States or any other applicable
135
+ jurisdiction, (b) if the reader is located in or ordinarily resident in
136
+ a country or territory subject to comprehensive sanctions administered
137
+ by the U.S. Office of Foreign Assets Control (OFAC), or (c) if the
138
+ reader is or is working on behalf of a Specially Designated National
139
+ (SDN) or a person subject to similar blocking or denied party
140
+ prohibitions.
141
+
142
+ The reader should be aware that U.S. export control and sanctions laws
143
+ prohibit U.S. persons (and other persons that are subject to such laws)
144
+ from transacting with persons in certain countries and territories or
145
+ that are on the SDN list. As a project based primarily on open-source
146
+ software, it is possible that such sanctioned persons may nevertheless
147
+ bypass prohibitions, obtain the code comprising the Solana blockchain
148
+ protocol (or other project code or applications) and deploy, integrate,
149
+ or otherwise use it. Accordingly, there is a risk to individuals that
150
+ other persons using the Solana blockchain protocol may be sanctioned
151
+ persons and that transactions with such persons would be a violation of
152
+ U.S. export controls and sanctions law. This risk applies to
153
+ individuals, organizations, and other ecosystem participants that
154
+ deploy, integrate, or use the Solana blockchain protocol code directly
155
+ (e.g., as a node operator), and individuals that transact on the Solana
156
+ blockchain through light clients, third party interfaces, and/or wallet
157
+ software.
@@ -2115,8 +2115,7 @@ class Loader {
2115
2115
  * Can be used to calculate transaction fees
2116
2116
  */
2117
2117
  static getMinNumSignatures(dataLength) {
2118
- return 2 * ( // Every transaction requires two signatures (payer + program)
2119
- Math.ceil(dataLength / Loader.chunkSize) + 1 + // Add one for Create transaction
2118
+ return 2 * (Math.ceil(dataLength / Loader.chunkSize) + 1 + // Add one for Create transaction
2120
2119
  1) // Add one for Finalize transaction
2121
2120
  ;
2122
2121
  }
@@ -2686,8 +2685,8 @@ function createRpcClient(url, useHttps, httpHeaders, fetchMiddleware, disableRet
2686
2685
  if (res.status !== 429
2687
2686
  /* Too many requests */
2688
2687
  ) {
2689
- break;
2690
- }
2688
+ break;
2689
+ }
2691
2690
 
2692
2691
  if (disableRetryOnRateLimit === true) {
2693
2692
  break;
@@ -6352,13 +6351,15 @@ class Secp256k1Program {
6352
6351
  publicKey,
6353
6352
  message,
6354
6353
  signature,
6355
- recoveryId
6354
+ recoveryId,
6355
+ instructionIndex
6356
6356
  } = params;
6357
6357
  return Secp256k1Program.createInstructionWithEthAddress({
6358
6358
  ethAddress: Secp256k1Program.publicKeyToEthAddress(publicKey),
6359
6359
  message,
6360
6360
  signature,
6361
- recoveryId
6361
+ recoveryId,
6362
+ instructionIndex
6362
6363
  });
6363
6364
  }
6364
6365
  /**
@@ -6372,7 +6373,8 @@ class Secp256k1Program {
6372
6373
  ethAddress: rawAddress,
6373
6374
  message,
6374
6375
  signature,
6375
- recoveryId
6376
+ recoveryId,
6377
+ instructionIndex = 0
6376
6378
  } = params;
6377
6379
  let ethAddress;
6378
6380
 
@@ -6396,12 +6398,12 @@ class Secp256k1Program {
6396
6398
  SECP256K1_INSTRUCTION_LAYOUT.encode({
6397
6399
  numSignatures,
6398
6400
  signatureOffset,
6399
- signatureInstructionIndex: 0,
6401
+ signatureInstructionIndex: instructionIndex,
6400
6402
  ethAddressOffset,
6401
- ethAddressInstructionIndex: 0,
6403
+ ethAddressInstructionIndex: instructionIndex,
6402
6404
  messageDataOffset,
6403
6405
  messageDataSize: message.length,
6404
- messageInstructionIndex: 0,
6406
+ messageInstructionIndex: instructionIndex,
6405
6407
  signature: toBuffer(signature),
6406
6408
  ethAddress: toBuffer(ethAddress),
6407
6409
  recoveryId
@@ -6422,7 +6424,8 @@ class Secp256k1Program {
6422
6424
  static createInstructionWithPrivateKey(params) {
6423
6425
  const {
6424
6426
  privateKey: pkey,
6425
- message
6427
+ message,
6428
+ instructionIndex
6426
6429
  } = params;
6427
6430
  assert(pkey.length === PRIVATE_KEY_BYTES, `Private key must be ${PRIVATE_KEY_BYTES} bytes but received ${pkey.length} bytes`);
6428
6431
 
@@ -6439,7 +6442,8 @@ class Secp256k1Program {
6439
6442
  publicKey,
6440
6443
  message,
6441
6444
  signature,
6442
- recoveryId
6445
+ recoveryId,
6446
+ instructionIndex
6443
6447
  });
6444
6448
  } catch (error) {
6445
6449
  throw new Error(`Error creating instruction; ${error}`);