@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.esm.js
CHANGED
|
@@ -805,7 +805,17 @@ class Message {
|
|
|
805
805
|
}
|
|
806
806
|
|
|
807
807
|
isAccountWritable(index) {
|
|
808
|
-
|
|
808
|
+
const numSignedAccounts = this.header.numRequiredSignatures;
|
|
809
|
+
|
|
810
|
+
if (index >= this.header.numRequiredSignatures) {
|
|
811
|
+
const unsignedAccountIndex = index - numSignedAccounts;
|
|
812
|
+
const numUnsignedAccounts = this.accountKeys.length - numSignedAccounts;
|
|
813
|
+
const numWritableUnsignedAccounts = numUnsignedAccounts - this.header.numReadonlyUnsignedAccounts;
|
|
814
|
+
return unsignedAccountIndex < numWritableUnsignedAccounts;
|
|
815
|
+
} else {
|
|
816
|
+
const numWritableSignedAccounts = numSignedAccounts - this.header.numReadonlySignedAccounts;
|
|
817
|
+
return index < numWritableSignedAccounts;
|
|
818
|
+
}
|
|
809
819
|
}
|
|
810
820
|
|
|
811
821
|
isProgramId(index) {
|
|
@@ -978,6 +988,29 @@ class MessageV0 {
|
|
|
978
988
|
return new MessageAccountKeys(this.staticAccountKeys, accountKeysFromLookups);
|
|
979
989
|
}
|
|
980
990
|
|
|
991
|
+
isAccountSigner(index) {
|
|
992
|
+
return index < this.header.numRequiredSignatures;
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
isAccountWritable(index) {
|
|
996
|
+
const numSignedAccounts = this.header.numRequiredSignatures;
|
|
997
|
+
const numStaticAccountKeys = this.staticAccountKeys.length;
|
|
998
|
+
|
|
999
|
+
if (index >= numStaticAccountKeys) {
|
|
1000
|
+
const lookupAccountKeysIndex = index - numStaticAccountKeys;
|
|
1001
|
+
const numWritableLookupAccountKeys = this.addressTableLookups.reduce((count, lookup) => count + lookup.writableIndexes.length, 0);
|
|
1002
|
+
return lookupAccountKeysIndex < numWritableLookupAccountKeys;
|
|
1003
|
+
} else if (index >= this.header.numRequiredSignatures) {
|
|
1004
|
+
const unsignedAccountIndex = index - numSignedAccounts;
|
|
1005
|
+
const numUnsignedAccounts = numStaticAccountKeys - numSignedAccounts;
|
|
1006
|
+
const numWritableUnsignedAccounts = numUnsignedAccounts - this.header.numReadonlyUnsignedAccounts;
|
|
1007
|
+
return unsignedAccountIndex < numWritableUnsignedAccounts;
|
|
1008
|
+
} else {
|
|
1009
|
+
const numWritableSignedAccounts = numSignedAccounts - this.header.numReadonlySignedAccounts;
|
|
1010
|
+
return index < numWritableSignedAccounts;
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
|
|
981
1014
|
resolveAddressTableLookups(addressLookupTableAccounts) {
|
|
982
1015
|
const accountKeysFromLookups = {
|
|
983
1016
|
writable: [],
|
|
@@ -3474,7 +3507,7 @@ class AddressLookupTableAccount {
|
|
|
3474
3507
|
}
|
|
3475
3508
|
|
|
3476
3509
|
isActive() {
|
|
3477
|
-
const U64_MAX =
|
|
3510
|
+
const U64_MAX = BigInt('0xffffffffffffffff');
|
|
3478
3511
|
return this.state.deactivationSlot === U64_MAX;
|
|
3479
3512
|
}
|
|
3480
3513
|
|