Update floCloudAPI.js

This commit is contained in:
tripathyr 2023-10-15 12:59:51 +05:30 committed by GitHub
parent 42b7c2aa61
commit 35128829d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -418,7 +418,11 @@
bytes = ripemd160(Crypto.SHA256(Crypto.util.hexToBytes(address), {
asBytes: true
}));
} else if ((address.length == 42 && address.startsWith("0x")) || (address.length == 40 && !address.startsWith("0x"))){ //Ethereum Address
if (address.startsWith("0x")) { address = address.substring(2);}
bytes = Crypto.util.hexToBytes(address), { asBytes: true };
}
if (!bytes)
throw "Invalid address: " + address;
else {
@ -1103,4 +1107,4 @@
})();
})('object' === typeof module ? module.exports : window.floCloudAPI = {});
})('object' === typeof module ? module.exports : window.floCloudAPI = {});