@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana/web3.js",
|
|
3
|
-
"version": "1.98.
|
|
3
|
+
"version": "1.98.2",
|
|
4
4
|
"description": "Solana Javascript API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api",
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
"homepage": "https://solana.com/",
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
14
|
-
"url": "https://github.com/solana-
|
|
14
|
+
"url": "https://github.com/solana-foundation/solana-web3.js.git"
|
|
15
15
|
},
|
|
16
16
|
"bugs": {
|
|
17
|
-
"url": "http://github.com/solana-
|
|
17
|
+
"url": "http://github.com/solana-foundation/solana-web3.js.git/issues"
|
|
18
18
|
},
|
|
19
19
|
"publishConfig": {
|
|
20
20
|
"access": "public"
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"clean": "rimraf ./doc ./declarations ./lib",
|
|
45
45
|
"dev": "cross-env NODE_ENV=development rollup -c --watch",
|
|
46
46
|
"prepublishOnly": "pnpm pkg delete devDependencies",
|
|
47
|
-
"publish-packages": "semantic-release --repository-url git@github.com:solana-
|
|
47
|
+
"publish-packages": "semantic-release --repository-url git@github.com:solana-foundation/solana-web3.js.git",
|
|
48
48
|
"test:lint": "eslint src/ test/ --ext .js,.ts",
|
|
49
49
|
"test:lint:fix": "eslint src/ test/ --fix --ext .js,.ts",
|
|
50
50
|
"test:live": "TEST_LIVE=1 pnpm run test:unit",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"@noble/curves": "^1.4.2",
|
|
61
61
|
"@noble/hashes": "^1.4.0",
|
|
62
62
|
"@solana/buffer-layout": "^4.0.1",
|
|
63
|
+
"@solana/codecs-numbers": "^2.1.0",
|
|
63
64
|
"agentkeepalive": "^4.5.0",
|
|
64
|
-
"bigint-buffer": "^1.1.5",
|
|
65
65
|
"bn.js": "^5.2.1",
|
|
66
66
|
"borsh": "^0.7.0",
|
|
67
67
|
"bs58": "^4.0.1",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {toBufferLE} from 'bigint-buffer';
|
|
2
1
|
import * as BufferLayout from '@solana/buffer-layout';
|
|
2
|
+
import {getU64Encoder} from '@solana/codecs-numbers';
|
|
3
3
|
|
|
4
4
|
import * as Layout from '../../layout';
|
|
5
5
|
import {PublicKey} from '../../publickey';
|
|
@@ -272,7 +272,10 @@ export class AddressLookupTableProgram {
|
|
|
272
272
|
|
|
273
273
|
static createLookupTable(params: CreateLookupTableParams) {
|
|
274
274
|
const [lookupTableAddress, bumpSeed] = PublicKey.findProgramAddressSync(
|
|
275
|
-
[
|
|
275
|
+
[
|
|
276
|
+
params.authority.toBuffer(),
|
|
277
|
+
getU64Encoder().encode(params.recentSlot) as Uint8Array,
|
|
278
|
+
],
|
|
276
279
|
this.programId,
|
|
277
280
|
);
|
|
278
281
|
|
package/src/utils/bigint.ts
CHANGED
|
@@ -1,43 +1,24 @@
|
|
|
1
1
|
import {Buffer} from 'buffer';
|
|
2
2
|
import {blob, Layout} from '@solana/buffer-layout';
|
|
3
|
-
import {
|
|
3
|
+
import {getU64Codec} from '@solana/codecs-numbers';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
encode(src: T, buffer: Buffer, offset?: number): number;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const encodeDecode = <T>(layout: Layout<T>): EncodeDecode<T> => {
|
|
5
|
+
export function u64(property?: string): Layout<bigint> {
|
|
6
|
+
const layout = blob(8 /* bytes */, property);
|
|
11
7
|
const decode = layout.decode.bind(layout);
|
|
12
8
|
const encode = layout.encode.bind(layout);
|
|
13
|
-
return {decode, encode};
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const bigInt =
|
|
17
|
-
(length: number) =>
|
|
18
|
-
(property?: string): Layout<bigint> => {
|
|
19
|
-
const layout = blob(length, property);
|
|
20
|
-
const {encode, decode} = encodeDecode(layout);
|
|
21
|
-
|
|
22
|
-
const bigIntLayout = layout as Layout<unknown> as Layout<bigint>;
|
|
23
|
-
|
|
24
|
-
bigIntLayout.decode = (buffer: Buffer, offset: number) => {
|
|
25
|
-
const src = decode(buffer, offset);
|
|
26
|
-
return toBigIntLE(Buffer.from(src));
|
|
27
|
-
};
|
|
28
9
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return encode(src, buffer, offset);
|
|
32
|
-
};
|
|
10
|
+
const bigIntLayout = layout as Layout<unknown> as Layout<bigint>;
|
|
11
|
+
const codec = getU64Codec();
|
|
33
12
|
|
|
34
|
-
|
|
13
|
+
bigIntLayout.decode = (buffer: Buffer, offset: number) => {
|
|
14
|
+
const src = decode(buffer as Uint8Array, offset);
|
|
15
|
+
return codec.decode(src);
|
|
35
16
|
};
|
|
36
17
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
export const u192 = bigInt(24);
|
|
18
|
+
bigIntLayout.encode = (bigInt: bigint, buffer: Buffer, offset: number) => {
|
|
19
|
+
const src = codec.encode(bigInt) as Uint8Array;
|
|
20
|
+
return encode(src, buffer as Uint8Array, offset);
|
|
21
|
+
};
|
|
42
22
|
|
|
43
|
-
|
|
23
|
+
return bigIntLayout;
|
|
24
|
+
}
|