@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solana/web3.js",
3
- "version": "1.98.0",
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-labs/solana-web3.js.git"
14
+ "url": "https://github.com/solana-foundation/solana-web3.js.git"
15
15
  },
16
16
  "bugs": {
17
- "url": "http://github.com/solana-labs/solana-web3.js.git/issues"
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-labs/solana-web3.js.git",
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
- [params.authority.toBuffer(), toBufferLE(BigInt(params.recentSlot), 8)],
275
+ [
276
+ params.authority.toBuffer(),
277
+ getU64Encoder().encode(params.recentSlot) as Uint8Array,
278
+ ],
276
279
  this.programId,
277
280
  );
278
281
 
@@ -1,43 +1,24 @@
1
1
  import {Buffer} from 'buffer';
2
2
  import {blob, Layout} from '@solana/buffer-layout';
3
- import {toBigIntLE, toBufferLE} from 'bigint-buffer';
3
+ import {getU64Codec} from '@solana/codecs-numbers';
4
4
 
5
- interface EncodeDecode<T> {
6
- decode(buffer: Buffer, offset?: number): T;
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
- bigIntLayout.encode = (bigInt: bigint, buffer: Buffer, offset: number) => {
30
- const src = toBufferLE(bigInt, length);
31
- return encode(src, buffer, offset);
32
- };
10
+ const bigIntLayout = layout as Layout<unknown> as Layout<bigint>;
11
+ const codec = getU64Codec();
33
12
 
34
- return bigIntLayout;
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
- export const u64 = bigInt(8);
38
-
39
- export const u128 = bigInt(16);
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
- export const u256 = bigInt(32);
23
+ return bigIntLayout;
24
+ }