Skip to main content

Class: Secp256k1KeyProvider

Implementation of PrivateKeyProvider that provides a private key from an in memory private key.

Hierarchy

Constructors

constructor

new Secp256k1KeyProvider(privateKey): Secp256k1KeyProvider

Default constructor.

Parameters

NameTypeDescription
privateKeystring | Uint8ArrayHex encoded private key, or raw private key bytes.

Returns

Secp256k1KeyProvider

Overrides

PrivateKeyProvider.constructor

Defined in

packages/core/src/signers/privatekey.ts:107

Properties

keyProviderStatus

Protected keyProviderStatus: PrivateKeyProviderStatus = PrivateKeyProviderStatus.NotConnected

Inherited from

PrivateKeyProvider.keyProviderStatus

Defined in

packages/core/src/signers/privatekey.ts:53


privateKey

Private Readonly privateKey: Uint8Array

Defined in

packages/core/src/signers/privatekey.ts:101

Accessors

status

get status(): PrivateKeyProviderStatus

Returns

PrivateKeyProviderStatus

Inherited from

PrivateKeyProvider.status

Defined in

packages/core/src/signers/privatekey.ts:75

Methods

addStatusListener

addStatusListener(observer): void

Parameters

NameType
observerObserver<PrivateKeyProviderStatus>

Returns

void

Inherited from

PrivateKeyProvider.addStatusListener

Defined in

packages/core/src/signers/privatekey.ts:56


assertConnected

assertConnected(): void

Returns

void

Inherited from

PrivateKeyProvider.assertConnected

Defined in

packages/core/src/signers/privatekey.ts:69


connect

connect(): Promise<void>

Connects to the Secp256k1 key provider.

Returns

Promise<void>

Overrides

PrivateKeyProvider.connect

Defined in

packages/core/src/signers/privatekey.ts:118


disconnect

disconnect(): Promise<void>

Disconnects from the Secp256k1 key provider.

Returns

Promise<void>

Overrides

PrivateKeyProvider.disconnect

Defined in

packages/core/src/signers/privatekey.ts:126


getPrivateKey

getPrivateKey(): Promise<PrivateKey>

Gets the Secp256k1 private key. If the key provider is not connected this function should throw an error.

Returns

Promise<PrivateKey>

Overrides

PrivateKeyProvider.getPrivateKey

Defined in

packages/core/src/signers/privatekey.ts:134


removeStatusListener

removeStatusListener(observer): void

Parameters

NameType
observerObserver<PrivateKeyProviderStatus>

Returns

void

Inherited from

PrivateKeyProvider.removeStatusListener

Defined in

packages/core/src/signers/privatekey.ts:60


updateStatus

updateStatus(newStatus): void

Parameters

NameType
newStatusPrivateKeyProviderStatus

Returns

void

Inherited from

PrivateKeyProvider.updateStatus

Defined in

packages/core/src/signers/privatekey.ts:64