@solana/web3.js 1.62.0 → 1.63.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solana/web3.js",
3
- "version": "1.62.0",
3
+ "version": "1.63.0",
4
4
  "description": "Solana Javascript API",
5
5
  "keywords": [
6
6
  "api",
@@ -32,7 +32,7 @@ export class AddressLookupTableAccount {
32
32
  }
33
33
 
34
34
  isActive(): boolean {
35
- const U64_MAX = 18446744073709551615n;
35
+ const U64_MAX = BigInt('0xffffffffffffffff');
36
36
  return this.state.deactivationSlot === U64_MAX;
37
37
  }
38
38
 
package/src/publickey.ts CHANGED
@@ -23,7 +23,6 @@ export const PUBLIC_KEY_LENGTH = 32;
23
23
  export type PublicKeyInitData =
24
24
  | number
25
25
  | string
26
- | Buffer
27
26
  | Uint8Array
28
27
  | Array<number>
29
28
  | PublicKeyData;
@@ -7,6 +7,7 @@ import {SIGNATURE_LENGTH_IN_BYTES} from './constants';
7
7
  import * as shortvec from '../utils/shortvec-encoding';
8
8
  import * as Layout from '../layout';
9
9
  import {sign} from '../utils/ed25519';
10
+ import {PublicKey} from '../publickey';
10
11
 
11
12
  export type TransactionVersion = 'legacy' | 0;
12
13
 
@@ -106,4 +107,20 @@ export class VersionedTransaction {
106
107
  this.signatures[signerIndex] = sign(messageData, signer.secretKey);
107
108
  }
108
109
  }
110
+
111
+ addSignature(publicKey: PublicKey, signature: Uint8Array) {
112
+ assert(signature.byteLength === 64, 'Signature must be 64 bytes long');
113
+ const signerPubkeys = this.message.staticAccountKeys.slice(
114
+ 0,
115
+ this.message.header.numRequiredSignatures,
116
+ );
117
+ const signerIndex = signerPubkeys.findIndex(pubkey =>
118
+ pubkey.equals(publicKey),
119
+ );
120
+ assert(
121
+ signerIndex >= 0,
122
+ `Can not add signature; \`${publicKey.toBase58()}\` is not required to sign this transaction`,
123
+ );
124
+ this.signatures[signerIndex] = signature;
125
+ }
109
126
  }