@solana/web3.js 1.62.1 → 1.63.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.
@@ -1003,13 +1003,13 @@ class MessageV0 {
1003
1003
  getAccountKeys(args) {
1004
1004
  let accountKeysFromLookups;
1005
1005
 
1006
- if (args && 'accountKeysFromLookups' in args) {
1006
+ if (args && 'accountKeysFromLookups' in args && args.accountKeysFromLookups) {
1007
1007
  if (this.numAccountKeysFromLookups != args.accountKeysFromLookups.writable.length + args.accountKeysFromLookups.readonly.length) {
1008
1008
  throw new Error('Failed to get account keys because of a mismatch in the number of account keys from lookups');
1009
1009
  }
1010
1010
 
1011
1011
  accountKeysFromLookups = args.accountKeysFromLookups;
1012
- } else if (args && 'addressLookupTableAccounts' in args) {
1012
+ } else if (args && 'addressLookupTableAccounts' in args && args.addressLookupTableAccounts) {
1013
1013
  accountKeysFromLookups = this.resolveAddressTableLookups(args.addressLookupTableAccounts);
1014
1014
  } else if (this.addressTableLookups.length > 0) {
1015
1015
  throw new Error('Failed to get account keys because address table lookups were not resolved');
@@ -2171,6 +2171,14 @@ class VersionedTransaction {
2171
2171
  }
2172
2172
  }
2173
2173
 
2174
+ addSignature(publicKey, signature) {
2175
+ assert(signature.byteLength === 64, 'Signature must be 64 bytes long');
2176
+ const signerPubkeys = this.message.staticAccountKeys.slice(0, this.message.header.numRequiredSignatures);
2177
+ const signerIndex = signerPubkeys.findIndex(pubkey => pubkey.equals(publicKey));
2178
+ assert(signerIndex >= 0, `Can not add signature; \`${publicKey.toBase58()}\` is not required to sign this transaction`);
2179
+ this.signatures[signerIndex] = signature;
2180
+ }
2181
+
2174
2182
  }
2175
2183
 
2176
2184
  const SYSVAR_CLOCK_PUBKEY = new PublicKey('SysvarC1ock11111111111111111111111111111111');