@solana/web3.js 1.61.1 → 1.62.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.iife.js CHANGED
@@ -11293,7 +11293,17 @@ var solanaWeb3 = (function (exports) {
11293
11293
  }
11294
11294
 
11295
11295
  isAccountWritable(index) {
11296
- return index < this.header.numRequiredSignatures - this.header.numReadonlySignedAccounts || index >= this.header.numRequiredSignatures && index < this.accountKeys.length - this.header.numReadonlyUnsignedAccounts;
11296
+ const numSignedAccounts = this.header.numRequiredSignatures;
11297
+
11298
+ if (index >= this.header.numRequiredSignatures) {
11299
+ const unsignedAccountIndex = index - numSignedAccounts;
11300
+ const numUnsignedAccounts = this.accountKeys.length - numSignedAccounts;
11301
+ const numWritableUnsignedAccounts = numUnsignedAccounts - this.header.numReadonlyUnsignedAccounts;
11302
+ return unsignedAccountIndex < numWritableUnsignedAccounts;
11303
+ } else {
11304
+ const numWritableSignedAccounts = numSignedAccounts - this.header.numReadonlySignedAccounts;
11305
+ return index < numWritableSignedAccounts;
11306
+ }
11297
11307
  }
11298
11308
 
11299
11309
  isProgramId(index) {
@@ -11466,6 +11476,29 @@ var solanaWeb3 = (function (exports) {
11466
11476
  return new MessageAccountKeys(this.staticAccountKeys, accountKeysFromLookups);
11467
11477
  }
11468
11478
 
11479
+ isAccountSigner(index) {
11480
+ return index < this.header.numRequiredSignatures;
11481
+ }
11482
+
11483
+ isAccountWritable(index) {
11484
+ const numSignedAccounts = this.header.numRequiredSignatures;
11485
+ const numStaticAccountKeys = this.staticAccountKeys.length;
11486
+
11487
+ if (index >= numStaticAccountKeys) {
11488
+ const lookupAccountKeysIndex = index - numStaticAccountKeys;
11489
+ const numWritableLookupAccountKeys = this.addressTableLookups.reduce((count, lookup) => count + lookup.writableIndexes.length, 0);
11490
+ return lookupAccountKeysIndex < numWritableLookupAccountKeys;
11491
+ } else if (index >= this.header.numRequiredSignatures) {
11492
+ const unsignedAccountIndex = index - numSignedAccounts;
11493
+ const numUnsignedAccounts = numStaticAccountKeys - numSignedAccounts;
11494
+ const numWritableUnsignedAccounts = numUnsignedAccounts - this.header.numReadonlyUnsignedAccounts;
11495
+ return unsignedAccountIndex < numWritableUnsignedAccounts;
11496
+ } else {
11497
+ const numWritableSignedAccounts = numSignedAccounts - this.header.numReadonlySignedAccounts;
11498
+ return index < numWritableSignedAccounts;
11499
+ }
11500
+ }
11501
+
11469
11502
  resolveAddressTableLookups(addressLookupTableAccounts) {
11470
11503
  const accountKeysFromLookups = {
11471
11504
  writable: [],