Secp256k1Account

This file defines the Secp256k1Account class, which extends the Account abstract class and provides specific implementations for the Ed25519 signature scheme.

The Secp256k1Account class has the following properties:

  • privateKey: The private key of the account.

  • mnemonic: A string representing the mnemonic phrase associated with the account.

  • publicKey: The public key of the account, derived from the private key.

  • address: The account address, derived from the public key and the signature scheme.

  • scheme: The signature scheme used by the account, which is Ed25519.

The class provides the following methods:

  • toString(): Returns a string representation of the account, including the mnemonic and address.

The companion object provides the following methods:

  • generate(): Generates a new Secp256k1Account using a randomly generated mnemonic phrase and seed.

Constructors

Link copied to clipboard
constructor(privateKey: Secp256k1PrivateKey, mnemonic: String)
constructor(privateKey: Secp256k1PrivateKey)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val address: AccountAddress
Link copied to clipboard
Link copied to clipboard
open override val publicKey: Secp256k1PublicKey
Link copied to clipboard
open override val scheme: SignatureScheme

Functions

Link copied to clipboard
open suspend override fun sign(message: ByteArray): Result<ByteArray, E>
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open suspend override fun verify(message: ByteArray, signature: ByteArray): Result<Boolean, E>