Skip to main content

ShelleyAddress

Wrapper for Cardano (post-Byron) address bytes. A ShelleyAddress consists of three parts internally:

  • Header (1 byte, see CIP 19)
  • Witness hash (28 bytes that represent the PubKeyHash or ValidatorHash)
  • Optional staking credential (0 or 28 bytes)
export interface ShelleyAddress {
  bech32Prefix: "addr" | "addr_test"
  bytes: number[]
  copy(): ShelleyAddress<SC>
  dump(): any
  era: "Shelley"
  isEqual(other: Address): boolean
  kind: "Address"
  mainnet: boolean
  spendingCredential: SC
  stakingCredential: undefined | StakingCredential
  toBech32(): string
  toCbor(): number[]
  toHex(): string
  toString(): string
  toUplcData(): UplcData
}

Properties

bech32Prefix

shelleyAddress.bech32Prefix satisfies "addr" | "addr_test"

bytes

shelleyAddress.bytes satisfies number[]

copy

shelleyAddress.copy satisfies () => ShelleyAddress<SC>

dump

shelleyAddress.dump satisfies () => any

era

shelleyAddress.era satisfies "Shelley"

isEqual

shelleyAddress.isEqual satisfies (other: Address) => boolean

kind

shelleyAddress.kind satisfies "Address"

mainnet

shelleyAddress.mainnet satisfies boolean

spendingCredential

shelleyAddress.spendingCredential satisfies SC

stakingCredential

shelleyAddress.stakingCredential satisfies undefined | StakingCredential

toBech32

shelleyAddress.toBech32 satisfies () => string

toCbor

shelleyAddress.toCbor satisfies () => number[]

toHex

shelleyAddress.toHex satisfies () => string

toString

Alias for toBech32()

shelleyAddress.toString satisfies () => string

toUplcData

shelleyAddress.toUplcData satisfies () => UplcData