@starknet-react/core
Version:
Starknet React is a collection of React hooks for Starknet.
13 lines (11 loc) • 383 B
text/typescript
import type { Address } from "@starknet-react/chains";
import { validateAndParseAddress } from "starknet";
/**
* Validate and format the address.
*
* @param address - The address string to validate.
* @returns The validated and formatted address as Address type.
*/
export function getAddress(address: string): Address {
return validateAndParseAddress(address) as Address;
}