@solana/web3.js 1.98.0 → 1.98.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.
@@ -6,7 +6,7 @@ import { sha256 } from '@noble/hashes/sha256';
6
6
  import { serialize, deserialize, deserializeUnchecked } from 'borsh';
7
7
  import * as BufferLayout from '@solana/buffer-layout';
8
8
  import { blob } from '@solana/buffer-layout';
9
- import { toBigIntLE, toBufferLE } from 'bigint-buffer';
9
+ import { getU64Codec, getU64Encoder } from '@solana/codecs-numbers';
10
10
  import { coerce, instance, string, tuple, literal, unknown, type, number, array, nullable, optional, boolean, record, union, create, any, assert as assert$1 } from 'superstruct';
11
11
  import RpcClient from 'jayson/lib/client/browser';
12
12
  import { CommonClient, WebSocket } from 'rpc-websockets';
@@ -2373,32 +2373,22 @@ class NonceAccount {
2373
2373
  }
2374
2374
  }
2375
2375
 
2376
- const encodeDecode = layout => {
2376
+ function u64(property) {
2377
+ const layout = blob(8 /* bytes */, property);
2377
2378
  const decode = layout.decode.bind(layout);
2378
2379
  const encode = layout.encode.bind(layout);
2379
- return {
2380
- decode,
2381
- encode
2382
- };
2383
- };
2384
- const bigInt = length => property => {
2385
- const layout = blob(length, property);
2386
- const {
2387
- encode,
2388
- decode
2389
- } = encodeDecode(layout);
2390
2380
  const bigIntLayout = layout;
2381
+ const codec = getU64Codec();
2391
2382
  bigIntLayout.decode = (buffer, offset) => {
2392
2383
  const src = decode(buffer, offset);
2393
- return toBigIntLE(Buffer.from(src));
2384
+ return codec.decode(src);
2394
2385
  };
2395
2386
  bigIntLayout.encode = (bigInt, buffer, offset) => {
2396
- const src = toBufferLE(bigInt, length);
2387
+ const src = codec.encode(bigInt);
2397
2388
  return encode(src, buffer, offset);
2398
2389
  };
2399
2390
  return bigIntLayout;
2400
- };
2401
- const u64 = bigInt(8);
2391
+ }
2402
2392
 
2403
2393
  /**
2404
2394
  * Create account system transaction params
@@ -8397,7 +8387,7 @@ class AddressLookupTableProgram {
8397
8387
  */
8398
8388
  constructor() {}
8399
8389
  static createLookupTable(params) {
8400
- const [lookupTableAddress, bumpSeed] = PublicKey.findProgramAddressSync([params.authority.toBuffer(), toBufferLE(BigInt(params.recentSlot), 8)], this.programId);
8390
+ const [lookupTableAddress, bumpSeed] = PublicKey.findProgramAddressSync([params.authority.toBuffer(), getU64Encoder().encode(params.recentSlot)], this.programId);
8401
8391
  const type = LOOKUP_TABLE_INSTRUCTION_LAYOUTS.CreateLookupTable;
8402
8392
  const data = encodeData(type, {
8403
8393
  recentSlot: BigInt(params.recentSlot),