@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.
@@ -8,7 +8,7 @@ var BN = require('bn.js');
8
8
  var bs58 = require('bs58');
9
9
  var borsh = require('borsh');
10
10
  var BufferLayout = require('@solana/buffer-layout');
11
- var bufferLayoutUtils = require('@solana/buffer-layout-utils');
11
+ var bigintBuffer = require('bigint-buffer');
12
12
  var superstruct = require('superstruct');
13
13
  var rpcWebsockets = require('rpc-websockets');
14
14
  var RpcClient = require('jayson/lib/client/browser');
@@ -3207,6 +3207,38 @@ class NonceAccount {
3207
3207
 
3208
3208
  }
3209
3209
 
3210
+ const encodeDecode = layout => {
3211
+ const decode = layout.decode.bind(layout);
3212
+ const encode = layout.encode.bind(layout);
3213
+ return {
3214
+ decode,
3215
+ encode
3216
+ };
3217
+ };
3218
+
3219
+ const bigInt = length => property => {
3220
+ const layout = BufferLayout.blob(length, property);
3221
+ const {
3222
+ encode,
3223
+ decode
3224
+ } = encodeDecode(layout);
3225
+ const bigIntLayout = layout;
3226
+
3227
+ bigIntLayout.decode = (buffer$1, offset) => {
3228
+ const src = decode(buffer$1, offset);
3229
+ return bigintBuffer.toBigIntLE(buffer.Buffer.from(src));
3230
+ };
3231
+
3232
+ bigIntLayout.encode = (bigInt, buffer, offset) => {
3233
+ const src = bigintBuffer.toBufferLE(bigInt, length);
3234
+ return encode(src, buffer, offset);
3235
+ };
3236
+
3237
+ return bigIntLayout;
3238
+ };
3239
+
3240
+ const u64 = bigInt(8);
3241
+
3210
3242
  /**
3211
3243
  * Create account system transaction params
3212
3244
  */
@@ -3508,7 +3540,7 @@ const SYSTEM_INSTRUCTION_LAYOUTS = Object.freeze({
3508
3540
  },
3509
3541
  Transfer: {
3510
3542
  index: 2,
3511
- layout: BufferLayout__namespace.struct([BufferLayout__namespace.u32('instruction'), bufferLayoutUtils.u64('lamports')])
3543
+ layout: BufferLayout__namespace.struct([BufferLayout__namespace.u32('instruction'), u64('lamports')])
3512
3544
  },
3513
3545
  CreateWithSeed: {
3514
3546
  index: 3,
@@ -3544,7 +3576,7 @@ const SYSTEM_INSTRUCTION_LAYOUTS = Object.freeze({
3544
3576
  },
3545
3577
  TransferWithSeed: {
3546
3578
  index: 11,
3547
- layout: BufferLayout__namespace.struct([BufferLayout__namespace.u32('instruction'), bufferLayoutUtils.u64('lamports'), rustString('seed'), publicKey('programId')])
3579
+ layout: BufferLayout__namespace.struct([BufferLayout__namespace.u32('instruction'), u64('lamports'), rustString('seed'), publicKey('programId')])
3548
3580
  }
3549
3581
  });
3550
3582
  /**
@@ -4248,7 +4280,7 @@ const COMPUTE_BUDGET_INSTRUCTION_LAYOUTS = Object.freeze({
4248
4280
  },
4249
4281
  SetComputeUnitPrice: {
4250
4282
  index: 3,
4251
- layout: BufferLayout__namespace.struct([BufferLayout__namespace.u8('instruction'), bufferLayoutUtils.u64('microLamports')])
4283
+ layout: BufferLayout__namespace.struct([BufferLayout__namespace.u8('instruction'), u64('microLamports')])
4252
4284
  }
4253
4285
  });
4254
4286
  /**