github.com/mavryk-network/mvgo@v1.19.9/signer/signer.go (about)

     1  // Copyright (c) 2020-2022 Blockwatch Data Inc.
     2  // Author: alex@blockwatch.cc
     3  
     4  package signer
     5  
     6  import (
     7  	"context"
     8  
     9  	"github.com/mavryk-network/mvgo/codec"
    10  	"github.com/mavryk-network/mvgo/mavryk"
    11  )
    12  
    13  type Signer interface {
    14  	// Return a list of addresses the signer manages.
    15  	ListAddresses(context.Context) ([]mavryk.Address, error)
    16  
    17  	// Returns the public key for a managed address. Required for reveal ops.
    18  	GetKey(context.Context, mavryk.Address) (mavryk.Key, error)
    19  
    20  	// Sign an arbitrary text message wrapped into a failing noop
    21  	SignMessage(context.Context, mavryk.Address, string) (mavryk.Signature, error)
    22  
    23  	// Sign an operation.
    24  	SignOperation(context.Context, mavryk.Address, *codec.Op) (mavryk.Signature, error)
    25  
    26  	// Sign a block header.
    27  	SignBlock(context.Context, mavryk.Address, *codec.BlockHeader) (mavryk.Signature, error)
    28  }