Class: SecretManager
The SecretManager to interact with nodes.
Table of contents
Constructors
Methods
- generateEd25519Addresses
- generateEvmAddresses
- storeMnemonic
- signTransaction
- signatureUnlock
- signEd25519
- signSecp256k1Ecdsa
- getLedgerNanoStatus
Constructors
constructor
• new SecretManager(options
)
Parameters
Name | Type | Description |
---|---|---|
options | SecretManagerType | SecretManagerMethodHandler | A secret manager type or a secret manager method handler. |
Methods
generateEd25519Addresses
▸ generateEd25519Addresses(generateAddressesOptions
): Promise
<string
[]>
Generate Ed25519 addresses.
Parameters
Name | Type | Description |
---|---|---|
generateAddressesOptions | IGenerateAddressesOptions | Options to generate addresses. |
Returns
Promise
<string
[]>
An array of generated addresses.
generateEvmAddresses
▸ generateEvmAddresses(generateAddressesOptions
): Promise
<string
[]>
Generate EVM addresses.
Parameters
Name | Type | Description |
---|---|---|
generateAddressesOptions | IGenerateAddressesOptions | Options to generate addresses. |
Returns
Promise
<string
[]>
An array of generated addresses.
storeMnemonic
▸ storeMnemonic(mnemonic
): Promise
<void
>
Store a mnemonic in the Stronghold vault.
Parameters
Name | Type | Description |
---|---|---|
mnemonic | string | The mnemonic to store. |
Returns
Promise
<void
>
signTransaction
▸ signTransaction(preparedTransactionData
): Promise
<TransactionPayload
>
Sign a transaction.
Parameters
Name | Type | Description |
---|---|---|
preparedTransactionData | PreparedTransactionData | An instance of PreparedTransactionData . |
Returns
Promise
<TransactionPayload
>
The corresponding transaction payload.
signatureUnlock
▸ signatureUnlock(transactionEssenceHash
, chain
): Promise
<Unlock
>
Create a signature unlock using the provided secretManager
.
Parameters
Name | Type | Description |
---|---|---|
transactionEssenceHash | string | The hash of the transaction essence. |
chain | Bip44 | A BIP44 chain. |
Returns
Promise
<Unlock
>
The corresponding unlock.
signEd25519
▸ signEd25519(message
, chain
): Promise
<Ed25519Signature
>
Signs a message with an Ed25519 private key.
Parameters
Name | Type | Description |
---|---|---|
message | string | The message to sign. |
chain | Bip44 | A BIP44 chain. |
Returns
Promise
<Ed25519Signature
>
The corresponding signature.
signSecp256k1Ecdsa
▸ signSecp256k1Ecdsa(message
, chain
): Promise
<Secp256k1EcdsaSignature
>
Signs a message with an Secp256k1Ecdsa private key.
Parameters
Name | Type | Description |
---|---|---|
message | string | The message to sign. |
chain | Bip44 | A BIP44 chain. |
Returns
Promise
<Secp256k1EcdsaSignature
>
The corresponding signature.
getLedgerNanoStatus
▸ getLedgerNanoStatus(): Promise
<LedgerNanoStatus
>
Get the status of a Ledger Nano.
Returns
Promise
<LedgerNanoStatus
>