@solana/web3.js 1.61.0 → 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.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 -0
- 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/lib/index.cjs.js
CHANGED
|
@@ -841,7 +841,17 @@ class Message {
|
|
|
841
841
|
}
|
|
842
842
|
|
|
843
843
|
isAccountWritable(index) {
|
|
844
|
-
|
|
844
|
+
const numSignedAccounts = this.header.numRequiredSignatures;
|
|
845
|
+
|
|
846
|
+
if (index >= this.header.numRequiredSignatures) {
|
|
847
|
+
const unsignedAccountIndex = index - numSignedAccounts;
|
|
848
|
+
const numUnsignedAccounts = this.accountKeys.length - numSignedAccounts;
|
|
849
|
+
const numWritableUnsignedAccounts = numUnsignedAccounts - this.header.numReadonlyUnsignedAccounts;
|
|
850
|
+
return unsignedAccountIndex < numWritableUnsignedAccounts;
|
|
851
|
+
} else {
|
|
852
|
+
const numWritableSignedAccounts = numSignedAccounts - this.header.numReadonlySignedAccounts;
|
|
853
|
+
return index < numWritableSignedAccounts;
|
|
854
|
+
}
|
|
845
855
|
}
|
|
846
856
|
|
|
847
857
|
isProgramId(index) {
|
|
@@ -1014,6 +1024,29 @@ class MessageV0 {
|
|
|
1014
1024
|
return new MessageAccountKeys(this.staticAccountKeys, accountKeysFromLookups);
|
|
1015
1025
|
}
|
|
1016
1026
|
|
|
1027
|
+
isAccountSigner(index) {
|
|
1028
|
+
return index < this.header.numRequiredSignatures;
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
isAccountWritable(index) {
|
|
1032
|
+
const numSignedAccounts = this.header.numRequiredSignatures;
|
|
1033
|
+
const numStaticAccountKeys = this.staticAccountKeys.length;
|
|
1034
|
+
|
|
1035
|
+
if (index >= numStaticAccountKeys) {
|
|
1036
|
+
const lookupAccountKeysIndex = index - numStaticAccountKeys;
|
|
1037
|
+
const numWritableLookupAccountKeys = this.addressTableLookups.reduce((count, lookup) => count + lookup.writableIndexes.length, 0);
|
|
1038
|
+
return lookupAccountKeysIndex < numWritableLookupAccountKeys;
|
|
1039
|
+
} else if (index >= this.header.numRequiredSignatures) {
|
|
1040
|
+
const unsignedAccountIndex = index - numSignedAccounts;
|
|
1041
|
+
const numUnsignedAccounts = numStaticAccountKeys - numSignedAccounts;
|
|
1042
|
+
const numWritableUnsignedAccounts = numUnsignedAccounts - this.header.numReadonlyUnsignedAccounts;
|
|
1043
|
+
return unsignedAccountIndex < numWritableUnsignedAccounts;
|
|
1044
|
+
} else {
|
|
1045
|
+
const numWritableSignedAccounts = numSignedAccounts - this.header.numReadonlySignedAccounts;
|
|
1046
|
+
return index < numWritableSignedAccounts;
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1017
1050
|
resolveAddressTableLookups(addressLookupTableAccounts) {
|
|
1018
1051
|
const accountKeysFromLookups = {
|
|
1019
1052
|
writable: [],
|
|
@@ -3562,7 +3595,7 @@ class AddressLookupTableAccount {
|
|
|
3562
3595
|
}
|
|
3563
3596
|
|
|
3564
3597
|
isActive() {
|
|
3565
|
-
const U64_MAX =
|
|
3598
|
+
const U64_MAX = 18446744073709551615n;
|
|
3566
3599
|
return this.state.deactivationSlot === U64_MAX;
|
|
3567
3600
|
}
|
|
3568
3601
|
|