@solana/web3.js 1.61.1 → 1.62.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/lib/index.browser.cjs.js +35 -2
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +35 -2
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +35 -2
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.esm.js +35 -2
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +35 -2
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +2 -2
- package/lib/index.iife.min.js.map +1 -1
- package/lib/index.native.js +35 -2
- package/lib/index.native.js.map +1 -1
- package/package.json +1 -1
- package/src/message/legacy.ts +12 -8
- package/src/message/v0.ts +27 -0
- package/src/programs/address-lookup-table/state.ts +1 -1
- package/src/publickey.ts +0 -1
package/lib/index.browser.cjs.js
CHANGED
|
@@ -835,7 +835,17 @@ class Message {
|
|
|
835
835
|
}
|
|
836
836
|
|
|
837
837
|
isAccountWritable(index) {
|
|
838
|
-
|
|
838
|
+
const numSignedAccounts = this.header.numRequiredSignatures;
|
|
839
|
+
|
|
840
|
+
if (index >= this.header.numRequiredSignatures) {
|
|
841
|
+
const unsignedAccountIndex = index - numSignedAccounts;
|
|
842
|
+
const numUnsignedAccounts = this.accountKeys.length - numSignedAccounts;
|
|
843
|
+
const numWritableUnsignedAccounts = numUnsignedAccounts - this.header.numReadonlyUnsignedAccounts;
|
|
844
|
+
return unsignedAccountIndex < numWritableUnsignedAccounts;
|
|
845
|
+
} else {
|
|
846
|
+
const numWritableSignedAccounts = numSignedAccounts - this.header.numReadonlySignedAccounts;
|
|
847
|
+
return index < numWritableSignedAccounts;
|
|
848
|
+
}
|
|
839
849
|
}
|
|
840
850
|
|
|
841
851
|
isProgramId(index) {
|
|
@@ -1008,6 +1018,29 @@ class MessageV0 {
|
|
|
1008
1018
|
return new MessageAccountKeys(this.staticAccountKeys, accountKeysFromLookups);
|
|
1009
1019
|
}
|
|
1010
1020
|
|
|
1021
|
+
isAccountSigner(index) {
|
|
1022
|
+
return index < this.header.numRequiredSignatures;
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
isAccountWritable(index) {
|
|
1026
|
+
const numSignedAccounts = this.header.numRequiredSignatures;
|
|
1027
|
+
const numStaticAccountKeys = this.staticAccountKeys.length;
|
|
1028
|
+
|
|
1029
|
+
if (index >= numStaticAccountKeys) {
|
|
1030
|
+
const lookupAccountKeysIndex = index - numStaticAccountKeys;
|
|
1031
|
+
const numWritableLookupAccountKeys = this.addressTableLookups.reduce((count, lookup) => count + lookup.writableIndexes.length, 0);
|
|
1032
|
+
return lookupAccountKeysIndex < numWritableLookupAccountKeys;
|
|
1033
|
+
} else if (index >= this.header.numRequiredSignatures) {
|
|
1034
|
+
const unsignedAccountIndex = index - numSignedAccounts;
|
|
1035
|
+
const numUnsignedAccounts = numStaticAccountKeys - numSignedAccounts;
|
|
1036
|
+
const numWritableUnsignedAccounts = numUnsignedAccounts - this.header.numReadonlyUnsignedAccounts;
|
|
1037
|
+
return unsignedAccountIndex < numWritableUnsignedAccounts;
|
|
1038
|
+
} else {
|
|
1039
|
+
const numWritableSignedAccounts = numSignedAccounts - this.header.numReadonlySignedAccounts;
|
|
1040
|
+
return index < numWritableSignedAccounts;
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1011
1044
|
resolveAddressTableLookups(addressLookupTableAccounts) {
|
|
1012
1045
|
const accountKeysFromLookups = {
|
|
1013
1046
|
writable: [],
|
|
@@ -3504,7 +3537,7 @@ class AddressLookupTableAccount {
|
|
|
3504
3537
|
}
|
|
3505
3538
|
|
|
3506
3539
|
isActive() {
|
|
3507
|
-
const U64_MAX =
|
|
3540
|
+
const U64_MAX = BigInt('0xffffffffffffffff');
|
|
3508
3541
|
return this.state.deactivationSlot === U64_MAX;
|
|
3509
3542
|
}
|
|
3510
3543
|
|