Class: Secp256k1KeyProvider
Implementation of PrivateKeyProvider that provides a private key from an in memory private key.
Hierarchy
↳
Secp256k1KeyProvider
Constructors
constructor
• new Secp256k1KeyProvider(privateKey
): Secp256k1KeyProvider
Default constructor.
Parameters
Name | Type | Description |
---|---|---|
privateKey | string | Uint8Array | Hex encoded private key, or raw private key bytes. |
Returns
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
Inherited from
PrivateKeyProvider.status
Defined in
packages/core/src/signers/privatekey.ts:75
Methods
addStatusListener
▸ addStatusListener(observer
): void
Parameters
Name | Type |
---|---|
observer | Observer <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
Defined in
packages/core/src/signers/privatekey.ts:118
disconnect
▸ disconnect(): Promise
<void
>
Disconnects from the Secp256k1 key provider.
Returns
Promise
<void
>
Overrides
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
Name | Type |
---|---|
observer | Observer <PrivateKeyProviderStatus > |
Returns
void
Inherited from
PrivateKeyProvider.removeStatusListener
Defined in
packages/core/src/signers/privatekey.ts:60
updateStatus
▸ updateStatus(newStatus
): void
Parameters
Name | Type |
---|---|
newStatus | PrivateKeyProviderStatus |
Returns
void
Inherited from
PrivateKeyProvider.updateStatus