Skip to main content

Class: SecretManager

The SecretManager to interact with nodes.

Table of contents

Constructors

Methods

Constructors

constructor

new SecretManager(options)

Parameters

NameTypeDescription
optionsSecretManagerType | SecretManagerMethodHandlerA secret manager type or a secret manager method handler.

Methods

generateEd25519Addresses

generateEd25519Addresses(generateAddressesOptions): Promise<string[]>

Generate Ed25519 addresses.

Parameters

NameTypeDescription
generateAddressesOptionsIGenerateAddressesOptionsOptions to generate addresses.

Returns

Promise<string[]>

An array of generated addresses.


generateEvmAddresses

generateEvmAddresses(generateAddressesOptions): Promise<string[]>

Generate EVM addresses.

Parameters

NameTypeDescription
generateAddressesOptionsIGenerateAddressesOptionsOptions to generate addresses.

Returns

Promise<string[]>

An array of generated addresses.


storeMnemonic

storeMnemonic(mnemonic): Promise<void>

Store a mnemonic in the Stronghold vault.

Parameters

NameTypeDescription
mnemonicstringThe mnemonic to store.

Returns

Promise<void>


signTransaction

signTransaction(preparedTransactionData): Promise<TransactionPayload>

Sign a transaction.

Parameters

NameTypeDescription
preparedTransactionDataPreparedTransactionDataAn 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

NameTypeDescription
transactionEssenceHashstringThe hash of the transaction essence.
chainBip44A BIP44 chain.

Returns

Promise<Unlock>

The corresponding unlock.


signEd25519

signEd25519(message, chain): Promise<Ed25519Signature>

Signs a message with an Ed25519 private key.

Parameters

NameTypeDescription
messagestringThe message to sign.
chainBip44A BIP44 chain.

Returns

Promise<Ed25519Signature>

The corresponding signature.


signSecp256k1Ecdsa

signSecp256k1Ecdsa(message, chain): Promise<Secp256k1EcdsaSignature>

Signs a message with an Secp256k1Ecdsa private key.

Parameters

NameTypeDescription
messagestringThe message to sign.
chainBip44A BIP44 chain.

Returns

Promise<Secp256k1EcdsaSignature>

The corresponding signature.


getLedgerNanoStatus

getLedgerNanoStatus(): Promise<LedgerNanoStatus>

Get the status of a Ledger Nano.

Returns

Promise<LedgerNanoStatus>