@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
Name | Type |
---|---|
d | Uint8Array |
Returns
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
Defined in
packages/core/dist/privkey.d.ts:41
toPubKey
▸ toPubKey(): PubKey
Returns the PrivKey's corresponding PubKey.
Returns
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
Name | Type |
---|---|
bytes | Uint8Array |
Returns
Defined in
packages/core/dist/privkey.d.ts:13
fromHex
▸ fromHex(str
): PrivKey
Returns a PrivKey from the given hex-encoded string.
Parameters
Name | Type |
---|---|
str | string |
Returns
Defined in
packages/core/dist/privkey.d.ts:17
fromRandom
▸ fromRandom(): PrivKey
Generates and returns a new random PrivKey.
Returns
Defined in
packages/core/dist/privkey.d.ts:25
fromString
▸ fromString(str
): PrivKey
Returns a PrivKey from the given bech32m-encoded string.
Parameters
Name | Type |
---|---|
str | string |
Returns
Defined in
packages/core/dist/privkey.d.ts:21