Added support for ethereum address validation
This commit is contained in:
parent
69b73acdf8
commit
a5a242d50f
@ -12,6 +12,7 @@
|
|||||||
html,
|
html,
|
||||||
body {
|
body {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
view-transition-name: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
|
|||||||
2
css/main.min.css
vendored
2
css/main.min.css
vendored
File diff suppressed because one or more lines are too long
@ -12,6 +12,7 @@
|
|||||||
html,
|
html,
|
||||||
body {
|
body {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
view-transition-name: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
|
|||||||
@ -403,7 +403,7 @@
|
|||||||
});
|
});
|
||||||
hash[0] != checksum[0] || hash[1] != checksum[1] || hash[2] != checksum[2] || hash[3] != checksum[3] ?
|
hash[0] != checksum[0] || hash[1] != checksum[1] || hash[2] != checksum[2] || hash[3] != checksum[3] ?
|
||||||
bytes = undefined : bytes.shift();
|
bytes = undefined : bytes.shift();
|
||||||
} else if (address.length == 42 || address.length == 62) { //bech encoding
|
} else if (!address.startsWith("0x") && address.length == 42 || address.length == 62) { //bech encoding
|
||||||
if (typeof coinjs !== 'function')
|
if (typeof coinjs !== 'function')
|
||||||
throw "library missing (lib_btc.js)";
|
throw "library missing (lib_btc.js)";
|
||||||
let decode = coinjs.bech32_decode(address);
|
let decode = coinjs.bech32_decode(address);
|
||||||
|
|||||||
1
scripts/floCloudAPI.min.js
vendored
Normal file
1
scripts/floCloudAPI.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -299,6 +299,8 @@
|
|||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
} else if (raw.type === 'ethereum') {
|
||||||
|
return true
|
||||||
} else //unknown
|
} else //unknown
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -414,7 +416,7 @@
|
|||||||
hex: Crypto.util.bytesToHex(bytes),
|
hex: Crypto.util.bytesToHex(bytes),
|
||||||
bytes
|
bytes
|
||||||
}
|
}
|
||||||
} else if (address.length == 42 || address.length == 62) { //bech encoding
|
} else if (!address.startsWith("0x") && address.length == 42 || address.length == 62) { //bech encoding
|
||||||
let decode = coinjs.bech32_decode(address);
|
let decode = coinjs.bech32_decode(address);
|
||||||
if (decode) {
|
if (decode) {
|
||||||
let bytes = decode.data;
|
let bytes = decode.data;
|
||||||
@ -428,6 +430,11 @@
|
|||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
return null;
|
return null;
|
||||||
|
} else if ((address.length == 42 && address.startsWith("0x")) || (address.length == 40 && !address.startsWith("0x"))) { //Ethereum Address
|
||||||
|
return {
|
||||||
|
hex: address,
|
||||||
|
type: 'ethereum'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
1
scripts/floCrypto.min.js
vendored
Normal file
1
scripts/floCrypto.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user