Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Address

A 0x-prefixed hex string identifying an account or contract on Dango.

Definition

type Address = `0x${string}`

Construction

import type { Address } from "@left-curve/sdk"
import { isValidAddress } from "@left-curve/sdk"
 
const addr: Address = "0x1234567890abcdef1234567890abcdef12345678"
 
if (!isValidAddress(candidate)) {
  throw new Error(`invalid address: ${candidate}`)
}

Notes

  • A valid address is exactly 42 characters: "0x" plus 40 hex digits (20 bytes).
  • The branded 0x${string} template literal type prevents arbitrary strings from being passed where addresses are expected.
  • The SDK exports two helpers: computeAddress derives an address from (deployer, codeHash, salt), and isValidAddress validates a string at runtime.

See also