@solana/web3.js 1.43.0 → 1.43.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.
@@ -4,7 +4,8 @@ import BN from 'bn.js';
4
4
  import bs58 from 'bs58';
5
5
  import { serialize, deserialize, deserializeUnchecked } from 'borsh';
6
6
  import * as BufferLayout from '@solana/buffer-layout';
7
- import { u64 } from '@solana/buffer-layout-utils';
7
+ import { blob } from '@solana/buffer-layout';
8
+ import { toBigIntLE, toBufferLE } from 'bigint-buffer';
8
9
  import { coerce, instance, string, tuple, literal, unknown, union, type, optional, any, number, array, nullable, create, boolean, record, assert as assert$7 } from 'superstruct';
9
10
  import { Client } from 'rpc-websockets';
10
11
  import RpcClient from 'jayson/lib/client/browser';
@@ -3175,6 +3176,38 @@ class NonceAccount {
3175
3176
 
3176
3177
  }
3177
3178
 
3179
+ const encodeDecode = layout => {
3180
+ const decode = layout.decode.bind(layout);
3181
+ const encode = layout.encode.bind(layout);
3182
+ return {
3183
+ decode,
3184
+ encode
3185
+ };
3186
+ };
3187
+
3188
+ const bigInt = length => property => {
3189
+ const layout = blob(length, property);
3190
+ const {
3191
+ encode,
3192
+ decode
3193
+ } = encodeDecode(layout);
3194
+ const bigIntLayout = layout;
3195
+
3196
+ bigIntLayout.decode = (buffer, offset) => {
3197
+ const src = decode(buffer, offset);
3198
+ return toBigIntLE(Buffer.from(src));
3199
+ };
3200
+
3201
+ bigIntLayout.encode = (bigInt, buffer, offset) => {
3202
+ const src = toBufferLE(bigInt, length);
3203
+ return encode(src, buffer, offset);
3204
+ };
3205
+
3206
+ return bigIntLayout;
3207
+ };
3208
+
3209
+ const u64 = bigInt(8);
3210
+
3178
3211
  /**
3179
3212
  * Create account system transaction params
3180
3213
  */