@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 +6 -0
- package/dist/index.cjs +13 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +12 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -6
package/CHANGELOG.md
CHANGED
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 =
|
|
8949
|
+
value = bufferToBigInt(Buffer.from(hex2, "hex"));
|
|
8943
8950
|
}
|
|
8944
8951
|
if (value instanceof Uint8Array) {
|
|
8945
|
-
value =
|
|
8952
|
+
value = bufferToBigInt(Buffer.from(value));
|
|
8946
8953
|
}
|
|
8947
|
-
const bf =
|
|
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;
|