accounts, core, internal, node: Add support for smartcard wallets

This commit is contained in:
Nick Johnson
2018-01-07 18:38:11 +00:00
committed by Guillaume Ballet
parent 3996bc1ad9
commit f7027dd68c
21 changed files with 5364 additions and 0 deletions

View File

@ -17,6 +17,7 @@
package accounts
import (
"encoding/json"
"errors"
"fmt"
"math"
@ -133,3 +134,17 @@ func (path DerivationPath) String() string {
}
return result
}
func (path DerivationPath) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("\"%s\"", path.String())), nil
}
func (dp *DerivationPath) UnmarshalJSON(b []byte) error {
var path string
var err error
if err = json.Unmarshal(b, &path); err != nil {
return err
}
*dp, err = ParseDerivationPath(path)
return err
}