Skip to main content

Address

@harmoniclabs/cardano-ledger-tsDocs


@harmoniclabs/cardano-ledger-ts / Address

Class: Address

shelley specification in cardano-ledger; page 113

Implements

  • ToData
  • ToCbor

Constructors

new Address()

new Address(network, paymentCreds, stakeCreds?, type?): Address

Parameters

network: NetworkT

paymentCreds: Credential<CredentialType>

stakeCreds?: StakeCredentials<StakeCredentialsType>

type?: AddressType

Returns

Address

Defined in

src/ledger/Address.ts:75

Properties

network

readonly network: NetworkT

Defined in

src/ledger/Address.ts:42


paymentCreds

readonly paymentCreds: Credential<CredentialType>

Defined in

src/ledger/Address.ts:43


stakeCreds?

readonly optional stakeCreds: StakeCredentials<StakeCredentialsType>

Defined in

src/ledger/Address.ts:44


type

readonly type: AddressType

Defined in

src/ledger/Address.ts:45

Accessors

fake

get static fake(): Address

Returns

Address

Defined in

src/ledger/Address.ts:132

Methods

clone()

clone(): Address

Returns

Address

Defined in

src/ledger/Address.ts:122


toBuffer()

toBuffer(): Uint8Array

Returns

Uint8Array

Defined in

src/ledger/Address.ts:269


toBytes()

toBytes(): byte[]

Returns

byte[]

Defined in

src/ledger/Address.ts:153


toCbor()

toCbor(): CborString

Returns

CborString

Implementation of

ToCbor.toCbor

Defined in

src/ledger/Address.ts:337


toCborObj()

toCborObj(): CborObj

Returns

CborObj

Implementation of

ToCbor.toCborObj

Defined in

src/ledger/Address.ts:324


toData()

toData(): Data

Returns

Data

Implementation of

ToData.toData

Defined in

src/ledger/Address.ts:140


toJson()

toJson(): `addr1${string}` | `addr_test1${string}`

Returns

`addr1${string}` | `addr_test1${string}`

Defined in

src/ledger/Address.ts:384


toString()

toString(): `addr1${string}` | `addr_test1${string}`

Returns a string representation of an object.

Returns

`addr1${string}` | `addr_test1${string}`

Defined in

src/ledger/Address.ts:347


fromBuffer()

static fromBuffer(buff): Address

Parameters

buff: string | Uint8Array

Returns

Address

Defined in

src/ledger/Address.ts:274


fromBytes()

static fromBytes(bs): Address

Parameters

bs: string | Uint8Array | byte[]

Returns

Address

Defined in

src/ledger/Address.ts:192


fromCbor()

static fromCbor(cbor): Address

Parameters

cbor: CanBeCborString

Returns

Address

Defined in

src/ledger/Address.ts:342


fromCborObj()

static fromCborObj(buff): Address

Parameters

buff: CborObj

Returns

Address

Defined in

src/ledger/Address.ts:329


fromEntropy()

static fromEntropy(entropy, network): Address

generates an XPrv from entropy and calls Addres.fromXPrv

gets the standard address for single address wallets

payment key at path "m/1852'/1815'/0'/0/0" stake key at path "m/1852'/1815'/0'/2/0"

Parameters

entropy: string | Uint8Array

network: NetworkT = "mainnet"

Returns

Address

Defined in

src/ledger/Address.ts:319


fromString()

static fromString(addr): Address

Parameters

addr: string

Returns

Address

Defined in

src/ledger/Address.ts:355


fromXPrv()

static fromXPrv(xprv, network): Address

gets the standard address for single address wallets

payment key at path "m/1852'/1815'/0'/0/0" stake key at path "m/1852'/1815'/0'/2/0"

Parameters

xprv: XPrv

network: NetworkT = "mainnet"

Returns

Address

Defined in

src/ledger/Address.ts:289


mainnet()

static mainnet(paymentCreds, stakeCreds?, type?): Address

Parameters

paymentCreds: Credential<CredentialType>

stakeCreds?: StakeCredentials<StakeCredentialsType>

type?: AddressType

Returns

Address

Defined in

src/ledger/Address.ts:47


testnet()

static testnet(paymentCreds, stakeCreds?, type?): Address

Parameters

paymentCreds: Credential<CredentialType>

stakeCreds?: StakeCredentials<StakeCredentialsType>

type?: AddressType

Returns

Address

Defined in

src/ledger/Address.ts:61