Skip to content

@aldea/sdk / Exports / PubKey

Class: PubKey

Aldea public key

A public key is the X and Y coordinates of a point on Ed25519 curve. It is serialized as the 32 byte Y coordinate, with the last byte encoding the sign of X.

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new PubKey(point): PubKey

Parameters

NameType
pointPoint

Returns

PubKey

Defined in

packages/core/dist/pubkey.d.ts:12

Properties

point

Readonly point: Point

Defined in

packages/core/dist/pubkey.d.ts:11

Accessors

x

get x(): bigint

Point X coordiante

Returns

bigint

Defined in

packages/core/dist/pubkey.d.ts:32


y

get y(): bigint

Point Y coordiante

Returns

bigint

Defined in

packages/core/dist/pubkey.d.ts:36

Methods

equals

equals(another): boolean

checks if 2 pubkey objects represent the same point

Parameters

NameType
anotherPubKey

Returns

boolean

Defined in

packages/core/dist/pubkey.d.ts:40


toAddress

toAddress(): Address

Returns the PubKey's Address.

Returns

Address

Defined in

packages/core/dist/pubkey.d.ts:44


toBytes

toBytes(): Uint8Array

Returns the PubKey as bytes.

Returns

Uint8Array

Defined in

packages/core/dist/pubkey.d.ts:48


toHex

toHex(): string

Returns the PubKey as hex-encoded string.

Returns

string

Defined in

packages/core/dist/pubkey.d.ts:52


toString

toString(): string

Returns the PubKey as bech32m-encoded string.

Returns

string

Defined in

packages/core/dist/pubkey.d.ts:56


fromBytes

fromBytes(bytes): PubKey

Returns a PubKey from the given bytes.

Parameters

NameType
bytesUint8Array

Returns

PubKey

Defined in

packages/core/dist/pubkey.d.ts:16


fromHex

fromHex(str): PubKey

Returns a PubKey from the given hex-encoded string.

Parameters

NameType
strstring

Returns

PubKey

Defined in

packages/core/dist/pubkey.d.ts:20


fromPrivKey

fromPrivKey(privKey): PubKey

Returns a the giveb PrivKey's corresponding PubKey.

Parameters

NameType
privKeyPrivKey

Returns

PubKey

Defined in

packages/core/dist/pubkey.d.ts:28


fromString

fromString(str): PubKey

Returns a PubKey from the given bech32m-encoded string.

Parameters

NameType
strstring

Returns

PubKey

Defined in

packages/core/dist/pubkey.d.ts:24