2024-10-21 10:14:48 +00:00
|
|
|
import QtQml 2.15
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
QtObject {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
readonly property QtObject _d: QtObject {
|
|
|
|
id: d
|
|
|
|
|
|
|
|
property var globalUtilsInst: globalUtils
|
|
|
|
}
|
|
|
|
|
|
|
|
function isChatKey(value) {
|
|
|
|
return (Utils.startsWith0x(value) && Utils.isHex(value) && value.length === 132)
|
|
|
|
|| d.globalUtilsInst.isCompressedPubKey(value)
|
|
|
|
}
|
2024-10-21 11:28:57 +00:00
|
|
|
|
|
|
|
function isCommunityPublicKey(value) {
|
|
|
|
return (Utils.startsWith0x(value) && Utils.isHex(value) && value.length === Constants.communityIdLength)
|
|
|
|
|| d.globalUtilsInst.isCompressedPubKey(value)
|
|
|
|
}
|
2024-10-21 13:40:14 +00:00
|
|
|
|
|
|
|
function isCompressedPubKey(pubKey) {
|
|
|
|
return d.globalUtilsInst.isCompressedPubKey(pubKey)
|
|
|
|
}
|
2024-10-21 10:14:48 +00:00
|
|
|
}
|