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.mjs
CHANGED
|
@@ -919,7 +919,7 @@ function addPercent(number, percent) {
|
|
|
919
919
|
function stringToSha256ToArrayBuff4(str) {
|
|
920
920
|
const int31 = (n) => Number(n & MASK_31);
|
|
921
921
|
const result = int31(BigInt(addHexPrefix(buf2hex(sha256(utf8ToBytes(str))))));
|
|
922
|
-
return hexToBytes(toHex(result));
|
|
922
|
+
return hexToBytes(addHexPrefix(removeHexPrefix(toHex(result)).padStart(8, "0")));
|
|
923
923
|
}
|
|
924
924
|
function isEmptyHex(value) {
|
|
925
925
|
return isString(value) && /^0x$/i.test(value);
|
|
@@ -18845,8 +18845,9 @@ function validateAndParseAddress(address) {
|
|
|
18845
18845
|
return result;
|
|
18846
18846
|
}
|
|
18847
18847
|
function getChecksumAddress(address) {
|
|
18848
|
-
const
|
|
18849
|
-
const
|
|
18848
|
+
const parsedAddress = validateAndParseAddress(address);
|
|
18849
|
+
const chars = removeHexPrefix(parsedAddress).toLowerCase().split("");
|
|
18850
|
+
const hex = removeHexPrefix(keccakBn(parsedAddress));
|
|
18850
18851
|
const hashed = hexToBytes2(hex.padStart(64, "0"));
|
|
18851
18852
|
for (let i = 0; i < chars.length; i += 2) {
|
|
18852
18853
|
if (hashed[i >> 1] >> 4 >= 8) {
|