@layerzerolabs/lz-ton-sdk-v2 3.0.90 → 3.0.91

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @layerzerolabs/lz-ton-sdk-v2
2
2
 
3
+ ## 3.0.91
4
+
5
+ ### Patch Changes
6
+
7
+ - e1f22b4: Publish New Aptos Packages with testnet deployments
8
+
3
9
  ## 3.0.90
4
10
 
5
11
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -3,7 +3,6 @@
3
3
  var $cjs$_ton_core = require('@ton/core');
4
4
  require('crc-32');
5
5
  require('ethers');
6
- var bigintBuffer = require('bigint-buffer');
7
6
  var buffer = require('buffer');
8
7
  require('@ton/crypto');
9
8
  require('@ton/ton');
@@ -8930,6 +8929,14 @@ var fromUtf8 = (input) => {
8930
8929
  typeof Buffer !== "undefined" && Buffer.from ? function(input) {
8931
8930
  return Buffer.from(input, "utf8");
8932
8931
  } : fromUtf8;
8932
+ function bufferToBigInt(value) {
8933
+ return BigInt(`0x${value.toString("hex")}`);
8934
+ }
8935
+ function bigintToSizedBuffer(num, width) {
8936
+ const hex2 = num.toString(16);
8937
+ const padded = hex2.padStart(width * 2, "0").slice(0, width * 2);
8938
+ return Buffer.from(padded, "hex");
8939
+ }
8933
8940
  function to32ByteBuffer(value, maxIntermediateBufferSize = 66) {
8934
8941
  if (typeof value === "string") {
8935
8942
  if (!isValidHex(value)) {
@@ -8939,12 +8946,12 @@ function to32ByteBuffer(value, maxIntermediateBufferSize = 66) {
8939
8946
  if (hex2.length % 2 !== 0) {
8940
8947
  hex2 = "0" + hex2;
8941
8948
  }
8942
- value = bigintBuffer.toBigIntBE(Buffer.from(hex2, "hex"));
8949
+ value = bufferToBigInt(Buffer.from(hex2, "hex"));
8943
8950
  }
8944
8951
  if (value instanceof Uint8Array) {
8945
- value = bigintBuffer.toBigIntBE(Buffer.from(value));
8952
+ value = bufferToBigInt(Buffer.from(value));
8946
8953
  }
8947
- const bf = bigintBuffer.toBufferBE(BigInt(value), maxIntermediateBufferSize);
8954
+ const bf = bigintToSizedBuffer(BigInt(value), maxIntermediateBufferSize);
8948
8955
  return bf.subarray(-32);
8949
8956
  }
8950
8957
  function trim0x(str2) {
@@ -18251,6 +18258,8 @@ exports.baseBuildClass = baseBuildClass;
18251
18258
  exports.baseDecodeClass = baseDecodeClass2;
18252
18259
  exports.bigintToAddress = bigintToAddress;
18253
18260
  exports.bigintToAsciiString = bigintToAsciiString2;
18261
+ exports.bigintToSizedBuffer = bigintToSizedBuffer;
18262
+ exports.bufferToBigInt = bufferToBigInt;
18254
18263
  exports.buildClass = buildClass;
18255
18264
  exports.buildPathClass = buildPathClass;
18256
18265
  exports.calculateCellConsumption = calculateCellConsumption;