@solana/web3.js 1.98.0 → 1.98.2
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/README.md +4 -4
- package/lib/index.browser.cjs.js +10 -20
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +8 -18
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +10 -20
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.esm.js +8 -18
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +213 -88
- 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 +10 -20
- package/lib/index.native.js.map +1 -1
- package/package.json +5 -5
- package/src/programs/address-lookup-table/index.ts +5 -2
- package/src/utils/bigint.ts +14 -33
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
[semantic-release-url]: https://github.com/semantic-release/semantic-release
|
|
14
14
|
|
|
15
15
|
> [!NOTE]
|
|
16
|
-
> This is the maintenance branch for the 1.x line of `@solana/web3.js`. You can find the successor to this library [
|
|
16
|
+
> This is the maintenance branch for the 1.x line of `@solana/web3.js`. You can find the successor to this library here: [`@solana/kit`](https://l.anza.xyz/s/js-sdk-repo).
|
|
17
17
|
|
|
18
18
|
# Solana JavaScript SDK (v1.x)
|
|
19
19
|
|
|
@@ -24,7 +24,7 @@ Use this to interact with accounts and programs on the Solana network through th
|
|
|
24
24
|
### For use in Node.js or a web application
|
|
25
25
|
|
|
26
26
|
```
|
|
27
|
-
$ npm install --save @solana/web3.js
|
|
27
|
+
$ npm install --save @solana/web3.js
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
### For use in a browser, without a build system
|
|
@@ -40,7 +40,7 @@ $ npm install --save @solana/web3.js@1
|
|
|
40
40
|
## Documentation and examples
|
|
41
41
|
|
|
42
42
|
- [The Solana Cookbook](https://solanacookbook.com/) has extensive task-based documentation using this library.
|
|
43
|
-
- For more detail on individual functions, see the [latest API Documentation](https://solana-
|
|
43
|
+
- For more detail on individual functions, see the [latest API Documentation](https://solana-foundation.github.io/solana-web3.js)
|
|
44
44
|
|
|
45
45
|
## Getting help
|
|
46
46
|
|
|
@@ -101,7 +101,7 @@ $ npm run test:live-with-test-validator
|
|
|
101
101
|
|
|
102
102
|
## Contributing
|
|
103
103
|
|
|
104
|
-
If you found a bug or would like to request a feature, please [file an issue](https://github.com/solana-
|
|
104
|
+
If you found a bug or would like to request a feature, please [file an issue](https://github.com/solana-foundation/solana-web3.js/issues/new). If, based on the discussion on an issue you would like to offer a code change, please make a [pull request](https://github.com/solana-foundation/solana-web3.js/compare). If neither of these describes what you would like to contribute, read the [getting help](#getting-help) section above.
|
|
105
105
|
|
|
106
106
|
## Disclaimer
|
|
107
107
|
|
package/lib/index.browser.cjs.js
CHANGED
|
@@ -7,7 +7,7 @@ var bs58 = require('bs58');
|
|
|
7
7
|
var sha256 = require('@noble/hashes/sha256');
|
|
8
8
|
var borsh = require('borsh');
|
|
9
9
|
var BufferLayout = require('@solana/buffer-layout');
|
|
10
|
-
var
|
|
10
|
+
var codecsNumbers = require('@solana/codecs-numbers');
|
|
11
11
|
var superstruct = require('superstruct');
|
|
12
12
|
var RpcClient = require('jayson/lib/client/browser');
|
|
13
13
|
var rpcWebsockets = require('rpc-websockets');
|
|
@@ -2399,32 +2399,22 @@ class NonceAccount {
|
|
|
2399
2399
|
}
|
|
2400
2400
|
}
|
|
2401
2401
|
|
|
2402
|
-
|
|
2402
|
+
function u64(property) {
|
|
2403
|
+
const layout = BufferLayout.blob(8 /* bytes */, property);
|
|
2403
2404
|
const decode = layout.decode.bind(layout);
|
|
2404
2405
|
const encode = layout.encode.bind(layout);
|
|
2405
|
-
return {
|
|
2406
|
-
decode,
|
|
2407
|
-
encode
|
|
2408
|
-
};
|
|
2409
|
-
};
|
|
2410
|
-
const bigInt = length => property => {
|
|
2411
|
-
const layout = BufferLayout.blob(length, property);
|
|
2412
|
-
const {
|
|
2413
|
-
encode,
|
|
2414
|
-
decode
|
|
2415
|
-
} = encodeDecode(layout);
|
|
2416
2406
|
const bigIntLayout = layout;
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2407
|
+
const codec = codecsNumbers.getU64Codec();
|
|
2408
|
+
bigIntLayout.decode = (buffer, offset) => {
|
|
2409
|
+
const src = decode(buffer, offset);
|
|
2410
|
+
return codec.decode(src);
|
|
2420
2411
|
};
|
|
2421
2412
|
bigIntLayout.encode = (bigInt, buffer, offset) => {
|
|
2422
|
-
const src =
|
|
2413
|
+
const src = codec.encode(bigInt);
|
|
2423
2414
|
return encode(src, buffer, offset);
|
|
2424
2415
|
};
|
|
2425
2416
|
return bigIntLayout;
|
|
2426
|
-
}
|
|
2427
|
-
const u64 = bigInt(8);
|
|
2417
|
+
}
|
|
2428
2418
|
|
|
2429
2419
|
/**
|
|
2430
2420
|
* Create account system transaction params
|
|
@@ -8423,7 +8413,7 @@ class AddressLookupTableProgram {
|
|
|
8423
8413
|
*/
|
|
8424
8414
|
constructor() {}
|
|
8425
8415
|
static createLookupTable(params) {
|
|
8426
|
-
const [lookupTableAddress, bumpSeed] = PublicKey.findProgramAddressSync([params.authority.toBuffer(),
|
|
8416
|
+
const [lookupTableAddress, bumpSeed] = PublicKey.findProgramAddressSync([params.authority.toBuffer(), codecsNumbers.getU64Encoder().encode(params.recentSlot)], this.programId);
|
|
8427
8417
|
const type = LOOKUP_TABLE_INSTRUCTION_LAYOUTS.CreateLookupTable;
|
|
8428
8418
|
const data = encodeData(type, {
|
|
8429
8419
|
recentSlot: BigInt(params.recentSlot),
|