accounts, core, internal, node: Add support for smartcard wallets
This commit is contained in:
committed by
Guillaume Ballet
parent
3996bc1ad9
commit
f7027dd68c
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user