Documentation ¶
Index ¶
- Variables
- type Keystore
- type Keystores
- func (keystores *Keystores) Add(keystore Keystore) error
- func (keystores *Keystores) Configuration(scriptType signing.ScriptType, absoluteKeypath signing.AbsoluteKeypath, ...) (*signing.Configuration, error)
- func (keystores *Keystores) Count() int
- func (keystores *Keystores) HaveSecureOutput(configuration *signing.Configuration, coin coin.Coin) (bool, error)
- func (keystores *Keystores) OutputAddress(configuration *signing.Configuration, coin coin.Coin) error
- func (keystores *Keystores) Remove(keystore Keystore) error
- func (keystores *Keystores) SignTransaction(proposedTransaction interface{}) error
Constants ¶
This section is empty.
Variables ¶
var ErrSigningAborted = errors.New("signing aborted by user")
ErrSigningAborted is used when the user aborts a signing in process (e.g. abort on HW wallet).
Functions ¶
This section is empty.
Types ¶
type Keystore ¶
type Keystore interface { // CosignerIndex returns the index at which the keystore signs in a multisig configuration. // The returned value is always zero for a singlesig configuration. CosignerIndex() int // HasSecureOutput returns whether the keystore supports to output an address securely. // This is typically done through a screen on the device or through a paired mobile phone. HasSecureOutput(*signing.Configuration, coin.Coin) (bool, error) // OutputAddress outputs the public key at the given configuration for the given coin. // Please note that this is only supported if the keystore has a secure output channel. OutputAddress(*signing.Configuration, coin.Coin) error // ExtendedPublicKey returns the extended public key at the given absolute keypath. ExtendedPublicKey(signing.AbsoluteKeypath) (*hdkeychain.ExtendedKey, error) // SignTransaction signs the given transaction proposal. Returns ErrSigningAborted if the user // aborts. SignTransaction(interface{}) error }
Keystore supports hardened key derivation according to BIP32 and signing of transactions.
type Keystores ¶
type Keystores struct {
// contains filtered or unexported fields
}
Keystores models a collection of keystores that can be passed to accounts to perform signing operations.
func NewKeystores ¶
NewKeystores returns a collection of the given keystores.
func (*Keystores) Configuration ¶
func (keystores *Keystores) Configuration( scriptType signing.ScriptType, absoluteKeypath signing.AbsoluteKeypath, signingThreshold int, ) (*signing.Configuration, error)
Configuration returns the configuration at the given path with the given signing threshold.
func (*Keystores) HaveSecureOutput ¶
func (keystores *Keystores) HaveSecureOutput( configuration *signing.Configuration, coin coin.Coin) (bool, error)
HaveSecureOutput returns whether any of the keystores has a secure output.
func (*Keystores) OutputAddress ¶
func (keystores *Keystores) OutputAddress( configuration *signing.Configuration, coin coin.Coin, ) error
OutputAddress outputs the address for the given coin with the given configuration on all keystores that have a secure output.
func (*Keystores) SignTransaction ¶
SignTransaction signs the given proposed transaction on all keystores. Returns ErrSigningAborted if the user aborts.