@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.
package/lib/index.esm.js CHANGED
@@ -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 crossFetch from 'cross-fetch';
9
10
  import { coerce, instance, string, tuple, literal, unknown, union, type, optional, any, number, array, nullable, create, boolean, record, assert as assert$7 } from 'superstruct';
10
11
  import { Client } from 'rpc-websockets';
@@ -3184,6 +3185,38 @@ class NonceAccount {
3184
3185
 
3185
3186
  }
3186
3187
 
3188
+ const encodeDecode = layout => {
3189
+ const decode = layout.decode.bind(layout);
3190
+ const encode = layout.encode.bind(layout);
3191
+ return {
3192
+ decode,
3193
+ encode
3194
+ };
3195
+ };
3196
+
3197
+ const bigInt = length => property => {
3198
+ const layout = blob(length, property);
3199
+ const {
3200
+ encode,
3201
+ decode
3202
+ } = encodeDecode(layout);
3203
+ const bigIntLayout = layout;
3204
+
3205
+ bigIntLayout.decode = (buffer, offset) => {
3206
+ const src = decode(buffer, offset);
3207
+ return toBigIntLE(Buffer.from(src));
3208
+ };
3209
+
3210
+ bigIntLayout.encode = (bigInt, buffer, offset) => {
3211
+ const src = toBufferLE(bigInt, length);
3212
+ return encode(src, buffer, offset);
3213
+ };
3214
+
3215
+ return bigIntLayout;
3216
+ };
3217
+
3218
+ const u64 = bigInt(8);
3219
+
3187
3220
  /**
3188
3221
  * Create account system transaction params
3189
3222
  */