Skip to main content

iota_sdk.secret_manager.secret_manager

LedgerNanoSecretManager Objects

class LedgerNanoSecretManager(dict)

Secret manager that uses a Ledger Nano hardware wallet or a Speculos simulator.

__init__

def __init__(is_simulator)

Initialize a Ledger Nano secret manager.

Arguments:

  • is_simulator - Whether this is a simulated Ledger Nano device.

MnemonicSecretManager Objects

class MnemonicSecretManager(dict)

Secret manager that uses a mnemonic held in memory. This is not recommended in production. Use LedgerNano or Stronghold instead.

__init__

def __init__(mnemonic)

Initialize a mnemonic secret manager.

Arguments:

  • mnemonic - The root secret of this type of secret manager.

SeedSecretManager Objects

class SeedSecretManager(dict)

Secret manager that uses a seed.

__init__

def __init__(seed)

Initialize a seed secret manager.

Arguments:

  • seed - The root secret of this type of secret manager.

StrongholdSecretManager Objects

class StrongholdSecretManager(dict)

Secret manager that uses Stronghold.

__init__

def __init__(snapshot_path, password)

Initialize a stronghold secret manager.

Arguments:

  • snapshot_path - The path to the Stronghold snapshot file.
  • password - The password to unlock the Stronghold snapshot file.

SecretManagerError Objects

class SecretManagerError(Exception)

Secret manager error.

SecretManager Objects

class SecretManager()

__init__

def __init__(secret_manager: Optional[Union[LedgerNanoSecretManager,
MnemonicSecretManager,
SeedSecretManager,
StrongholdSecretManager]] = None,
secret_manager_handle=None)

Initialize a secret manager.

Arguments:

  • secret_manager - One of the supported secret managers.
  • secret_manager_handle - A handle to a secret manager.

generate_ed25519_addresses

def generate_ed25519_addresses(account_index: Optional[int] = None,
start: Optional[int] = None,
end: Optional[int] = None,
internal: Optional[bool] = None,
coin_type: Optional[int] = None,
bech32_hrp: Optional[str] = None,
ledger_nano_prompt: Optional[bool] = None)

Generate Ed25519 addresses.

Arguments:

  • account_index - An account index.
  • start - The start index of the addresses to generate.
  • end - The end index of the addresses to generate.
  • internal - Whether the generated addresses should be internal.
  • coin_type - The coin type to generate addresses for.
  • bech32_hrp - The bech32 HRP (human readable part) to use.
  • ledger_nano_prompt - Whether to display the address on Ledger Nano devices.

Returns:

The generated Ed25519 addresses.

generate_evm_addresses

def generate_evm_addresses(account_index: Optional[int] = None,
start: Optional[int] = None,
end: Optional[int] = None,
internal: Optional[bool] = None,
coin_type: Optional[int] = None,
ledger_nano_prompt: Optional[bool] = None)

Generate EVM addresses.

Arguments:

  • account_index - An account index.
  • start - The start index of the addresses to generate.
  • end - The end index of the addresses to generate.
  • internal - Whether the generated addresses should be internal.
  • coin_type - The coin type to generate addresses for.
  • ledger_nano_prompt - Whether to display the address on Ledger Nano devices.

Returns:

The generated EVM addresses.

get_ledger_nano_status

def get_ledger_nano_status()

Return the Ledger Status.

store_mnemonic

def store_mnemonic(mnemonic: str)

Store a mnemonic.

Arguments:

  • mnemonic - A mnemonic to store in the secret manager.

sign_ed25519

def sign_ed25519(message: HexStr, chain: Bip44) -> Ed25519Signature

Signs a message with an Ed25519 private key.

Arguments:

  • message - The given message to sign.
  • chain - The chain to sign with.

Returns:

The Ed25519 signature.

sign_secp256k1_ecdsa

def sign_secp256k1_ecdsa(message: HexStr, chain: Bip44)

Signs a message with an Secp256k1Ecdsa private key.

Arguments:

  • message - The given message to sign.
  • chain - The chain to sign with.

sign_transaction

def sign_transaction(
prepared_transaction_data: PreparedTransactionData
) -> TransactionPayload

Sign a transaction.

Arguments:

  • prepare_transaction_data - The prepared transaction data that needs to be signed.

signature_unlock

def signature_unlock(transaction_essence_hash: HexStr, chain: Bip44)

Sign a transaction essence hash.

Arguments:

  • transaction_essence_hash - The transaction essence hash to sign.
  • chain - The chain to sign with.