common

package
v0.0.0-...-8dfe50c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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 CheckAccountDisabled

func CheckAccountDisabled(account string) bool

check account black

func CheckAccountFormat

func CheckAccountFormat(account string) bool

check account format

func CheckSign

func CheckSign(pubaddress, message, signedAddress string) bool

check sign

func FormatErrorResult

func FormatErrorResult(msg string) []byte

format error result

func FormatResult

func FormatResult(r interface{}) []byte

format shim result

func FormatSuccessResult

func FormatSuccessResult(data interface{}) []byte

format success result

func StrFirstToUpper

func StrFirstToUpper(str string) string

*

  • ios_bbbbbbbb -> IosBbbbbbbbb

func TryGetDecimal

func TryGetDecimal(number string) decimal.Decimal

====================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================

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL