/
wallet.go
67 lines (50 loc) · 1.69 KB
/
wallet.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package wallet
import (
"github.com/coinexchain/polarbear/keybase"
)
var Api Wallet
type Wallet struct {
keybase.KeyBase
}
func BearInit(root string) {
Api.KeyBase = keybase.NewDefaultKeyBase(root)
}
func CreateKey(name, password, bip39Passphrase string, account, index uint32) string {
return Api.CreateKey(name, password, bip39Passphrase, account, index)
}
func DeleteKey(name, password string) string {
return Api.DeleteKey(name, password)
}
func RecoverKey(name, mnemonic, password, bip39Passphrase string, account, index uint32) string {
return Api.RecoverKey(name, mnemonic, password, bip39Passphrase, account, index)
}
func AddKey(name, armor, passphrase string) string {
return Api.AddKey(name, armor, passphrase)
}
func ExportKey(name, decryptPassphrase, encryptPassphrase string) string {
return Api.ExportKey(name, decryptPassphrase, encryptPassphrase)
}
func ListKeys() string {
return Api.ListKeys()
}
func ResetPassword(name, password, newPassword string) string {
return Api.ResetPassword(name, password, newPassword)
}
func GetAddress(name string) string {
return Api.GetAddress(name)
}
func GetPubKey(name string) string {
return Api.GetPubKey(name)
}
func GetSigner(signerInfo string) string {
return Api.GetSigner(signerInfo)
}
func Sign(name, password, tx string) string {
return Api.Sign(name, password, tx)
}
func SignStdTx(name, password, tx, chainId string, accountNum, sequence uint64) string {
return Api.SignStdTx(name, password, tx, chainId, accountNum, sequence)
}
func SignAndBuildBroadcast(name, password, tx, chainId, mode string, accountNum, sequence uint64) string {
return Api.SignAndBuildBroadcast(name, password, tx, chainId, mode, accountNum, sequence)
}