ethr

package
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const Method = types.DIDMethod("ethr")

Variables

This section is empty.

Functions

func NewEthereumAccount

func NewEthereumAccount(key types.DIDSecretKey) (types.WalletAccount, error)

NewEthereumAccount creates a new Ethereum Wallet Actor DID

func ResolveAccount

func ResolveAccount(didString string, key types.DIDSecretKey) (types.WalletAccount, error)

ResolveAccount resolves a Sonr Wallet Actor DID

Types

type EthereumAccount

type EthereumAccount struct {
	ID        types.DIDIdentifier
	Resources []types.DIDResource
	// contains filtered or unexported fields
}

func (*EthereumAccount) Address

func (a *EthereumAccount) Address() string

Address returns the address of the account

func (*EthereumAccount) Info

func (a *EthereumAccount) Info() *crypto.AccountData

Info returns the account data

func (*EthereumAccount) Method

func (a *EthereumAccount) Method() types.DIDMethod

Method returns the DID method

func (*EthereumAccount) PublicKey

func (a *EthereumAccount) PublicKey() (*crypto.Secp256k1PubKey, error)

PublicKey returns the public key of the account

func (*EthereumAccount) Sign

func (a *EthereumAccount) Sign(msg []byte) ([]byte, error)

Sign signs a message with the account

func (*EthereumAccount) Type

func (a *EthereumAccount) Type() string

Type returns the type of the account

func (*EthereumAccount) Verify

func (a *EthereumAccount) Verify(msg []byte, sig []byte) (bool, error)

Verify verifies a signature

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL