aptos-core icon indicating copy to clipboard operation
aptos-core copied to clipboard

[Feature Request] Address Validation Function

Open will-yjn opened this issue 3 years ago • 6 comments

🚀 Feature Request

It would be nice to have a function that verify the validity of the address, checksum, etc.

Motivation

Is your feature request related to a problem? Please describe.

Pitch

Describe the solution you'd like

Describe alternatives you've considered

Are you willing to open a pull request? (See CONTRIBUTING)

Additional context

will-yjn avatar Aug 30 '22 08:08 will-yjn

Validity of a network address or an account address?

And validity being that it is valid, or that it exists?

gregnazario avatar Sep 03 '22 04:09 gregnazario

Validity being that it is valid, checksum checked, etc. Not that it exists on the blockchain.

will-yjn avatar Sep 05 '22 02:09 will-yjn

I think I need a few more details on this.

The AccountAddress can be validated that it is valid, though there is no checksum involved. The NetworkAddress can also be validated that it is valid, though there is no checksum involved.

Is this a request for the SDKs or CLI?

gregnazario avatar Sep 07 '22 20:09 gregnazario

It is a request for the sdk. Basically check the validity of an address. For example, obviously a bitcoin address won't be valid for as a receiver address.

will-yjn avatar Sep 08 '22 02:09 will-yjn

Got it, you want to verify that a string is a valid aptos address, which is a 32-byte hex encoded string.

gregnazario avatar Sep 14 '22 06:09 gregnazario

This issue is stale because it has been open 45 days with no activity. Remove the stale label or comment - otherwise this will be closed in 15 days.

github-actions[bot] avatar Nov 07 '22 03:11 github-actions[bot]

Hey all, +1 to this request as well.

@gregnazario Can you please confirm if there is a good regex that we should use in the meantime?

jennifer-notifi avatar Nov 27 '22 22:11 jennifer-notifi

This issue is stale because it has been open 45 days with no activity. Remove the stale label or comment - otherwise this will be closed in 15 days.

github-actions[bot] avatar Jan 12 '23 02:01 github-actions[bot]