forked from ygcool/go-hdwallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wallet_etc.go
47 lines (37 loc) · 695 Bytes
/
wallet_etc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package hdwallet
import (
"github.com/ethereum/go-ethereum/crypto"
)
func init() {
coins[ETC] = newETC
}
type etc struct {
name string
symbol string
key *Key
}
func newETC(key *Key) Wallet {
return &etc{
name: "Ethereum Classic",
symbol: "ETC",
key: key,
}
}
func (c *etc) GetType() uint32 {
return c.key.Opt.CoinType
}
func (c *etc) GetName() string {
return c.name
}
func (c *etc) GetSymbol() string {
return c.symbol
}
func (c *etc) GetKey() *Key {
return c.key
}
func (c *etc) GetAddress() (string, error) {
return crypto.PubkeyToAddress(*c.key.PublicECDSA).Hex(), nil
}
func (c *etc) GetPrivateKey() (string, error) {
return c.key.PrivateHex(), nil
}