Optional
disallowWhether to disallow Ethereum addresses as handles.
This is normally used when registering a handle for a user, because Ethereum addresses are not allowed as handles when creating a character.
But note that there are some characters that have Ethereum addresses as handles.
This is because they were created by the createThenLinkCharacter
contract method.
false
.
An object with valid
and message
properties.
If valid
is true
, then the handle is valid.
If valid
is false
, then the handle is invalid, and the message
property contains the reason why it is invalid.
const { valid, message } = contract.character.validateHandle('my-handle')
if (!valid) {
throw new Error(message)
}
Generated using TypeDoc
This validates a handle format.
A correct handle must be:
Optional:
disallowAddress
is set totrue
;false
by default)Some correct handles examples:
abcdefg
my-handle
my-handle_123
Some incorrect handles examples:
ab
(too short)my handle
(contains space)my-handle!
(contains!
)WhatIsThis
(contains uppercase)