Documentation ¶
Index ¶
- type ErrCode
- type NanoS
- func (n *NanoS) CalcTxnHash(txn types.Transaction, sigIndex uint16) (hash [32]byte, err error)
- func (n *NanoS) Exchange(cmd byte, p1, p2 byte, data []byte) (resp []byte, err error)
- func (n *NanoS) GetAddress(index uint32, displayPubKey bool) (addr types.UnlockHash, spk types.SiaPublicKey, err error)
- func (n *NanoS) GetVersion() (version string, err error)
- func (n *NanoS) SignHash(hash [32]byte, keyIndex uint32) (sig [64]byte, err error)
- func (n *NanoS) SignTxn(txn types.Transaction, sigIndex uint16, keyIndex uint32) (sig [64]byte, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrCode ¶
type ErrCode uint16
An ErrCode is returned by the various Sia app commands. The special code 0x9000 ("success") is converted to nil.
type NanoS ¶
type NanoS struct {
// contains filtered or unexported fields
}
NanoS represents a connected Nano S device.
func (*NanoS) CalcTxnHash ¶
CalcTxnHash executes the calcTxnHash command, prompting the user to review the supplied transaction. If approved, the sighash for the specified transaction signature is displayed on the screen and returned.
func (*NanoS) GetAddress ¶
func (n *NanoS) GetAddress(index uint32, displayPubKey bool) (addr types.UnlockHash, spk types.SiaPublicKey, err error)
GetAddress executes the getPublicKey command, prompting the user to approve the generation of the specified address and public key. If approved, the address (or public key) is displayed on the device and returned.
func (*NanoS) GetVersion ¶
GetVersion executes the getVersion command, returning the version of the Sia app running on the Nano S.
func (*NanoS) SignHash ¶
SignHash executes the signHash command, prompting the user to sign the supplied hash with the specified key. If approved, the signature is returned.
func (*NanoS) SignTxn ¶
func (n *NanoS) SignTxn(txn types.Transaction, sigIndex uint16, keyIndex uint32) (sig [64]byte, err error)
SignTxn executes the calcTxnHash command with the SignHash flag, prompting the user to review and sign the supplied transaction. If approved, the specified sighash is signed and returned.