Skip to content

@aldea/sdk / Exports / PrivKey

Class: PrivKey

Aldea private key

A private key is a 32 byte random key.

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new PrivKey(d): PrivKey

Parameters

NameType
dUint8Array

Returns

PrivKey

Defined in

packages/core/dist/privkey.d.ts:9

Properties

d

Private d: any

Defined in

packages/core/dist/privkey.d.ts:8

Methods

toBytes

toBytes(): Uint8Array

Returns the PrivKey as bytes.

Returns

Uint8Array

Defined in

packages/core/dist/privkey.d.ts:29


toHex

toHex(): string

Returns the PrivKey as hex-encoded string.

Returns

string

Defined in

packages/core/dist/privkey.d.ts:33


toKeyPair

toKeyPair(): KeyPair

Returns a KeyPair from the PrivKey.

Returns

KeyPair

Defined in

packages/core/dist/privkey.d.ts:41


toPubKey

toPubKey(): PubKey

Returns the PrivKey's corresponding PubKey.

Returns

PubKey

Defined in

packages/core/dist/privkey.d.ts:45


toString

toString(): string

Returns the PrivKey as bech32m-encoded string.

Returns

string

Defined in

packages/core/dist/privkey.d.ts:37


fromBytes

fromBytes(bytes): PrivKey

Returns a PrivKey from the given bytes.

Parameters

NameType
bytesUint8Array

Returns

PrivKey

Defined in

packages/core/dist/privkey.d.ts:13


fromHex

fromHex(str): PrivKey

Returns a PrivKey from the given hex-encoded string.

Parameters

NameType
strstring

Returns

PrivKey

Defined in

packages/core/dist/privkey.d.ts:17


fromRandom

fromRandom(): PrivKey

Generates and returns a new random PrivKey.

Returns

PrivKey

Defined in

packages/core/dist/privkey.d.ts:25


fromString

fromString(str): PrivKey

Returns a PrivKey from the given bech32m-encoded string.

Parameters

NameType
strstring

Returns

PrivKey

Defined in

packages/core/dist/privkey.d.ts:21