Skip to content

Why is there no Address or DataHexString Typescript type export? #1429

Answered by ricmoo
bstchow asked this question in Q&A
Discussion options

You must be logged in to vote

There is no in-code alias for those, they are just strings. The main reason to break them out in the documentation is to provide a stricter guideline as to what the string should/will look like.

A hex string would match /^0x[0-9a-f]*$/i and a data hex string /^0x([0-9a-f][0-9a-f])*$/I (i.e. even length).

But anywhere used in the docs, you can assume string, but which will adhere to those constraints.

Does that make sense?

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@bstchow
Comment options

Answer selected by bstchow
Comment options

You must be logged in to vote
2 replies
@bstchow
Comment options

@ricmoo
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1428 on April 04, 2021 06:24.