validateStacksAddress

Validates whether a string is a valid Stacks address (c32check encoded).


Usage

import { validateStacksAddress } from '@stacks/transactions';

validateStacksAddress('ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM');
// true

validateStacksAddress('invalid-address');
// false

Reference Linkarrow-up-right


Signature

function validateStacksAddress(address: string): boolean;

Returns

boolean

true if the address is a valid c32check-encoded Stacks address, false otherwise.


Parameters

address (required)

  • Type: string

The address string to validate.

Last updated

Was this helpful?