-
Notifications
You must be signed in to change notification settings - Fork 7
/
constants.go
85 lines (68 loc) · 1.74 KB
/
constants.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package commons
import (
"errors"
"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcd/wire"
)
type WICCNet uint32
type WalletStatus int64
type ChangeType uint32
type Network int16
const (
// MainNet represents the main wicc network.
MainNet wire.BitcoinNet = 0xff421d1a
// TestNet represents the test wicc network.
TestNet wire.BitcoinNet = 0xfd7d5cd7
// Default entropy size for mnemonic
DefaultEntropySize = 128
// Default seed pass. it used to generate seed from mnemonic( BIP39 ). Don't change if determined
DefaultSeedPass = ""
HardenedKeyZeroIndex = 0x8001869f
BIP44Purpose uint32 = 0x8000002C
WICCCoinType uint32 = 99999
MAINNET Network = 1
TESTNET Network = 2
BIP44PATH = "m/44'/99999'/0'/0/0"
)
type MnemonicLanguage string
// List Mnemonic language support
const (
ENGLISH MnemonicLanguage = "EN"
JAPANESE = "JP"
FRENCH = "FR"
ITALIAN = "IT"
KOREAN = "KR"
SPANISH = "ES"
)
type CoinType string
const (
WICC CoinType = "WICC"
WGRT = "WGRT"
WUSD = "WUSD"
WCNY = "WCNY"
WBTC = "WBTC"
WETH = "WETH"
WEOS = "WEOS"
USD = "USD"
CNY = "CNY"
EUR = "EUR"
BTC = "BTC"
USDT = "USDT"
GOLD = "GOLD"
KWH = "KWH"
)
type AssetUpdateType int
const (
ASSET_OWNER_UID AssetUpdateType = 1
ASSET_NAME = 2
ASSET_MINT_AMOUNT = 3
)
func NetworkToChainConfig(net Network) (*chaincfg.Params, error) {
switch net {
case 1:
return &WaykiMainNetParams, nil
case 2:
return &WaykiTestNetParams, nil
}
return nil, errors.New("invalid network")
}