@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.browser.cjs.js +34 -1
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +34 -1
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +34 -1
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.esm.js +34 -1
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +34 -1
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +1 -1
- package/lib/index.iife.min.js.map +1 -1
- package/lib/index.native.js +34 -1
- 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/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: [],
|