starknet 11.10.2 → 11.10.4
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 +12 -0
- package/dist/index.global.js +4 -3
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1130,7 +1130,7 @@ function addPercent(number, percent) {
|
|
|
1130
1130
|
function stringToSha256ToArrayBuff4(str) {
|
|
1131
1131
|
const int31 = (n) => Number(n & MASK_31);
|
|
1132
1132
|
const result = int31(BigInt(addHexPrefix(buf2hex((0, import_sha2.sha256)((0, import_utils2.utf8ToBytes)(str))))));
|
|
1133
|
-
return hexToBytes(toHex(result));
|
|
1133
|
+
return hexToBytes(addHexPrefix(removeHexPrefix(toHex(result)).padStart(8, "0")));
|
|
1134
1134
|
}
|
|
1135
1135
|
function isEmptyHex(value) {
|
|
1136
1136
|
return isString(value) && /^0x$/i.test(value);
|
|
@@ -19056,8 +19056,9 @@ function validateAndParseAddress(address) {
|
|
|
19056
19056
|
return result;
|
|
19057
19057
|
}
|
|
19058
19058
|
function getChecksumAddress(address) {
|
|
19059
|
-
const
|
|
19060
|
-
const
|
|
19059
|
+
const parsedAddress = validateAndParseAddress(address);
|
|
19060
|
+
const chars = removeHexPrefix(parsedAddress).toLowerCase().split("");
|
|
19061
|
+
const hex = removeHexPrefix(keccakBn(parsedAddress));
|
|
19061
19062
|
const hashed = (0, import_utils7.hexToBytes)(hex.padStart(64, "0"));
|
|
19062
19063
|
for (let i = 0; i < chars.length; i += 2) {
|
|
19063
19064
|
if (hashed[i >> 1] >> 4 >= 8) {
|