Documentation ¶
Index ¶
- Constants
- Variables
- func CheckAccountDisabled(account string) bool
- func CheckAccountFormat(account string) bool
- func CheckSign(pubaddress, message, signedAddress string) bool
- func FormatErrorResult(msg string) []byte
- func FormatResult(r interface{}) []byte
- func FormatSuccessResult(data interface{}) []byte
- func StrFirstToUpper(str string) string
- func TryGetDecimal(number string) decimal.Decimal
- type CTKResponse
Constants ¶
View Source
const ( ADDR_PREFIX = "0x" MIENRAL_KEY = ADDR_PREFIX + "0000000000000000000000000000000000000001" BLACK_KEY = ADDR_PREFIX + "0000000000000000000000000000000000000000" MINER_FEE_ACCOUNT = ADDR_PREFIX + "0000000000000000000000000000000000000002" TOKEN_TRANSFER_PREFIX = ADDR_PREFIX + "00000001" MORTG_PREFIX = ADDR_PREFIX + "00000002" CANDY_PREFIX = ADDR_PREFIX + "00000003" MORT_PREFIX = ADDR_PREFIX + "00000004" AGENT_PAY_PREFIX = ADDR_PREFIX + "00000005" TOKEN_CONFIG_PREFIX = "_config" DEFAULT_TOKEN = "ctk" CTK_MIN_FEE = 15 CTK_MAINTENANCE_FEE = 1 MORT_TOKEN = "1000000" NODE_ROLE_NORMAL = 1 NODE_ROLE_SUPER = 2 NODE_ROLE_POOL = 3 NODE_ROLE_SUPER_SUPER = 4 NODE_ROLE_USER = 0 TRANSACTION_TYPE_BUY_NODE = 5 TRANSACTION_TYPE_BUY_POOL = 6 TRANSACTION_TYPE_MORT_SUPER = 7 TRANSACTION_TYPE_RETURN_SUPER = 8 TRANSACTION_TYPE_BONUS_SUPER = 9 TRANSACTION_TYPE_BONUS_NORMAL = 10 TRANSACTION_TYPE_TRANSFER_TOKEN = 11 TRANSACTION_TRANSACTION_USDT_CTK = 12 TRANSACTION_TRANSACTION_PUBLISH_TOKEN = 13 TRANSACTION_TRANSACTION_NODE_MAINTENCE_FEE = 14 //DB PREFIX DB_ACCOUNT_INFO_PREFIX = "accounts_" DB_FREEZE_TOKEN_LOG = "token_freeze_" DB_POOL_ACCOUNTS = "pool_accounts" DB_SUPER_ACCOUNTS = "super_accounts" DB_NORMAL_ACCOUNTS = "normal_accounts" DB_BLOCK_REWARD_HISTORY = "db_block_reward1" DB_MORT_RECORD = "mort_supers" DB_17_SUPER_NODES = "17_supers" )
Variables ¶
View Source
var BlackAddrPres = map[string]interface{}{ TOKEN_TRANSFER_PREFIX: 1, MORTG_PREFIX: 1, CANDY_PREFIX: 1, MORT_PREFIX: 1, AGENT_PAY_PREFIX: 1, }
View Source
var BlackAddrs = map[string]interface{}{ MIENRAL_KEY: 1, BLACK_KEY: 1, MINER_FEE_ACCOUNT: 1, }
View Source
var StandardResponse = CTKResponse{200, "ok", map[string]interface{}{}}
Functions ¶
func TryGetDecimal ¶
====================standard response================ get decimal from string
Types ¶
type CTKResponse ¶
type CTKResponse struct { Code int `json:"code"` Msg string `json:"msg"` Data interface{} `json:"data"` }
====================standard response================
Click to show internal directories.
Click to hide internal directories.