@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
Name | Type |
---|---|
point | Point |
Returns
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
Name | Type |
---|---|
another | PubKey |
Returns
boolean
Defined in
packages/core/dist/pubkey.d.ts:40
toAddress
▸ toAddress(): Address
Returns the PubKey's Address.
Returns
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
Name | Type |
---|---|
bytes | Uint8Array |
Returns
Defined in
packages/core/dist/pubkey.d.ts:16
fromHex
▸ fromHex(str
): PubKey
Returns a PubKey from the given hex-encoded string.
Parameters
Name | Type |
---|---|
str | string |
Returns
Defined in
packages/core/dist/pubkey.d.ts:20
fromPrivKey
▸ fromPrivKey(privKey
): PubKey
Returns a the giveb PrivKey's corresponding PubKey.
Parameters
Name | Type |
---|---|
privKey | PrivKey |
Returns
Defined in
packages/core/dist/pubkey.d.ts:28
fromString
▸ fromString(str
): PubKey
Returns a PubKey from the given bech32m-encoded string.
Parameters
Name | Type |
---|---|
str | string |
Returns
Defined in
packages/core/dist/pubkey.d.ts:24