models

package
v0.0.0-...-7e9a881 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChainMax = "chain_max"
	MintMax  = "mint_max"
)
View Source
const (
	EcosystemCirculations      = "ecosystem-circulations-"
	TopTenHoldings             = "top-ten-holdings-"
	TopTenTxAccount            = "top-ten-tx-account"
	FifteenDaysActiveKeys      = "15-days-active-keys-"
	FifteenDaysStorageCapacity = "15-days-storage-capacity-"
	FifteenDaysGasFeeChart     = "15-days-gas-fee-"
	GasCombustionPieChart      = "gas-combustion-pie-"
	GasCombustionLineChart     = "gas-combustion-line-"
	FifteenDaysTxAmountChart   = "15-days-tx-amount-"
	FifteenDaysNewKeyChart     = "15-days-new-key-"
	FifteenTxCountChart        = "15-days-tx-count-"
)

redis key

View Source
const (
	ChannelDashboard = "dashboard"

	ChannelBlockTpsList         = "blockTpsList"
	ChannelBlockTransactionList = "blockTxList"
	ChannelBlockList            = "blockList"
	ChannelStatistical          = "statistical"
	ChannelNodeNewest           = "nodeNewest"
	ChannelNodePkgRate          = "nodePkgRate"
	ChannelNodeMap              = "nodeMap"
)
View Source
const (
	// VERSION is current version
	VERSION = "1.0.0"

	// ApiPath is the beginning of the api url
	ApiPath = `/api/v2/`

	SysTokenSymbol   = "IBXC"
	SysEcosystemName = "platform ecosystem"
	UtxoTx           = "UTXO_Tx"
	UtxoTransferSelf = "UTXO_Transfer_Self"
	UtxoBurning      = "UTXO_Burning"

	BlackHoleAddr = "0000-0000-0000-0000-0000"

	AccountUTXO = "Account-UTXO"
	UTXOAccount = "UTXO-Account"
)
View Source
const (
	//history
	FifteenDaysGasFee          = "15_days_gas_fee_chart"
	FifteenDaysNewCirculations = "15_days_new_circulations_chart"
	FifteenDaysBlockSize       = "15_days_block_size_chart"
	FifteenDaysBlockNumber     = "15_days_block_number_chart"
	NewNfTMinerChange          = "new_nft_miner_change_chart"
	NftMinerRewardChange       = "nft_miner_reward_change_chart"
	TopTenEcosystemTx          = "top_ten_ecosystem_tx_chart"
	NodeVoteChange             = "node_vote_change_chart"
	NodeStakingChange          = "node_staking_change_chart"
	NewEcosystemChange         = "new_ecosystem_change_chart"

	//realTime
	NewKey           = "new_key_chart"
	AccountChange    = "account_change_chart"
	NftMinerInterval = "nft_miner_interval_chart"
	NodeRegion       = "node_region_chart"
)
View Source
const (
	FeesType       = "fees"
	TaxesType      = "taxes"
	StartUpType    = "startUp"
	CombustionType = "combustion"
)
View Source
const (
	IndexBTree  = "btree"
	IndexHash   = "Hash"
	IndexGiST   = "GiST"
	IndexGIN    = "gin"
	IndexSPGiST = "SP-GiST"
	IndexBRIN   = "BRIN"
)
View Source
const AccountDetailSQL = `` /* 14498-byte string literal not displayed */
View Source
const AssignTotalSupply = publicRoundSupply + devTempSupply + foundationSupply + partnersSupply + privateRound1 + privateRound2
View Source
const BinaryTableSuffix = "_binaries"
View Source
const CreateAccountDetailTable = `` /* 979-byte string literal not displayed */
View Source
const DaoVoteChart = "dao_vote_chart"
View Source
const (
	// According to Wikipedia, the Earth's radius is about 6,371km
	EARTH_RADIUS = 6371
)
View Source
const MintNodeTotalSupply = 630000000
View Source
const NftMinerTotalSupply = 393750000
View Source
const StartUpSupply = consts.FounderAmount
View Source
const SvgTimeFormat = "15:04:05 02-01-2006 (UTC)"

Variables

View Source
var (
	AirdropReady bool
	//total amount: is not now amount
	AirdropLockAll decimal.Decimal
)
View Source
var (
	AssignReady bool

	AssignTotalBalance     decimal.Decimal
	AssignTotalSupplyToken decimal.Decimal
)
View Source
var (
	MintNodeReady bool

	MintNodeTotalBalance     decimal.Decimal
	MintNodeTotalSupplyToken decimal.Decimal
)
View Source
var (
	NftMinerReady            bool
	NftMinerTotalSupplyToken decimal.Decimal
	NftMinerTotalBalance     decimal.Decimal
)
View Source
var (
	ScanOutStPrefix = "scan-out-"
	Latest          = "latest"
	GetScanOut      chan bool
)
View Source
var BridgeReady bool
View Source
var BuildInfo string
View Source
var ChartWG = &sync.WaitGroup{}
View Source
var FirstBlockTime int64
View Source
var (
	GLogTranHash map[string]int64
)
View Source
var (
	GNodeStatusTranHash map[string]TransactionStatus
)
View Source
var (
	GStatusTranHash map[string]TransactionStatus
)
View Source
var HistoryWG = &sync.WaitGroup{}
View Source
var (
	HonorNodes []storage.HonorNodeModel
)
View Source
var INameReady bool
View Source
var MaxBlockId int64
View Source
var NodeReady bool
View Source
var PledgeAmount int64 = 1e18
View Source
var RealtimeWG = &sync.WaitGroup{}
View Source
var (
	RefreshRequest chan RefreshObject
)
View Source
var SendWebsocketData chan bool
View Source
var SendWebsocketSignal chan bool
View Source
var TotalSupplyToken decimal.Decimal
View Source
var UploadDir = "./upload/"
View Source
var VotingReady bool

Functions

func AccountDetailTableExist

func AccountDetailTableExist() bool

func AirdropTableExist

func AirdropTableExist() bool

func AssignTableExist

func AssignTableExist() bool

func BridgeTableExist

func BridgeTableExist() bool

func CandidateTableExist

func CandidateTableExist() bool

func CheckSql

func CheckSql(query string) bool

func CompareHash

func CompareHash(data []byte, urlHash string) bool

func CreateIndexMain

func CreateIndexMain() error

CreateIndexMain Indexes cannot be added to the ecological table, which will cause synchronization failure

func DataChartHistoryServer

func DataChartHistoryServer()

func DataChartRealtimeSever

func DataChartRealtimeSever()

func DbconnbatchupdateSqlite

func DbconnbatchupdateSqlite(objarr *[]TransactionStatus) error

func DbconndealReduplictionTransactionstatus

func DbconndealReduplictionTransactionstatus(objArr *[]TransactionStatus) (*[]TransactionStatus, *[]TransactionStatus)

func DealRedisBlockTpsList

func DealRedisBlockTpsList() error

func Deal_LogTransactionBlockTxDetial

func Deal_LogTransactionBlockTxDetial(objArr *[]LogTransaction) (*[]BlockTxDetailedInfo, error)

func Deal_Redupliction_LogTransaction

func Deal_Redupliction_LogTransaction(objArr *[]LogTransaction) *[]LogTransaction

func Deal_Redupliction_Transactionstatus

func Deal_Redupliction_Transactionstatus(objArr *[]TransactionStatus) (*[]TransactionStatus, *[]TransactionStatus)

func FilteredSQLInject

func FilteredSQLInject(to_match_str string) bool

func FindNodeLocatedSave

func FindNodeLocatedSave(list []NodeValue) (err error)

func FormatIndexMethod

func FormatIndexMethod(method int) string

func GeoIpClose

func GeoIpClose()

func GeoIpDatabaseInit

func GeoIpDatabaseInit() error

func Get15DayBlockDiffChartDataToRedis

func Get15DayBlockDiffChartDataToRedis()

func GetALL

func GetALL(tableName string, order string, v any) error

func GetALLNodeTransactionList

func GetALLNodeTransactionList() error

func GetActiveEcoLibs

func GetActiveEcoLibs() (string, error)

func GetActiveEcoLibsFromRedis

func GetActiveEcoLibsFromRedis() (string, error)

func GetActiveEcoLibsToRedis

func GetActiveEcoLibsToRedis()

func GetAirdropLockAllTotal

func GetAirdropLockAllTotal()

func GetAllEcosystemInfo

func GetAllEcosystemInfo()

func GetAllKeysTotalAmount

func GetAllKeysTotalAmount(ecosystem int64) error

func GetAmount

func GetAmount(dayTime int64, list []DaysAmount) decimal.Decimal

func GetAppValue

func GetAppValue(appId int64, name string, ecosystem int64) (string, error)

func GetAssignTotalBalanceAmount

func GetAssignTotalBalanceAmount()

func GetBlockData

func GetBlockData(startId int64, endId int64, order string) (*[]Block, error)

GetBlockData is retrieving chain of blocks from database

func GetBlockInfoToRedis

func GetBlockInfoToRedis(limit int) error

func GetBlockTpsListsFromRedis

func GetBlockTpsListsFromRedis() (*[]ScanOutBlockTransactionRet, error)

func GetBlocksContractNameList

func GetBlocksContractNameList(bk *Block) (map[string]string, error)

func GetBlocksTransactionListByBlockInfo

func GetBlocksTransactionListByBlockInfo(mc *Block) (*[]TxDetailedInfoResponse, error)

func GetCirculations

func GetCirculations(ecosystem int64) (string, error)

func GetContractCodeByName

func GetContractCodeByName(contractName string) string

func GetDB

func GetDB(db *DbTransaction) *gorm.DB

GetDB is returning gorm.DB

func GetDBDayTraninfo

func GetDBDayTraninfo(day int) (*[]DBTransactionsInfo, error)

func GetDBDealTraninfo

func GetDBDealTraninfo(limit int) error

func GetDashboardChartDataToRedis

func GetDashboardChartDataToRedis()

func GetDataChart

func GetDataChart(date any, err error) string

func GetDateDiffFromNow

func GetDateDiffFromNow(layout string, findTime string, offset int) int64

func GetDayNumberFormat

func GetDayNumberFormat(days int64) (string, string)

func GetDayblockinfoFromRedis

func GetDayblockinfoFromRedis(t1, t2 int64, transBlock []Block) (int32, error)

func GetDaysAmount

func GetDaysAmount(dayTime int64, list []DaysAmount) string

func GetDaysAmountEqual

func GetDaysAmountEqual(findTime int64, list []DaysAmount, layout string, areEqual bool) decimal.Decimal

func GetDaysNumber

func GetDaysNumber(getTime int64, list []DaysNumber) int64

func GetDaysNumberLike

func GetDaysNumberLike(getTime int64, list []DaysNumber, getTimeFront bool, order string) int64

func GetEcoLibsChartDataToRedis

func GetEcoLibsChartDataToRedis()

func GetEcoLibsTxChartDataToRedis

func GetEcoLibsTxChartDataToRedis()

func GetEcosystemLogoHash

func GetEcosystemLogoHash(ecosystem int64) (string, string)

func GetFileHash

func GetFileHash(id int64) (string, error)

func GetFileNameByHash

func GetFileNameByHash(hash string) (string, int64, error)

func GetFirstDateOfMonth

func GetFirstDateOfMonth(z int, d time.Time) time.Time

func GetFuelRate

func GetFuelRate() (rlt map[int64]decimal.Decimal)

func GetHistoryEcosystemChartInfo

func GetHistoryEcosystemChartInfo()

func GetHonorListToRedis

func GetHonorListToRedis(cmd string)

func GetHonorNodeInfo

func GetHonorNodeInfo() []storage.HonorNodeModel

func GetHonorNodeMapToRedis

func GetHonorNodeMapToRedis()

func GetLastDateOfMonthToInt64

func GetLastDateOfMonthToInt64(z int, t int64) int64

func GetMaxBlockSizeToRedis

func GetMaxBlockSizeToRedis()

func GetMaxTxToRedis

func GetMaxTxToRedis()

func GetMineIncomeParam

func GetMineIncomeParam(hash []byte) string

func GetMineParam

func GetMineParam(ecosystem int64, name string, param map[string]any, TxHash []byte) (string, string)

func GetMintNodeTotalBalance

func GetMintNodeTotalBalance()

func GetNftMinerMap

func GetNftMinerMap() (*[]Positioning, error)

func GetNftMinerTotalBalance

func GetNftMinerTotalBalance()

func GetNftMinerTotalSupply

func GetNftMinerTotalSupply()

func GetNodeBlockReplyRate

func GetNodeBlockReplyRate(bk *Block) (string, error)

func GetNodeListInfo

func GetNodeListInfo(list []NodeValue, consensusMode int32) (err error)

func GetNodeTransactionList

func GetNodeTransactionList(limit, page int) (*[]TransactionList, int64, error)

func GetNowTimeUnix

func GetNowTimeUnix() int64

func GetQueueTransactionsCount

func GetQueueTransactionsCount(reqUrl string) (int64, error)

GetQueueTransactions get queue transactions from node

func GetRdDb

func GetRdDb() *redis.Client

func GetRedis

func GetRedis(name string) (any, error)

func GetRedisByName

func GetRedisByName(name string) (any, error)

func GetScanOutDataToRedis

func GetScanOutDataToRedis() error

func GetScanOutKeyInfoToRedis

func GetScanOutKeyInfoToRedis()

func GetSingleDayMaxTxToRedis

func GetSingleDayMaxTxToRedis()

func GetStatisticsSignal

func GetStatisticsSignal()

func GetTransactionBlockFromRedis

func GetTransactionBlockFromRedis() (*[]BlockTxDetailedInfoHex, int64, error)

func GetTransactionBlockToRedis

func GetTransactionBlockToRedis() error

func GetTransactionsStatus

func GetTransactionsStatus(reqUrl string, t1 int64, page, limit int) (*[]TransactionStatus, error)

GetTransactionsStatus get transactions status from node

func GetTxInfoFromRedis

func GetTxInfoFromRedis(limit int) (*[]ScanOutBlockTransactionRet, error)

func GetUtxoTxContractNameByHash

func GetUtxoTxContractNameByHash(hash []byte) string

func GetWeekAverageValueTxToRedis

func GetWeekAverageValueTxToRedis()

func GetZeroTime

func GetZeroTime(d time.Time) time.Time

func Get_Group_TransactionBlock

func Get_Group_TransactionBlock(ids int, icount int, order string, reqType int) (*[]BlockTxDetailedInfoHex, int64, error)

func GormClose

func GormClose() error

GormClose is closing Gorm connection

func GzipDecode

func GzipDecode(in []byte) ([]byte, error)

func GzipEncode

func GzipEncode(in []byte) ([]byte, error)

func HasTable

func HasTable(p any) bool

HasTable p is struct Pointer

func HasTableOrView

func HasTableOrView(names string) bool

func INameTableExist

func INameTableExist() bool

func InitBuildInfo

func InitBuildInfo()

go build -ldflags "-X 'github.com/IBAX-io/go-explorer/models.buildBranch=main' -X 'github.com/IBAX-io/go-explorer/models.buildDate=2022-06-17' -X 'github.com/IBAX-io/go-explorer/models.commitHash=2141saf'"

func InitCountryLocator

func InitCountryLocator() error

func InitDBTrigger

func InitDBTrigger() (err error)

func InitDailyActiveReport

func InitDailyActiveReport() error

func InitDashboardTx

func InitDashboardTx() error

func InitDatabase

func InitDatabase() error

func InitEcosystemInfo

func InitEcosystemInfo()

func InitFristBlockTime

func InitFristBlockTime() error

func InitGlobalSwitch

func InitGlobalSwitch()

func InitHonorNodeByRedis

func InitHonorNodeByRedis(cmd string)

func InitPledgeAmount

func InitPledgeAmount()

func InitRedisDb

func InitRedisDb() error

func InitRedisDbAll

func InitRedisDbAll() error

func InitSpentInfoHistory

func InitSpentInfoHistory() error

func InitTransactionData

func InitTransactionData() error

func InitTransactionRelation

func InitTransactionRelation() error

func InsertDailyActiveReport

func InsertDailyActiveReport()

func InsertDailyNodeReport

func InsertDailyNodeReport()

func InsertHonorNodeInfo

func InsertHonorNodeInfo()

func InsertRedis

func InsertRedis(name string, data string)

func IsBridgeEcosystem

func IsBridgeEcosystem(ecosystem int64) bool

func IsExist

func IsExist(f string) bool

func IsUtxoTransaction

func IsUtxoTransaction(txData []byte, block int64) (bool, error)

func LoadFile

func LoadFile(id int64) (string, error)

func MsToSeconds

func MsToSeconds(millisecond int64) int64

MsToSeconds millisecond to second

func MsgpackMarshal

func MsgpackMarshal(v any) ([]byte, error)

func MsgpackUnmarshal

func MsgpackUnmarshal(bt []byte, v any) error

func NanoToMs

func NanoToMs(nano int64) int64

func NanoToSeconds

func NanoToSeconds(nano int64) int64

func NftMinerTableIsExist

func NftMinerTableIsExist() bool

func ParseIndexMethod

func ParseIndexMethod(method string) int

func PointValid

func PointValid(latitude, longitude float64) bool

func RdExist

func RdExist(key string) (bool, error)

func RdExists

func RdExists(keys ...string) (bool, error)

RdExists all key exists return true else return false

func RdRange

func RdRange(key string, start, end int64) (string, error)

RdRange intercept string[start:end] if key not exist return ""

func RefreshChartDaemons

func RefreshChartDaemons(key string, ecosystem int64)

func Savefile

func Savefile(file string, buf []byte) error

func SendAllWebsocketData

func SendAllWebsocketData()

func SendBlockList

func SendBlockList(data *[]BlockListResponse) error

func SendBlockListToWebsocket

func SendBlockListToWebsocket(ret1 *[]BlockListResponse) error

func SendDashboardDataToWebsocket

func SendDashboardDataToWebsocket(data any, cmd string) error

func SendRefreshRequest

func SendRefreshRequest(key string, ecosystem int64)

func SendTopTransactiontps

func SendTopTransactiontps(topBlockTps *[]ScanOutBlockTransactionRet) error

func SendTpsListToWebsocket

func SendTpsListToWebsocket(ret *[]ScanOutBlockTransactionRet) error

func SendTransactionList

func SendTransactionList(txList *[]BlockTxDetailedInfoHex) error

func SendTransactionListToWebsocket

func SendTransactionListToWebsocket(ret *[]BlockTxDetailedInfoHex) error

func SendTxDataSyncSignal

func SendTxDataSyncSignal()

func SendTxRelationSignal

func SendTxRelationSignal()

func SendUtxoTxSyncSignal

func SendUtxoTxSyncSignal()

func StUpdate_Sqlite

func StUpdate_Sqlite(objarr *[]TransactionStatus) error

func StrReplaceAllString

func StrReplaceAllString(s2 string) (strReplace StrReplaceStruct, indexList []StrReplaceStruct)

func SyncBlockListToRedis

func SyncBlockListToRedis()

func SyncEcosystemInfo

func SyncEcosystemInfo()

func SyncNationalFlagIcon

func SyncNationalFlagIcon()

func ToCapacityKb

func ToCapacityKb(count int64) string

func ToCapacityMb

func ToCapacityMb(count int64) string

func ToCapacityString

func ToCapacityString(count int64) string

func TxDataSyncSignalReceive

func TxDataSyncSignalReceive()

func TxRelationCheck

func TxRelationCheck(lastBlockId int64)

func UnmarshallBlockTxData

func UnmarshallBlockTxData(blockBuffer *bytes.Buffer, blockId int64) (map[string]TransactionData, error)

func UnmarshallTransaction

func UnmarshallTransaction(blockBuffer *bytes.Buffer) (*transaction.Transaction, error)

func UpdateAccountDetail

func UpdateAccountDetail()

func UpdateHonorNodeInfo

func UpdateHonorNodeInfo()

func Version

func Version() string

func VotingTableExist

func VotingTableExist() bool

func WhereBuild

func WhereBuild(where map[string]any) (whereSQL string, vals []any, err error)

sql build where

func WriteChannelByte

func WriteChannelByte(channel string, data []byte) error

Types

type AccountAmountChangeBarChart

type AccountAmountChangeBarChart struct {
	TokenSymbol string   `json:"token_symbol"`
	Name        string   `json:"name"`
	Time        []int64  `json:"time"`
	Outcome     []string `json:"outcome"`
	Income      []string `json:"income"`
	Balance     []string `json:"balance"`
	Digits      int64    `json:"digits"`
}

func GetAccountTokenChangeChart

func GetAccountTokenChangeChart(ecosystem, keyId int64, findTime int64) (AccountAmountChangeBarChart, error)

GetAccountTokenChangeChart findTime: 0:Get All order:Find Start TIME

func GetAmountChangeBarChart

func GetAmountChangeBarChart(ecosystem int64, account string, isDefault int) (AccountAmountChangeBarChart, error)

type AccountAmountChangePieChart

type AccountAmountChangePieChart struct {
	Outcome     decimal.Decimal `json:"outcome" gorm:"column:outcome"`
	Income      decimal.Decimal `json:"income" gorm:"column:income"`
	TokenSymbol string          `json:"token_symbol" gorm:"column:token_symbol"`
	Digits      int64           `json:"digits"`
}

func GetAmountChangePieChart

func GetAmountChangePieChart(ecosystem int64, account string, stTime, edTime int64) (AccountAmountChangePieChart, error)

type AccountChangeChartResponse

type AccountChangeChartResponse struct {
	NowTotal        int64             `json:"now_total"`
	MaxAccountedFor decimal.Decimal   `json:"max_accounted_for"`
	MaxTime         int64             `json:"max_time"`
	MinAccountedFor decimal.Decimal   `json:"min_accounted_for"`
	MinTime         int64             `json:"min_time"`
	Time            []int64           `json:"time"`
	Total           []int64           `json:"total"`
	HasToken        []int64           `json:"has_token"`
	AccountedFor    []decimal.Decimal `json:"accounted_for"`
}

func GetAccountChangeChart

func GetAccountChangeChart() (AccountChangeChartResponse, error)

type AccountDetail

type AccountDetail struct {
	ID          int64           `gorm:"primary_key;not null"`
	Account     string          `gorm:"not null"`
	Ecosystem   int64           `gorm:"primary_key;not null"`
	JoinTime    int64           `gorm:"not null"`
	LogoHash    string          `gorm:"not null"` //ecosystem logo hash
	Amount      decimal.Decimal `gorm:"not null"`
	StakeAmount decimal.Decimal `gorm:"not null"` //Contains nft_miner_stake AND candidate_referendum AND candidate_substitute
	OutputValue decimal.Decimal `gorm:"not null"`
	TotalAmount decimal.Decimal `gorm:"not null"` //Contains Amount+OutputValue+StakeAmount
}

func (*AccountDetail) TableName

func (a *AccountDetail) TableName() string

TableName returns name of table

type AccountHistoryChart

type AccountHistoryChart struct {
	Time        []int64  `json:"time"`
	Inamount    []string `json:"inamount"`
	Outamount   []string `json:"outamount"`
	TokenSymbol string   `json:"token_symbol"`
	Digits      int64    `json:"digits"`
}

func GetWalletTokenChangeBasis

func GetWalletTokenChangeBasis(account string) (*AccountHistoryChart, error)

type AccountNftMinerList

type AccountNftMinerList struct {
	ID          int64           `json:"id"`
	EnergyPoint int             `json:"energy_point"`
	Hash        string          `json:"hash"` //hash
	Time        int64           `json:"time"` //create time
	StakeAmount decimal.Decimal `json:"stake_amount"`
	Cycle       int64           `json:"cycle"`
	Ins         string          `json:"ins"`
}

type AccountNftMinerListResult

type AccountNftMinerListResult struct {
	TotalResult
	Page  int                   `json:"page"`
	Limit int                   `json:"limit"`
	Rets  []AccountNftMinerList `json:"rets"`
}

type AccountTotalAmountChart

type AccountTotalAmountChart struct {
	TotalAmount      decimal.Decimal `json:"total_amount"`
	Amount           decimal.Decimal `json:"amount" gorm:"column:amount"`
	AmountRatio      float64         `json:"amount_ratio"`
	StakeAmount      decimal.Decimal `json:"stake_amount" gorm:"column:stake_amount"`
	StakeAmountRatio float64         `json:"stake_amount_ratio"`
	LockAmount       decimal.Decimal `json:"lock_amount"`
	LockRatio        float64         `json:"lock_ratio"`
	TokenSymbol      string          `json:"token_symbol"`
	Digits           int64           `json:"digits"`
}

func GetAccountTotalAmount

func GetAccountTotalAmount(ecosystem int64, account string) (AccountTotalAmountChart, error)

type AccountTxChart

type AccountTxChart struct {
	Time []int64 `json:"time"`
	Tx   []int64 `json:"tx"`
}

func GetAccountTxChart

func GetAccountTxChart(ecosystem int64, account string) (AccountTxChart, error)

type AccountTxInfoResponse

type AccountTxInfoResponse struct {
	Total int64 `json:"total"`
	InTx  int64 `json:"in_tx"`
	OutTx int64 `json:"out_tx"`
}

func GetAccountTxCount

func GetAccountTxCount(ecosystem int64, account string) (*AccountTxInfoResponse, error)

type AccountTxListResponse

type AccountTxListResponse struct {
	Hash          string `json:"hash"`
	BlockId       int64  `json:"block_id"`
	ContractName  string `json:"contract_name"`
	Timestamp     int64  `json:"timestamp"`
	Address       string `json:"address"`
	Status        int32  `json:"status"`
	EcosystemName string `json:"ecosystem_name"`
	Ecosystem     int64  `json:"ecosystem"`
}

type ActiveReportInfo

type ActiveReportInfo struct {
	Time          int64  `gorm:"column:time;not null"`
	ActiveAccount int64  `gorm:"column:active;not null"`
	Ratio         string `gorm:"column:ratio;type:varchar(30);not null"`
	RelativeRatio string `gorm:"column:relative_ratio;type:varchar(30);not null"`
	TxNumber      int64  `gorm:"column:tx_number;not null"`
	TxAmount      string `gorm:"column:tx_amount;type:decimal(30);not null"`
}

type AirdropInfo

type AirdropInfo struct {
	Id            int64 `gorm:"primary_key;not_null"`
	Account       string
	BalanceAmount decimal.Decimal
	DateCreated   int64
	Detail        string `gorm:"type:jsonb"`
	DirectAmount  decimal.Decimal
	LatestAt      int64
	LockAmount    decimal.Decimal
	PeriodCount   int64
	Priority      int64
	StakeAmount   decimal.Decimal
	Surplus       int64
	TotalAmount   decimal.Decimal
}

func (*AirdropInfo) Get

func (p *AirdropInfo) Get(account string) (bool, error)

func (*AirdropInfo) GetStaking

func (p *AirdropInfo) GetStaking(account string) decimal.Decimal

func (AirdropInfo) TableName

func (p AirdropInfo) TableName() string

type AppInfo

type AppInfo struct {
	Contracts ContractsParams `json:"contracts"`
	Page      PageParams      `json:"page"`
	Snippets  SnippetsParams  `json:"snippets"`
	Table     TableParams     `json:"table"`
	Params    AppParams       `json:"params"`
	Menu      MenuParams      `json:"menu"`
	Languages LanguagesParams `json:"languages"`
}

type AppParam

type AppParam struct {
	ID         int64  `gorm:"primary_key;not null"`
	AppID      int64  `gorm:"not null"`
	Name       string `gorm:"not null;size:100"`
	Value      string `gorm:"not null"`
	Conditions string `gorm:"not null"`
	// contains filtered or unexported fields
}

AppParam is model

func (*AppParam) GetById

func (sp *AppParam) GetById(transaction *DbTransaction, id int64) (bool, error)

GetById is retrieving model from database

func (*AppParam) GetByName

func (sp *AppParam) GetByName(ecosystem int64, name string) (bool, error)

func (*AppParam) TableName

func (sp *AppParam) TableName() string

TableName returns name of table

type AppParams

type AppParams struct {
	Id         int64  `json:"id,omitempty"`
	Type       string `json:"Type"`
	Name       string `json:"Name"`
	Conditions string `json:"Conditions"`
	Value      string `json:"Value"`
}

type Applications

type Applications struct {
	ID         int64  `gorm:"primary_key;not null"`
	Name       string `gorm:"column:name;type:varchar(255);not null"`
	Conditions string `gorm:"column:conditions;not null"`
	Deleted    int64  `gorm:"column:deleted;not null"` //1:deleted
	Ecosystem  int64  `gorm:"column:ecosystem;not null"`
}

func (*Applications) FindApp

func (p *Applications) FindApp(page, limit int, order, where string) (*[]Applications, int64, error)

func (*Applications) GetById

func (p *Applications) GetById(appid int64) (bool, error)

func (*Applications) GetByName

func (p *Applications) GetByName(name string, ecosystem int64) (bool, error)

func (Applications) TableName

func (p Applications) TableName() string

type AssignInfo

type AssignInfo struct {
	ID            int64           `gorm:"primary_key;not null"`
	Type          int64           `gorm:"not null"`
	Account       string          `gorm:"not null"`
	TotalAmount   decimal.Decimal `gorm:"not null"`
	BalanceAmount decimal.Decimal `gorm:"not null"`
	Detail        string          `gorm:"not null;type:jsonb"`
	Deleted       int64           `gorm:"not null"`
	DateDeleted   int64           `gorm:"not null"`
	DateUpdated   int64           `gorm:"not null"`
	DateCreated   int64           `gorm:"not null"`
}

AssignInfo is model

func (*AssignInfo) GetBalance

func (m *AssignInfo) GetBalance(db *DbTransaction, account string) (decimal.Decimal, error)

func (*AssignInfo) GetTotalBalance

func (m *AssignInfo) GetTotalBalance(dbTx *DbTransaction, account string) (decimal.Decimal, decimal.Decimal, error)

GetTotalBalance is retrieving model from database

func (AssignInfo) TableName

func (m AssignInfo) TableName() string

TableName returns name of table

type AssignRules

type AssignRules struct {
	StartBlockID    int64  `json:"start_blockid"`
	EndBlockID      int64  `json:"end_blockid"`
	IntervalBlockID int64  `json:"interval_blockid"`
	Count           int64  `json:"count"`
	TotalAmount     string `json:"total_amount"`
}

type BasisEcosystemChartDataResponse

type BasisEcosystemChartDataResponse struct {
	KeyInfo KeyChangeChart `json:"key_info"`
	TxInfo  TxChangeChart  `json:"tx_info"`
}

type BasisEcosystemResponse

type BasisEcosystemResponse struct {
	ID       int64          `json:"id"`
	Name     string         `json:"name"`
	LogoHash string         `json:"logo_hash"`
	KeyCount int64          `json:"key_count"`
	TotalTx  int64          `json:"total_tx"`
	KeyInfo  KeyChangeChart `json:"key_info"`
	TxInfo   TxChangeChart  `json:"tx_info"`
}

func GetEcoLibsChartData

func GetEcoLibsChartData() (*BasisEcosystemResponse, error)

type Binary

type Binary struct {
	Ecosystem int64
	ID        int64
	AppId     int64
	Name      string
	Data      []byte
	Hash      string
	MimeType  string
	Account   string
}

Binary represents record of {prefix}_binaries table

func (*Binary) FindAppNameByEcosystem

func (b *Binary) FindAppNameByEcosystem(page, limit int, order string, ecosystem int64, where map[string]any) (GeneralResponse, error)

func (*Binary) GetByHash

func (b *Binary) GetByHash(hash string) (bool, error)

func (*Binary) GetByID

func (b *Binary) GetByID(id int64) (bool, error)

GetByID is retrieving model from db by id

func (*Binary) GetByIdHash

func (b *Binary) GetByIdHash(id int64) (bool, error)

func (*Binary) GetByJpeg

func (b *Binary) GetByJpeg() string

func (*Binary) GetByPng

func (b *Binary) GetByPng(d *Binary) (bool, error)

func (*Binary) SetTableName

func (b *Binary) SetTableName(tableName string)

SetTableName sets name of table

func (*Binary) SetTablePrefix

func (b *Binary) SetTablePrefix(prefix string)

SetTablePrefix is setting table prefix

func (*Binary) TableName

func (b *Binary) TableName() string

TableName returns name of table

type Block

type Block struct {
	ID             int64  `gorm:"primary_key;not_null"`
	Hash           []byte `gorm:"not null"`
	RollbacksHash  []byte `gorm:"not null"`
	Data           []byte `gorm:"not null"`
	EcosystemID    int64  `gorm:"not null"`
	KeyID          int64  `gorm:"not null"`
	NodePosition   int64  `gorm:"not null"`
	Time           int64  `gorm:"not null"`
	Tx             int32  `gorm:"not null"`
	ConsensusMode  int32  `gorm:"not null"`
	CandidateNodes []byte `gorm:"not null"`
}

Block is model

func (*Block) GetBlockTotal

func (b *Block) GetBlockTotal() (int64, error)

func (*Block) GetBlocksByHash

func (b *Block) GetBlocksByHash(hash []byte) (bool, error)

func (*Block) GetBlocksFrom

func (b *Block) GetBlocksFrom(page, limit int, ordering string) ([]Block, error)

GetBlocksFrom is retrieving ordered chain of blocks from database

func (*Block) GetBlocksHash

func (b *Block) GetBlocksHash(hash []byte) (bool, error)

GetNodeBlocksAtTime returns records of blocks for time interval and position of node

func (*Block) GetBlocksKey

func (b *Block) GetBlocksKey(key int64, order string) ([]Block, error)

func (*Block) GetByTimeBlockId

func (b *Block) GetByTimeBlockId(dbTx *DbTransaction, time int64) (bool, error)

func (*Block) GetId

func (b *Block) GetId(blockID int64) (bool, error)

func (*Block) GetLatestNodes

func (bk *Block) GetLatestNodes(limit int) ([]Block, error)

func (*Block) GetMaxBlock

func (b *Block) GetMaxBlock() (bool, error)

GetMaxBlock returns last block existence

func (*Block) GetNodeBlocksAtTime

func (b *Block) GetNodeBlocksAtTime(from, to time.Time, node int64) ([]Block, error)

GetNodeBlocksAtTime returns records of blocks for time interval and position of node

func (*Block) GetRedisByhash

func (b *Block) GetRedisByhash(hash []byte) (bool, error)

func (*Block) GetRedisByid

func (b *Block) GetRedisByid(id int64) (bool, error)

func (*Block) GetReverseBlockchain

func (b *Block) GetReverseBlockchain(endBlockID int64, limit int) ([]Block, error)

GetReverseBlockchain returns records of blocks in reverse ordering

func (*Block) GetSystemTime

func (b *Block) GetSystemTime() (int64, error)

GetSystemTime is retrieving model from database

func (*Block) InsertRedis

func (b *Block) InsertRedis() error

func (*Block) Marshal

func (b *Block) Marshal() ([]byte, error)

func (Block) TableName

func (Block) TableName() string

TableName returns name of table

func (*Block) Unmarshal

func (b *Block) Unmarshal(bt []byte) error

type BlockCCPriceInfo

type BlockCCPriceInfo struct {
	Code    int              `json:"code"`
	Message string           `json:"message"`
	Data    []map[string]any `json:"data"`
}

type BlockCCRatesInfo

type BlockCCRatesInfo struct {
	Code    int       `json:"code"`
	Message string    `json:"message"`
	Data    RatesInfo `json:"data"`
}

type BlockDetailedInfo

type BlockDetailedInfo struct {
	Header        BlockHeaderInfo  `json:"header"`
	Hash          []byte           `json:"hash"`
	EcosystemID   int64            `json:"ecosystem_id"`
	NodePosition  int64            `json:"node_position"`
	KeyID         int64            `json:"key_id"`
	Time          int64            `json:"time"`
	Tx            int32            `json:"tx_count"`
	RollbacksHash []byte           `json:"rollbacks_hash"`
	MrklRoot      []byte           `json:"mrkl_root"`
	BinData       []byte           `json:"bin_data"`
	SysUpdate     bool             `json:"sys_update"`
	GenBlock      bool             `json:"gen_block"`
	StopCount     int              `json:"stop_count"`
	Transactions  []TxDetailedInfo `json:"transactions"`
}

type BlockDetailedInfoHex

type BlockDetailedInfoHex struct {
	Header        BlockHeaderInfoHex  `json:"header"`
	Hash          string              `json:"hash"`
	EcosystemID   int64               `json:"ecosystem_id"`
	NodePosition  int64               `json:"node_position"`
	KeyID         string              `json:"key_id"`
	Time          int64               `json:"time"`
	Tx            int32               `json:"tx_count"`
	RollbacksHash string              `json:"rollbacks_hash"`
	MerkleRoot    string              `json:"merkle_root"`
	BinData       string              `json:"bin_data"`
	SysUpdate     bool                `json:"sys_update"`
	GenBlock      bool                `json:"gen_block"`
	StopCount     int                 `json:"stop_count"`
	BlockSize     string              `json:"block_size"`
	TxTotalSize   string              `json:"tx_total_size"`
	Transactions  []TxDetailedInfoHex `json:"transactions"`
}

func DealTransactionBlockTxDetial

func DealTransactionBlockTxDetial(mc *Block) (int64, *BlockDetailedInfoHex, *[]BlockTxDetailedInfoHex, error)

func GetBlocksDetailedInfoHex

func GetBlocksDetailedInfoHex(bk *Block) (*BlockDetailedInfoHex, error)

func GetBlocksDetailedInfoHexByScanOut

func GetBlocksDetailedInfoHexByScanOut(mc *Block) (*BlockDetailedInfoHex, error)

func GetBlocksTransactionInfoByBlockInfo

func GetBlocksTransactionInfoByBlockInfo(mc *Block) (*BlockDetailedInfoHex, error)

func GetTransactionTxDetial

func GetTransactionTxDetial(mc *Block) (int64, *BlockDetailedInfoHex, error)

type BlockDetailedInfoHexRespone

type BlockDetailedInfoHexRespone struct {
	Total        int64                    `json:"total"`
	Page         int                      `json:"page"`
	Limit        int                      `json:"limit"`
	Transactions []TxDetailedInfoResponse `json:"transactions"`
}

func GetBlockDetialRespones

func GetBlockDetialRespones(page int, limit int, txs *[]TxDetailedInfoResponse) *BlockDetailedInfoHexRespone

type BlockHeaderInfo

type BlockHeaderInfo struct {
	BlockID      int64  `json:"block_id"`
	Time         int64  `json:"time"`
	EcosystemID  int64  `json:"ecosystem_id"`
	KeyID        int64  `json:"key_id"`
	NodePosition int64  `json:"node_position"`
	Sign         []byte `json:"sign"`
	Hash         []byte `json:"hash"`
	Version      int    `json:"version"`
}

type BlockHeaderInfoDetailed

type BlockHeaderInfoDetailed struct {
	Header BlockHeaderInfoHex `json:"header"`
	//Info          BlockInfo           `json:"info"`
	Transactions []TxDetailedInfoHex `json:"transactions"`
}

type BlockHeaderInfoHex

type BlockHeaderInfoHex struct {
	BlockId       int64  `json:"block_id"`
	Time          int64  `json:"time"`
	EcosystemId   int64  `json:"ecosystem_id"`
	KeyId         string `json:"key_id"`
	NodePosition  int64  `json:"node_position"`
	PreHash       string `json:"pre_hash"`
	Sign          string `json:"sign"`
	BlockHash     string `json:"block_hash"`
	Version       int32  `json:"version"`
	Address       string `json:"address"`
	IconUrl       string `json:"icon_url"`
	ConsensusMode int32  `json:"consensus_mode"`
}

type BlockID

type BlockID struct {
	ID   int64
	Time int64
	Name string
}

func (*BlockID) DelByName

func (b *BlockID) DelByName(name string) error

func (*BlockID) GetByName

func (b *BlockID) GetByName(name string) (bool, error)

func (*BlockID) InsertRedis

func (b *BlockID) InsertRedis() error

func (*BlockID) Marshal

func (b *BlockID) Marshal() ([]byte, error)

func (*BlockID) Unmarshal

func (b *BlockID) Unmarshal(bt []byte) error

type BlockListChart

type BlockListChart struct {
	Time  []int64 `json:"time"`
	Block []int64 `json:"block"`
}

func Get15DayBlockDiffChartDataFromRedis

func Get15DayBlockDiffChartDataFromRedis() (BlockListChart, error)

type BlockListHeaderResponse

type BlockListHeaderResponse struct {
	Total     int64               `json:"total"`
	Page      int                 `json:"page"`
	Limit     int                 `json:"limit"`
	BlockInfo *BlockRet           `json:"block_info,omitempty"`
	List      []BlockListResponse `json:"list"`
	Digits    int64               `json:"digits"`
}

func GetBlockList

func GetBlockList(page, limit, reqType int, order string) (*BlockListHeaderResponse, error)

func GetBlockListFromRedis

func GetBlockListFromRedis() (*BlockListHeaderResponse, error)

func GetBlocksListFromRedis

func GetBlocksListFromRedis() (*BlockListHeaderResponse, error)

type BlockListResponse

type BlockListResponse struct {
	ID            int64  `json:"id"`
	Time          int64  `json:"time"`
	Tx            int32  `json:"tx"`
	NodePosition  int64  `json:"node_position"`
	NodeName      string `json:"node_name"`
	APIAddress    string `json:"api_address"`
	IconUrl       string `json:"icon_url"`
	Recipientid   string `json:"recipient_id"`
	GasFee        string `json:"gas_fee"`
	Reward        string `json:"reward"`
	EcoLib        int64  `json:"eco_lib"`
	ConsensusMode int32  `json:"consensus_mode"`
}

type BlockRet

type BlockRet struct {
	BlockId          int64  `json:"block_id"` //
	MaxTps           int32  `json:"max_tps"`
	MaxBlockSize     string `json:"max_block_size"`
	StorageCapacitys string `json:"storage_capacitys"`
	MaxTpsId         int64  `json:"max_tps_id,omitempty"`
	MaxBlockSizeId   int64  `json:"max_block_size_id,omitempty"`
}

type BlockSizeListResponse

type BlockSizeListResponse struct {
	Id   int64 `json:"id"`
	Time int64 `json:"time"`
	Size int64 `json:"size"`
	Tx   int64 `json:"tx"`
}

type BlockTps

type BlockTps struct {
	Id     int64 `gorm:"not null"`
	Tx     int32 `gorm:"not null"`
	Length int64 `gorm:"not null"`
}

type BlockTxDetailedInfo

type BlockTxDetailedInfo struct {
	BlockID      int64  `gorm:"not null;index:btdblockid_idx" json:"block_id"`
	Hash         string `gorm:"primary_key;not null" json:"hash"`
	ContractName string `gorm:"not null" json:"contract_name"`
	Params       string `gorm:"not null" json:"params"`
	KeyID        string `gorm:"not null" json:"key_id"`
	Time         int64  `gorm:"not null" json:"time"`
	Type         int64  `gorm:"not null" json:"type"`
	Size         int64  `gorm:"not null" json:"size"`

	Ecosystemname string `gorm:"null" json:"ecosystemname"`
	TokenSymbol   string `gorm:"null" json:"token_symbol"`
	Ecosystem     int64  `gorm:"null" json:"ecosystem"`
}

type BlockTxDetailedInfoHex

type BlockTxDetailedInfoHex struct {
	BlockID      int64  `gorm:"not null;index:blockid_idx" json:"block_id"`
	Hash         string `gorm:"primary_key;not null" json:"hash"`
	ContractName string `gorm:"not null" json:"contract_name"`
	ContractCode string `json:"contract_code"`
	//Params       map[string]any `json:"params"`
	Params string `gorm:"not null" json:"params"`
	KeyID  string `gorm:"not null" json:"key_id"`
	Time   int64  `gorm:"not null" json:"time"`
	Type   int64  `gorm:"not null" json:"type"`
	Size   int64  `gorm:"not null" json:"size"`

	Ecosystemname string          `gorm:"null" json:"ecosystemname"`
	Token_symbol  string          `gorm:"null" json:"token_symbol"`
	Ecosystem     int64           `gorm:"null" json:"ecosystem"`
	GasFee        decimal.Decimal `json:"gas_fee"`
	Amount        decimal.Decimal `json:"amount"`
	Status        int32           `json:"status"`
	Digits        int64           `json:"digits"`
}

func (*BlockTxDetailedInfoHex) GetByBlockIdBlockTransactionsLastDB

func (bt *BlockTxDetailedInfoHex) GetByBlockIdBlockTransactionsLastDB(id int64, page int, limit int, order string) (int64, *[]BlockTxDetailedInfoHex, error)

func (*BlockTxDetailedInfoHex) GetByHashDb

func (bt *BlockTxDetailedInfoHex) GetByHashDb(hash string) (bool, error)

func (*BlockTxDetailedInfoHex) GetByKeyIdBlockTransactionsLastDb

func (bt *BlockTxDetailedInfoHex) GetByKeyIdBlockTransactionsLastDb(id string, page int, size int, order string) (int64, *[]BlockTxDetailedInfoHex, error)

func (*BlockTxDetailedInfoHex) GetCommonTransactionSearch

func (bt *BlockTxDetailedInfoHex) GetCommonTransactionSearch(page, limit int, search, order string, reqType int) (*HashTransactionResult, error)

GetCommonTransactionSearch is retrieving model from database

func (*BlockTxDetailedInfoHex) GetDbTxDetailedHash

func (bt *BlockTxDetailedInfoHex) GetDbTxDetailedHash(hash string) (bool, error)

func (*BlockTxDetailedInfoHex) GetDbTxDetailedId

func (bt *BlockTxDetailedInfoHex) GetDbTxDetailedId(id int64) ([]BlockTxDetailedInfoHex, error)

func (*BlockTxDetailedInfoHex) GetDb_txdetailedKey

func (bt *BlockTxDetailedInfoHex) GetDb_txdetailedKey(key string, order string, limit, page int) ([]BlockTxDetailedInfoHex, int64, error)

func (*BlockTxDetailedInfoHex) Get_BlockTransactions_Sqlite

func (bt *BlockTxDetailedInfoHex) Get_BlockTransactions_Sqlite(page int, size int, order string) (*[]BlockTxDetailedInfoHex, int, error)

func (*BlockTxDetailedInfoHex) Marshal

func (s *BlockTxDetailedInfoHex) Marshal() ([]byte, error)

func (*BlockTxDetailedInfoHex) Unmarshal

func (s *BlockTxDetailedInfoHex) Unmarshal(bt []byte) error

type BlocksResult

type BlocksResult struct {
	BlockID      int64  `json:"id"`
	Time         int64  `json:"time"`
	EcosystemID  int64  `json:"ecosystem_id"`
	KeyID        string `json:"key_id"`
	NodePosition int64  `json:"node_position"`
	PreHash      string `json:"pre_hash"`
	Hash         string `json:"hash"`
	Tx           int32  `json:"tx"`
}

type BridgeSettings

type BridgeSettings struct {
	Id              int64  `gorm:"primary_key;not null"`
	BridgeAddress   string `gorm:"not null"`
	BridgeName      string `gorm:"not null"`
	ChainId         int64  `gorm:"not null"`
	ChainName       string `gorm:"not null"`
	DepositConfirm  int64  `gorm:"not null"`
	Owners          string `gorm:"not null"`
	Required        int64  `gorm:"not null"`
	Status          int    `gorm:"not null"` //1:enable 0:disable
	WithdrawConfirm int64  `gorm:"not null"`
}

func (*BridgeSettings) Get

func (b *BridgeSettings) Get(id int64) (bool, error)

func (*BridgeSettings) GetByChainName

func (b *BridgeSettings) GetByChainName(name string) (bool, error)

func (*BridgeSettings) TableName

func (b *BridgeSettings) TableName() string

type BridgeToken

type BridgeToken struct {
	Id           int64  `gorm:"primary_key;not null"`
	Status       int64  `gorm:"not null"`
	SettingId    int64  `gorm:"not null"`
	ChainName    string `gorm:"not null"`
	Ecosystem    int64  `gorm:"not null"`
	TokenAddress string `gorm:"not null"`
	TokenDigits  int64  `gorm:"not null"`
	TokenName    string `gorm:"not null"`
	TokenSymbol  string `gorm:"not null"`
}

func (*BridgeToken) Get

func (b *BridgeToken) Get(ecosystem int64) (bool, error)

func (*BridgeToken) GetByTokenSymbol

func (b *BridgeToken) GetByTokenSymbol(settingId int64, tokenAddress string) (bool, error)

func (*BridgeToken) TableName

func (b *BridgeToken) TableName() string

type CandidateHonorNodeRet

type CandidateHonorNodeRet struct {
	CandidateNode    int64  `json:"candidate_node"`
	NodeStakeAmounts string `json:"node_stake_amounts"`
	NodeVote         int64  `json:"node_vote"`
	TwentyFourNode   int64  `json:"twenty_four_node"`
}

type CandidateNodeDecisions

type CandidateNodeDecisions struct {
	Id            int64  `gorm:"primary_key;not_null"`
	RequestId     int64  `gorm:"not_null"`
	Account       string `gorm:"not_null"`
	Decision      int64  `gorm:"not_null"`
	Earnest       string `gorm:"not_null"`
	DateCreated   int64  `gorm:"not_null"`
	DateUpdated   int64  `gorm:"not_null"`
	DecisionType  int64  `gorm:"not_null"`
	DateWithdrawd int64  `gorm:"not_null"`
}

func (*CandidateNodeDecisions) TableName

func (p *CandidateNodeDecisions) TableName() string

type CandidateNodeRequests

type CandidateNodeRequests struct {
	Id           int64  `gorm:"primary_key;not_null"`
	TcpAddress   string `gorm:"not_null"`
	ApiAddress   string `gorm:"not_null"`
	NodePubKey   string `gorm:"not_null"`
	DateCreated  int64  `gorm:"not_null"`
	Deleted      int    `gorm:"not_null"`
	DateDeleted  int64  `gorm:"not_null"`
	Website      string `gorm:"not_null"`
	ReplyCount   int64  `gorm:"not_null"`
	DateReply    int64  `gorm:"not_null"`
	EarnestTotal string `gorm:"not_null"`
	NodeName     string `gorm:"not_null"`
}

func (*CandidateNodeRequests) GetAll

func (*CandidateNodeRequests) GetById

func (p *CandidateNodeRequests) GetById(id int64) (bool, error)

func (*CandidateNodeRequests) GetNodeMap

func (p *CandidateNodeRequests) GetNodeMap() (*NodeMapResponse, error)

func (*CandidateNodeRequests) GetPubKeyById

func (p *CandidateNodeRequests) GetPubKeyById(id int64) (bool, error)

func (*CandidateNodeRequests) TableName

func (p *CandidateNodeRequests) TableName() string

type CastNodeRet

type CastNodeRet struct {
	CastNodes          int64  `json:"cast_nodes"`
	DistributionRegion int64  `json:"distribution_region"`
	CastCapacitys      string `json:"cast_capacitys"`
	BandwidthTraffic   string `json:"bandwidth_traffic"`
}

type Circulations

type Circulations struct {
	TotalAmount        string `json:"total_amount"`
	CirculationsAmount string `json:"circulations_amount"`
	StakeAmounts       string `json:"stake_amounts"`
	LockAmount         string `json:"lock_amount"`
	MinerBalance       string `json:"miner_balance"`
}

type CirculationsChangeResponse

type CirculationsChangeResponse struct {
	Time    []int64  `json:"time"`
	Miner   []string `json:"miner"`
	Unlock  []string `json:"unlock"`
	Unstake []string `json:"unstake"`
	Total   []string `json:"total"`
}

type CirculationsChartResponse

type CirculationsChartResponse struct {
	Total   string                     `json:"total"`
	Unlock  string                     `json:"unlock"`
	Unstake string                     `json:"unstake"`
	Miner   string                     `json:"miner"`
	Change  CirculationsChangeResponse `json:"change"`
}

func Get15DayNewCirculationsChart

func Get15DayNewCirculationsChart() (CirculationsChartResponse, error)

type CirculationsRet

type CirculationsRet struct {
	Circulations            string `json:"circulations_amount"`
	TotalAmounts            string `json:"total_amount"`
	TodayCirculationsAmount string `json:"today_circulations_amount"`
	TwentyFourAmount        string `json:"twenty_four_amount"`
}

type Combustion

type Combustion struct {
	Flag    int64 `json:"flag"`
	Percent int64 `json:"percent"`
}

type CombustionDetail

type CombustionDetail struct {
	FuelRate   string `json:"fuel_rate"`
	Combustion struct {
		Flag    int    `json:"flag"`
		After   string `json:"after"`
		Value   string `json:"value"`
		Before  string `json:"before"`
		Percent int    `json:"percent"`
	} `json:"combustion"`
	VmCostFee   decimal.Decimal `json:"vmCost_fee"`
	ElementFee  decimal.Decimal `json:"element_fee"`
	StorageFee  decimal.Decimal `json:"storage_fee"`
	ExpediteFee decimal.Decimal `json:"expedite_fee"`
}

type CommonResult

type CommonResult struct {
	TotalResult
	IsCreate bool                `json:"is_create"`
	Rets     []map[string]string `json:"rets"`
}

type Contract

type Contract struct {
	ID          int64  `json:"id,omitempty"`
	Name        string `json:"name,omitempty"`
	Value       string `json:"value,omitempty"`
	WalletID    int64  `json:"wallet_id,omitempty"`
	Active      bool   `json:"active,omitempty"`
	TokenID     int64  `json:"token_id,omitempty"`
	Conditions  string `json:"conditions,omitempty"`
	AppID       int64  `json:"app_id,omitempty"`
	EcosystemID int64  `gorm:"column:ecosystem" json:"ecosystem_id,omitempty"`
}

Contract represents record of 1_contracts table

func (*Contract) GetByApp

func (c *Contract) GetByApp(appID int64, ecosystemID int64) ([]Contract, error)

func (*Contract) GetById

func (c *Contract) GetById(id int64) (bool, error)

func (*Contract) GetContractsByEcoLibs

func (c *Contract) GetContractsByEcoLibs(ecosystem int64) int64

func (*Contract) TableName

func (c *Contract) TableName() string

TableName returns name of table

type ContractTxDetail

type ContractTxDetail struct {
	Comment string `json:"comment"`
	HistoryItem
}

type ContractsParams

type ContractsParams struct {
	Id         int64  `json:"id,omitempty"`
	Type       string `json:"Type"`
	Name       string `json:"Name"`
	Value      string `json:"Value"`
	Conditions string `json:"Conditions"`
}

type CountInt64

type CountInt64 struct {
	Count int64 `gorm:"column:count"`
}

type CountResponse

type CountResponse struct {
	Count int64 `json:"count"`
}

type CountriesGeoJson

type CountriesGeoJson struct {
	Type     string           `json:"type"`
	Features []CountryFeature `json:"features"`
}
var (
	CountriesGeo CountriesGeoJson
)

type CountryFeature

type CountryFeature struct {
	Type       string      `json:"type"`
	Properties CountryInfo `json:"properties"`
	Geometry   Geometry    `json:"geometry"`
}

type CountryInfo

type CountryInfo struct {
	ADMIN     string `json:"ADMIN"`
	ISOA2     string `json:"ISO_A2"`
	Continent string `json:"continent"`
}

func FindCountryByCoordinate

func FindCountryByCoordinate(lat, lng float64) CountryInfo

type DBTransactionsInfo

type DBTransactionsInfo struct {
	Name        string `json:"name"`
	Transaction int32  `json:"transaction"`
}

type DailyActiveChartResponse

type DailyActiveChartResponse struct {
	MaxActive int64               `json:"max_active"`
	MaxTime   int64               `json:"max_time"`
	MinActive int64               `json:"min_active"`
	MinTime   int64               `json:"min_time"`
	Time      []int64             `json:"time"`
	Info      []DailyActiveReport `json:"info"`
}

func GetDailyActiveAccountChangeChart

func GetDailyActiveAccountChangeChart(search any, startTime, endTime int64) (*DailyActiveChartResponse, error)

type DailyActiveReport

type DailyActiveReport struct {
	ID            int64  `gorm:"primary_key;not null" json:"id"`
	Time          int64  `gorm:"column:time;not null" json:"time"`
	ActiveAccount int64  `gorm:"column:active;not null" json:"active_account"`
	Ratio         string `gorm:"column:ratio;type:varchar(30);not null" json:"ratio"`
	TotalKey      int64  `gorm:"column:total_key;not null" json:"total_key"`
	RelativeRatio string `gorm:"column:relative_ratio;type:varchar(30);not null" json:"relative_ratio"`
	TxNumber      int64  `gorm:"column:tx_number;not null" json:"tx_number"`
	TxAmount      string `gorm:"column:tx_amount;type:decimal(30);not null" json:"tx_amount"`
}

func GetDailyActiveReportList

func GetDailyActiveReportList() ([]DailyActiveReport, error)

func (*DailyActiveReport) CreateTable

func (p *DailyActiveReport) CreateTable() (err error)

func (*DailyActiveReport) GetFirst

func (dt *DailyActiveReport) GetFirst() (bool, error)

func (*DailyActiveReport) GetLast

func (dt *DailyActiveReport) GetLast() (bool, error)

func (*DailyActiveReport) GetList

func (dt *DailyActiveReport) GetList() ([]DailyActiveReport, error)

func (*DailyActiveReport) GetTimeLine

func (dt *DailyActiveReport) GetTimeLine(stTime, edTime int64) ([]DailyActiveReport, error)

func (*DailyActiveReport) Insert

func (dt *DailyActiveReport) Insert() error

func (*DailyActiveReport) InsertList

func (dt *DailyActiveReport) InsertList(list []DailyActiveReport) error

func (*DailyActiveReport) TableName

func (dt *DailyActiveReport) TableName() string

type DailyNodeReport

type DailyNodeReport struct {
	ID            int64  `gorm:"primary_key;not null" json:"id"`
	Time          int64  `gorm:"column:time;not null" json:"time"`
	HonorNode     string `gorm:"not null;type:jsonb" json:"honor_node"`
	CandidateNode string `gorm:"not null;type:jsonb" json:"candidate_node"`
}

func (*DailyNodeReport) CreateTable

func (p *DailyNodeReport) CreateTable() (err error)

func (*DailyNodeReport) GetLast

func (p *DailyNodeReport) GetLast() (bool, error)

func (*DailyNodeReport) Insert

func (dt *DailyNodeReport) Insert() error

func (*DailyNodeReport) TableName

func (p *DailyNodeReport) TableName() string

type DaoVoteChartResponse

type DaoVoteChartResponse struct {
	NotEnoughVotes int64 `json:"not_enough_votes"`
	Rejected       int64 `json:"rejected"`
	No             int64 `json:"no"`
	Accept         int64 `json:"accept"`
	List           []struct {
		VoteStatus
		Total int64 `json:"total"`
		Time  int64 `json:"time"`
	} `json:"list"`
}

type DaoVoteDetailResponse

type DaoVoteDetailResponse struct {
	VoteStatus
	VoteInfo
	Progress int `json:"progress"`

	TypeDecision string `json:"type_decision"`
	Description  string `json:"description"`
	//DescriptionText string `json:"description_text"`
	VotingSubject struct {
		ContractAccept   string `json:"contract_accept"`
		Arguments        string `json:"arguments"`
		ContractOfReject string `json:"contract_of_reject"`
	} `json:"voting_subject"`

	Voting struct {
		Type            string   `json:"type"`
		Status          string   `json:"status"`
		CountTypeVoters int      `json:"count_type_voters"`
		VoteCountType   string   `json:"vote_count_type"`
		Filled          string   `json:"filled"` //full data
		Decision        string   `json:"decision"`
		DateStart       int64    `json:"date_start"`
		DateEnd         int64    `json:"date_end"`
		Quorum          int      `json:"quorum"`
		Volume          int      `json:"volume"`
		Participants    int64    `json:"participants"`
		Creator         string   `json:"creator"`
		Member          []string `json:"member"`
	} `json:"voting"`
}

func GetDaoVoteDetail

func GetDaoVoteDetail(search any, language string) (DaoVoteDetailResponse, error)

type DashboardChainInfo

type DashboardChainInfo struct {
	High string `json:"high"`
	Low  string `json:"low"`
	Buy  string `json:"buy"`
	Sell string `json:"sell"`
	Last string `json:"last"`
	Vol  string `json:"vol"`
}

type DashboardChartData

type DashboardChartData struct {
	BlockChart        BlockListChart    `json:"block_chart"`
	TxChart           TxListChart       `json:"tx_chart"`
	CirculationsChart Circulations      `json:"circulations_chart"`
	NftMinerChart     NftMinerInfoChart `json:"nft_miner_chart"`
	EcoLibsChart      EcoListChart      `json:"eco_libs_chart"`
	KeyChart          KeyInfoChart      `json:"key_chart"`
	HonerNodeChart    HonorNodeChart    `json:"honer_node_chart"`
	Digits            int64             `json:"digits"`
}

func GetDashboardChartData

func GetDashboardChartData() (*DashboardChartData, error)

func GetDashboardChartDataFromRedis

func GetDashboardChartDataFromRedis() (*DashboardChartData, error)

func (*DashboardChartData) Marshal

func (s *DashboardChartData) Marshal() ([]byte, error)

func (*DashboardChartData) Unmarshal

func (s *DashboardChartData) Unmarshal(bt []byte) error

type DaysActiveReport

type DaysActiveReport struct {
	Days     string          `gorm:"column:days"`
	Active   int64           `gorm:"column:active"`
	TotalKey int64           `gorm:"column:total_key"`
	Ratio    decimal.Decimal `gorm:"column:ratio"`
	TxNumber int64           `gorm:"column:tx_number"`
	TxAmount decimal.Decimal `gorm:"column:tx_amount"`
}

func GetTimeLineDaysActiveReport

func GetTimeLineDaysActiveReport(st, ed int64) (DaysActiveReport, bool, error)

type DaysAmount

type DaysAmount struct {
	Days   string          `gorm:"column:days"`
	Amount decimal.Decimal `gorm:"column:amount"`
}

func FindDaysAmount

func FindDaysAmount(sql string) ([]DaysAmount, error)

type DaysAmountResponse

type DaysAmountResponse struct {
	Time   []int64  `json:"time"`
	Amount []string `json:"amount"`
}

func GetDaysAmountResponse

func GetDaysAmountResponse(list []DaysAmount) DaysAmountResponse

func GetNftMinerRewardChangeChart

func GetNftMinerRewardChangeChart() (DaysAmountResponse, error)

type DaysNumber

type DaysNumber struct {
	Days string `gorm:"column:days"`
	Num  int64  `gorm:"column:num"`
}

func FindDaysNumber

func FindDaysNumber(sql string, values ...interface{}) ([]DaysNumber, error)

type DaysNumberResponse

type DaysNumberResponse struct {
	Time   []int64 `json:"time"`
	Number []int64 `json:"number"`
}

func Get15DayBlockNumberChart

func Get15DayBlockNumberChart() (DaysNumberResponse, error)

Get15DayBlockNumberChart response time:200-1500ms TODO:NEED TO Redis

func GetHistoryNewEcosystemChangeChart

func GetHistoryNewEcosystemChangeChart() (DaysNumberResponse, error)

type DbTransaction

type DbTransaction struct {
	// contains filtered or unexported fields
}

func NewDbTransaction

func NewDbTransaction(conn *gorm.DB) *DbTransaction

func StartTransaction

func StartTransaction() (*DbTransaction, error)

StartTransaction is beginning transaction

func (*DbTransaction) Commit

func (tr *DbTransaction) Commit() error

Commit is transaction commit

func (*DbTransaction) Connection

func (tr *DbTransaction) Connection() *gorm.DB

Connection returns connection of database

func (*DbTransaction) DropTables

func (dbTx *DbTransaction) DropTables() error

DropTables is dropping all of the tables

func (*DbTransaction) Rollback

func (tr *DbTransaction) Rollback()

Rollback is transaction rollback

type DetailItem

type DetailItem struct {
	SenderId   string          `json:"sender_id"`
	Amount     decimal.Decimal `json:"amount"`
	Flag       int             `json:"flag"`
	Scale      float64         `json:"scale,omitempty"`
	FuelRate   float64         `json:"fuel_rate,omitempty"`
	Combustion string          `json:"combustion,omitempty"`
}

type EcoCirculationsChangeResponse

type EcoCirculationsChangeResponse struct {
	Time             []string `json:"time"`
	Circulations     []string `json:"circulations"`
	StakeAmount      []string `json:"stake_amount"`
	LockAmount       []string `json:"lock_amount"`
	NftBalanceSupply []string `json:"nft_balance_supply"`
	BurningTokens    []string `json:"burning_tokens"`
	Combustion       []string `json:"combustion"`
	SupplyToken      []string `json:"supply_token"`
	Emission         []string `json:"emission"`
}

type EcoCirculationsResponse

type EcoCirculationsResponse struct {
	Circulations     string `json:"circulations"`
	StakeAmount      string `json:"stake_amount"`
	LockAmount       string `json:"lock_amount"`
	NftBalanceSupply string `json:"nft_balance_supply"`
	BurningTokens    string `json:"burning_tokens"`
	Combustion       string `json:"combustion"`
	TokenSymbol      string `json:"token_symbol"`
	Name             string `json:"name"`
	SupplyToken      string `json:"supply_token"`
	Emission         string `json:"emission"`
	Digits           int64  `json:"digits"`

	Change EcoCirculationsChangeResponse `json:"change"`
}

func GetEcosystemCirculationsChart

func GetEcosystemCirculationsChart(ecosystem int64) (EcoCirculationsResponse, error)

func GetEcosystemCirculationsFromRedis

func GetEcosystemCirculationsFromRedis(ecosystem int64) (*EcoCirculationsResponse, error)

type EcoGasFeeChangeResponse

type EcoGasFeeChangeResponse struct {
	TokenSymbol string   `json:"token_symbol"`
	Name        string   `json:"name"`
	Time        []string `json:"time"`
	GasFee      []string `json:"gas_fee"`
	Combustion  []string `json:"combustion"`
	Digits      int64    `json:"digits"`
}

func GetGasCombustionLineFromRedis

func GetGasCombustionLineFromRedis(ecosystem int64) (*EcoGasFeeChangeResponse, error)

type EcoGasFeeResponse

type EcoGasFeeResponse struct {
	GasFee      string `json:"gas_fee"`
	Combustion  string `json:"combustion"`
	TokenSymbol string `json:"token_symbol"`
	Name        string `json:"name"`
	Digits      int64  `json:"digits"`
}

func GetGasCombustionPieFromRedis

func GetGasCombustionPieFromRedis(ecosystem int64) (*EcoGasFeeResponse, error)

type EcoLibsRet

type EcoLibsRet struct {
	Ecosystems    int64 `json:"ecosystems"`
	EcoTokenTotal int64 `json:"eco_token_total"`
	DaoGovern     int64 `json:"dao_govern"`
	Contract      int64 `json:"contract"`
}

type EcoListChart

type EcoListChart struct {
	Time    []int64 `json:"time"`
	EcoLibs []int64 `json:"eco_libs"`
}

type EcoTopTenHasTokenResponse

type EcoTopTenHasTokenResponse struct {
	TokenSymbol string         `json:"token_symbol"`
	Digits      int64          `json:"digits"`
	Name        string         `json:"name"` //ecosystem name
	List        []accountRatio `json:"list"`
}

EcoSystem Chart response

func GetTopTenHasTokenAccountFromRedis

func GetTopTenHasTokenAccountFromRedis(ecosystem int64) (*EcoTopTenHasTokenResponse, error)

type EcoTopTenTxAmountResponse

type EcoTopTenTxAmountResponse struct {
	EcoTopTenHasTokenResponse
}

func GetTopTenTxAccountFromRedis

func GetTopTenTxAccountFromRedis(ecosystem int64) (*EcoTopTenTxAmountResponse, error)

type EcoTxAmountDiffResponse

type EcoTxAmountDiffResponse struct {
	TokenSymbol string   `json:"token_symbol"`
	Name        string   `json:"name"` //ecosystem name
	Time        []int64  `json:"time"`
	Amount      []string `json:"amount"`
	Digits      int64    `json:"digits"`
}

func Get15DaysTxAmountFromRedis

func Get15DaysTxAmountFromRedis(ecosystem int64) (*EcoTxAmountDiffResponse, error)

type EcoTxGasFeeDiffResponse

type EcoTxGasFeeDiffResponse struct {
	TokenSymbol    string   `json:"token_symbol"`
	Digits         int64    `json:"digits"`
	Name           string   `json:"name"` //ecosystem name
	Time           []int64  `json:"time"`
	EcoGasAmount   []string `json:"eco_gas_amount"`
	BasisGasAmount []string `json:"basis_gas_amount"`
}

func Get15DaysGasFeeFromRedis

func Get15DaysGasFeeFromRedis(ecosystem int64) (*EcoTxGasFeeDiffResponse, error)

func GetEco15DayGasFeeChart

func GetEco15DayGasFeeChart(ecosystem int64) (EcoTxGasFeeDiffResponse, error)

type EcoTxListResponse

type EcoTxListResponse struct {
	LogTransaction
}

type EcosyKeyHex

type EcosyKeyHex struct {
	Ecosystem       int64  `json:"ecosystem"`
	IsValued        int64  `json:"isvalued"`
	Ecosystemname   string `json:"ecosystemname"`
	TokenSymbol     string `json:"token_symbol"`
	Amount          string `json:"amount"`
	Info            string `json:"info"`
	Emission_amount string `json:"emission_amount"`
	Type_emission   int64
	Type_withdraw   int64
}

type EcosyKeyList

type EcosyKeyList struct {
	Ecosystem    int64           `json:"ecosystem"`
	Account      string          `json:"account"`
	AccountName  string          `json:"account_name"`
	Amount       string          `json:"amount"`
	TotalAmount  decimal.Decimal `json:"total_amount"`
	AccountedFor decimal.Decimal `json:"accounted_for"`
	StakeAmount  decimal.Decimal `json:"stake_amount"`
	LockAmount   decimal.Decimal `json:"lock_amount"`
	TokenSymbol  string          `json:"token_symbol"`
	Digits       int64           `json:"digits"`
}

type EcosyKeyTotalDetail

type EcosyKeyTotalDetail struct {
	Account     string          `json:"account"`
	Ecosystem   int64           `json:"ecosystem"`
	LogoHash    string          `json:"logo_hash"`
	Name        string          `json:"name"`
	JoinTime    int64           `json:"join_time"`
	TokenSymbol string          `json:"token_symbol"`
	Amount      string          `json:"amount"`
	TotalAmount decimal.Decimal `json:"total_amount"`
	LockAmount  decimal.Decimal `json:"lock_amount"`
	StakeAmount decimal.Decimal `json:"stake_amount"`
	RolesName   string          `json:"roles_name"`
	Digits      int64           `json:"digits"`
}

type EcosyKeyTotalHex

type EcosyKeyTotalHex struct {
	Wallet         string          `json:"wallet"`
	Ecosystem      int64           `json:"ecosystem"`
	IsValued       int64           `json:"isvalued"`
	Ecosystemname  string          `json:"ecosystemname"`
	TokenSymbol    string          `json:"token_symbol"`
	Amount         string          `json:"amount"`
	Info           string          `json:"info"`
	EmissionAmount string          `json:"emission_amount"`
	MemberName     string          `json:"member_name"`
	MemberHash     string          `json:"member_hash"`
	LogoHash       string          `json:"logo_hash"`
	TypeEmission   int64           `json:"type_emission"`
	TypeWithdraw   int64           `json:"type_withdraw"`
	Transaction    int64           `json:"transaction"`
	InTx           int64           `json:"in_tx"`
	OutTx          int64           `json:"out_tx"`
	StakeAmount    decimal.Decimal `json:"stake_amount"`
	LockAmount     decimal.Decimal `json:"lock_amount"`
	InAmount       decimal.Decimal `json:"inamount"`
	OutAmount      decimal.Decimal `json:"outamount"`
	TxAmount       string          `json:"tx_amount"`
	TotalAmount    decimal.Decimal `json:"total_amount"`
	JoinTime       int64           `json:"join_time"`
	RolesName      string          `json:"roles_name"`
	Digits         int64           `json:"digits"`
}

type Ecosystem

type Ecosystem struct {
	ID             int64 `gorm:"primary_key;not null"`
	Name           string
	Info           string `gorm:"type:jsonb(PostgreSQL)"`
	FeeModeInfo    string
	IsValued       int64
	EmissionAmount string `gorm:"type:jsonb(PostgreSQL)"`
	TokenSymbol    string
	TokenName      string
	TypeEmission   int64
	TypeWithdraw   int64
	ControlMode    int64
	Digits         int64
}

func (*Ecosystem) Get

func (sys *Ecosystem) Get(id int64) (bool, error)

func (*Ecosystem) GetBasisEcosystem

func (p *Ecosystem) GetBasisEcosystem() (*BasisEcosystemResponse, error)

func (*Ecosystem) GetBasisEcosystemChart

func (p *Ecosystem) GetBasisEcosystemChart() (*BasisEcosystemChartDataResponse, error)

func (*Ecosystem) GetEcoSystemList

func (p *Ecosystem) GetEcoSystemList(limit, page int, order string, where map[string]any) (int64, *[]EcosystemTotalResponse, error)

func (*Ecosystem) GetTokenSymbol

func (sys *Ecosystem) GetTokenSymbol(id int64) (bool, error)

func (*Ecosystem) TableName

func (sys *Ecosystem) TableName() string

type EcosystemAppInfo

type EcosystemAppInfo struct {
	AppId     int64             `json:"app_id"`
	Contracts []ContractsParams `json:"contracts,omitempty"`
	Page      []PageParams      `json:"page,omitempty"`
	Snippets  []SnippetsParams  `json:"snippets,omitempty"`
	Table     []TableParams     `json:"table,omitempty"`
	Params    []AppParams       `json:"params,omitempty"`
}

type EcosystemAppList

type EcosystemAppList struct {
	AppId      int64  `json:"app_id"`
	Name       string `json:"name"`
	Conditions string `json:"conditions"`
}

type EcosystemAttachmentResponse

type EcosystemAttachmentResponse struct {
	Name     string `json:"name"`
	Id       int64  `json:"id"`
	Hash     string `json:"hash"`
	MimeType string `json:"mime_type"`
}

type EcosystemDetailInfoResponse

type EcosystemDetailInfoResponse struct {
	EcosystemId     int64  `json:"ecosystem_id"`
	Ecosystem       string `json:"ecosystem"`
	LogoHash        string `json:"logo_hash"`
	BlockId         int64  `json:"block_id"`
	Hash            string `json:"hash"`
	Creator         string `json:"creator"`
	EcoType         string `json:"eco_type"`
	EcoTag          string `json:"eco_tag"`
	EcoCascade      string `json:"eco_cascade"`
	MultiFee        bool   `json:"multi_fee"`
	EcoIntroduction string `json:"eco_introduction"`
	Time            int64  `json:"time"`
	GovernModel     int64  `json:"govern_model"`
	GovernCommittee string `json:"govern_committee"`
	TokenSymbol     string `json:"token_symbol"`
	TotalAmount     string `json:"total_amount"`
	IsWithdraw      bool   `json:"is_withdraw"`
	Withdraw        string `json:"withdraw"`
	IsEmission      bool   `json:"is_emission"`
	Emission        string `json:"emission"`
	FeeModel        int    `json:"fee_model"`
	FeeModeAccount  string `json:"fee_mode_account"`

	FeeModelVmcost  FeeModeFlag `json:"vmcost"`
	FeeModeStorage  FeeModeFlag `json:"storage"`
	FeeModeElement  FeeModeFlag `json:"element"`
	FeeModeExpedite FeeModeFlag `json:"expedite"`

	WithholdingMode   int     `json:"withholding_mode"`
	IsCombustion      bool    `json:"is_combustion"`
	Combustion        string  `json:"combustion"`
	CombustionPercent int64   `json:"combustion_percent"`
	Circulations      string  `json:"circulations"`
	FollowFuel        float64 `json:"follow_fuel"`

	Registered       string            `json:"registered"`
	Country          string            `json:"country"`
	RegistrationNo   string            `json:"registration_no"`
	RegistrationType string            `json:"registration_type"`
	WebPage          string            `json:"web_page"`
	Social           map[string]string `json:"social"`
	Digits           int64             `json:"digits"`
	BridgeInfo       *bridgeInfo       `json:"bridge_info"`
}

func GetEcosystemDetailInfo

func GetEcosystemDetailInfo(search any) (*EcosystemDetailInfoResponse, error)

type EcosystemInfoMap

type EcosystemInfoMap struct {
	sync.Map
}
var (
	Tokens   *EcosystemInfoMap
	EcoNames *EcosystemInfoMap

	EcosystemIdList []int64

	EcoTxCount  *EcosystemInfoMap
	EcoDigits   *EcosystemInfoMap
	EcoFuelRate *EcosystemInfoMap
)

func (*EcosystemInfoMap) Get

func (p *EcosystemInfoMap) Get(ecosystem int64) string

func (*EcosystemInfoMap) GetFloat64

func (p *EcosystemInfoMap) GetFloat64(ecosystem int64, defaultValue float64) float64

func (*EcosystemInfoMap) GetId

func (p *EcosystemInfoMap) GetId(infoId int, defaultValue string) string

func (*EcosystemInfoMap) GetInt64

func (p *EcosystemInfoMap) GetInt64(ecosystem int64, defaultValue int64) int64

func (*EcosystemInfoMap) Len

func (p *EcosystemInfoMap) Len() int

type EcosystemKeysRatioResponse

type EcosystemKeysRatioResponse struct {
	Id     int64           `json:"id"`
	Name   string          `json:"name"`
	Number int64           `json:"number"`
	Ratio  decimal.Decimal `json:"ratio"`
}

func GetTopTenMaxKeysEcosystem

func GetTopTenMaxKeysEcosystem() ([]EcosystemKeysRatioResponse, error)

type EcosystemList

type EcosystemList struct {
	ID             int64  `json:"id"`
	Name           string `json:"name"`
	Info           string `json:"info"`
	IsValued       int64  `json:"isValued"`
	EmissionAuount string `json:"emission_auount"`
	TokenSymbol    string `json:"token_symbol"`
	TypeEmission   int64  `json:"type_emission"`
	TypeWithdraw   int64  `json:"type_withdraw"`
	Member         int64  `json:"member"`
	AppParams      any    `json:"app_params,omitempty"`
	Status         int    `json:"status"` //0:Not joined 1:join 2:unknown
}

type EcosystemListResponse

type EcosystemListResponse struct {
	Id       int64  `json:"id"`
	Name     string `json:"name"`
	LogoHash string `json:"logo_hash"`
	Contract int64  `json:"contract"`
	Block    int64  `json:"block"`
	Hash     string `json:"hash"`
}

type EcosystemMemberList

type EcosystemMemberList struct {
	Id          int64  `json:"id"`
	Account     string `json:"account"`
	AccountName string `json:"account_name"`
	RolesName   string `json:"roles_name"`
	JoinTime    int64  `json:"join_time"`
}

type EcosystemParameterResult

type EcosystemParameterResult struct {
	Total int64            `json:"total"`
	Page  int              `json:"page"`
	Limit int              `json:"limit"`
	Rets  []StateParameter `json:"rets"`
}

type EcosystemSearchResponse

type EcosystemSearchResponse struct {
	Name string `json:"name"`
	Id   int64  `json:"id"`
}

type EcosystemTokenSymbolList

type EcosystemTokenSymbolList struct {
	Id             int64           `json:"id"`
	Account        string          `json:"account"`
	AccountName    string          `json:"account_name"`
	Amount         decimal.Decimal `json:"amount"`
	AccountedFor   decimal.Decimal `json:"accounted_for"`
	TokenSymbol    string          `json:"token_symbol"`
	Digits         int64           `json:"digits"`
	FrontCommittee bool            `json:"front_committee"`
	Committee      bool            `json:"committee"`
	Activation     bool            `json:"activation"`
}

type EcosystemTotalResponse

type EcosystemTotalResponse struct {
	ID          int64  `json:"id"`
	Name        string `json:"name"`
	LogoHash    string `json:"logo_hash"`
	GovernModel int64  `json:"govern_model"`
	FeeModel    int    `json:"fee_model"`
	TokenSymbol string `json:"token_symbol"`
	Digits      int64  `json:"digits"`
	Creator     string `json:"creator"`
	TotalAmount string `json:"total_amount"`
	Member      int64  `json:"member"`
	Contract    int64  `json:"contract"`
	ChainName   string `json:"chain_name"`
	ChainId     int64  `json:"chain_id"`
}

type EcosystemTotalResult

type EcosystemTotalResult struct {
	Total    int64                     `json:"total"`
	Page     int                       `json:"page"`
	Limit    int                       `json:"limit"`
	Sysecosy *BasisEcosystemResponse   `json:"sysecosy,omitempty"`
	Rets     *[]EcosystemTotalResponse `json:"rets,omitempty"`
}

EcosystemTotalResult example

type EcosystemTxCount

type EcosystemTxCount struct {
	Ecosystem int64  `gorm:"column:ecosystem"`
	Tx        int64  `gorm:"column:tx"`
	Name      string `gorm:"column:name"`
	Total     int64  `gorm:"column:total"`
}

type EcosystemTxList

type EcosystemTxList struct {
	Hash     string `json:"hash"`
	BlockId  int64  `json:"block_id"`
	Time     int64  `json:"time"`
	Contract string `json:"contract"`
	Address  string `json:"address"`
	Status   int32  `json:"status"`
}

type EcosystemTxRatioChart

type EcosystemTxRatioChart struct {
	Value float64 `json:"value"`
	Name  string  `json:"name"`
}

func GetEcoLibsTransaction

func GetEcoLibsTransaction() ([]EcosystemTxRatioChart, error)

func GetEcoLibsTxChartDataFromRedis

func GetEcoLibsTxChartDataFromRedis() ([]EcosystemTxRatioChart, error)

type EcosystemTxRatioResponse

type EcosystemTxRatioResponse struct {
	Name  string          `json:"name"`
	Tx    int64           `json:"tx"`
	Ratio decimal.Decimal `json:"ratio"`
}

func GetTopTenEcosystemTxChart

func GetTopTenEcosystemTxChart() ([]EcosystemTxRatioResponse, error)

GetTopTenEcosystemTxChart return Fifteen days transactions TODO:200-800ms NEED TO Redis

type ExportAppInfo

type ExportAppInfo struct {
	Conditions string `json:"conditions"`
	Name       string `json:"name"`
	Data       []any  `json:"data"`
}

func EcosystemAppExport

func EcosystemAppExport(appid int64) (*ExportAppInfo, error)

type FeeDetail

type FeeDetail struct {
	Flag           int     `json:"flag"`
	Value          string  `json:"value"`
	Convert        bool    `json:"convert"`
	Decimal        string  `json:"decimal"`
	ConversionRate float64 `json:"conversion_rate"`
}

type FeeInfo

type FeeInfo struct {
	Sender      string `json:"sender"`
	Recipient   string `json:"recipient"`
	Amount      string `json:"amount"`
	TokenSymbol string `json:"tokenSymbol"`
	Digits      int64  `json:"digits"`
}

type FeeModeFlag

type FeeModeFlag struct {
	Flag           string `json:"flag"`
	ConversionRate string `json:"conversion_rate,omitempty"`
}

type FeeModeInfo

type FeeModeInfo struct {
	FeeModeDetail map[string]sqldb.FeeModeFlag `json:"fee_mode_detail"`
	Combustion    Combustion                   `json:"combustion"`
	FollowFuel    float64                      `json:"follow_fuel"`
}

type FeesInfo

type FeesInfo struct {
	Amount      decimal.Decimal  `json:"amount"`
	TokenSymbol string           `json:"tokenSymbol"`
	FuelRate    FuelRateResponse `json:"fuelRate"`
	Fees        FeeInfo          `json:"fees"`
	Taxes       FeeInfo          `json:"taxes"`
	Combustion  combusionInfo    `json:"combustion"`
	Digits      int64            `json:"digits"`
}

type FlagsInfo

type FlagsInfo struct {
	Success  string `json:"success"`
	Decision string `json:"decision"`
	Notifics string `json:"notifics"`
	FullData string `json:"full_data"`
}

type FuelRateInfo

type FuelRateInfo struct {
	Map map[int64]decimal.Decimal
	sync.RWMutex
}

type FuelRateResponse

type FuelRateResponse struct {
	Value string `json:"value"`
	Unit  string `json:"unit"`
}

type FullNodeCityJSON

type FullNodeCityJSON struct {
	TCPAddress string `json:"tcp_address"`
	APIAddress string `json:"api_address"`
	City       string `json:"city"`
	Icon       string `json:"icon"`
	//KeyID      int64  `json:"key_id"`
	KeyID     json.Number `json:"key_id"`
	PublicKey string      `json:"public_key"`
	//UnbanTime  json.Number `json:"unban_time,er"`
	UnbanTime time.Time `json:"unbantime"`
}

because of PublicKey is byte

type FullNodeCityJSONHex

type FullNodeCityJSONHex struct {
	TCPAddress string `json:"tcp_address"`
	APIAddress string `json:"api_address"`
	City       string `json:"city"`
	Icon       string `json:"icon"`
	//KeyID      int64  `json:"key_id"`
	KeyID     string `json:"key_id"`
	PublicKey string `json:"public_key"`
	//UnbanTime  json.Number `json:"unban_time,er"`
	UnbanTime time.Time `json:"unbantime"`
}

because of PublicKey is byte

type GasFee

type GasFee struct {
	Amount      string `json:"amount"`
	TokenSymbol string `json:"token_symbol"`
	Digits      int64  `json:"digits"`
}

type GasFeeChangeResponse

type GasFeeChangeResponse struct {
	Time   []int64  `json:"time"`
	GasFee []string `json:"gas_fee"`
}

data chart

func Get15DayGasFeeChart

func Get15DayGasFeeChart() (GasFeeChangeResponse, error)

type GeneralResponse

type GeneralResponse struct {
	Total int64 `json:"total"`
	Page  int   `json:"page"`
	Limit int   `json:"limit"`
	List  any   `json:"list"`
}

func EcosystemSearch

func EcosystemSearch(search string, account string, page, limit int) (rets GeneralResponse, err error)

func Get15DayBlockSizeList

func Get15DayBlockSizeList(page, limit int) (GeneralResponse, error)

func Get15DayTxList

func Get15DayTxList(page, limit int) (GeneralResponse, error)

func GetContractTxDetailList

func GetContractTxDetailList(hashStr string, page, limit int) (*GeneralResponse, error)

func GetDailyActiveReport

func GetDailyActiveReport(page, limit int, startTime, endTime int64) (GeneralResponse, error)

func GetDaoVoteList

func GetDaoVoteList(search any, page, limit int) (GeneralResponse, error)

func GetEcosystemApp

func GetEcosystemApp(page, limit int, ecosystemId, appId int64, order, search string) (*GeneralResponse, error)

func GetEcosystemDatabase

func GetEcosystemDatabase(page, limit, reqType int, ecosystemId int64, search, order string) (*GeneralResponse, error)

GetEcosystemDatabase reqType params: 1:tableName 2:tableColumns 3:tableRows

func GetEcosystemDetailMemberList

func GetEcosystemDetailMemberList(page, limit int, order string, ecosystem int64) (*GeneralResponse, error)

func GetHonorListFromRedis

func GetHonorListFromRedis(cmd string) (*GeneralResponse, error)

func GetNewEcosystemChartList

func GetNewEcosystemChartList(page, limit int, order string) (GeneralResponse, error)

func GetNftMinerRegionList

func GetNftMinerRegionList(page, limit int) (*GeneralResponse, error)

func GetNodeBlockList

func GetNodeBlockList(search any, page, limit int, order string) (GeneralResponse, error)

func GetNodeStakingHistory

func GetNodeStakingHistory(search any, page, limit int, order string) (*GeneralResponse, error)

func GetNodeVotingHistory

func GetNodeVotingHistory(search any, page, limit int, order string) (*GeneralResponse, error)

func GetUtxoInputs

func GetUtxoInputs(hashStr string, page, limit int) (*GeneralResponse, error)

func NodeListSearch

func NodeListSearch(page, limit int, order string) (*GeneralResponse, error)

type Geometry

type Geometry struct {
	Type        string          `json:"type"`
	Coordinates [][][][]float64 `json:"coordinates"`
}

type GovernModelRatioResponse

type GovernModelRatioResponse struct {
	DAOGovernance int64           `json:"dao_governance"`
	DAORatio      decimal.Decimal `json:"dao_ratio"`
	CreatorModel  int64           `json:"creator_model"`
	CreatorRatio  decimal.Decimal `json:"creator_ratio"`
}

func GetEcosystemGovernModelChart

func GetEcosystemGovernModelChart() (GovernModelRatioResponse, error)

type HashParams

type HashParams struct {
	Hash   string
	HArray []string       //[]string{"key1", "value1", "key2", "value2",...}
	HMap   map[string]any //map[string]interface{}{"key1": "value1", "key2": value2,...}

	Value    string
	ValueMap map[string]string
}

func (*HashParams) HArraySet

func (rp *HashParams) HArraySet() error

func (*HashParams) HDel

func (rp *HashParams) HDel(keys ...string) error

HDel delete hash table keys

func (*HashParams) HExists

func (rp *HashParams) HExists(key string) (bool, error)

HExists hash table key exists

func (*HashParams) HGet

func (rp *HashParams) HGet(key string) error

func (*HashParams) HGetAll

func (rp *HashParams) HGetAll() error

func (*HashParams) HLen

func (rp *HashParams) HLen() (int64, error)

HLen return hash table keys len

func (*HashParams) HMapSet

func (rp *HashParams) HMapSet() error

func (*HashParams) HSet

func (rp *HashParams) HSet(values ...any) error

HSet example: "key1", "value1", "key2", value2 ...

func (*HashParams) HSetMapValue

func (rp *HashParams) HSetMapValue(key string, value any)

type HashTransactionResult

type HashTransactionResult struct {
	Total  int64                    `json:"total" `
	Page   int                      `json:"page" `
	Limit  int                      `json:"limit"`
	TxInfo *TxListRet               `json:"tx_info,omitempty"`
	Rets   []BlockTxDetailedInfoHex `json:"rets"`
}

type History

type History struct {
	ID               int64           `gorm:"primary_key;not null"`
	Senderid         int64           `gorm:"column:sender_id;not null"`
	Recipientid      int64           `gorm:"column:recipient_id;not null"`
	SenderBalance    decimal.Decimal `gorm:"column:sender_balance;not null"`
	RecipientBalance decimal.Decimal `gorm:"column:recipient_balance;not null"`
	Amount           decimal.Decimal `gorm:"column:amount;not null"`
	ValueDetail      string          `gorm:"column:value_detail;not null"`
	Comment          string          `gorm:"column:comment;not null"`
	Blockid          int64           `gorm:"column:block_id;not null"`
	Txhash           []byte          `gorm:"column:txhash;not null"`
	Createdat        int64           `gorm:"column:created_at;not null"`
	Ecosystem        int64           `gorm:"not null"`
	Type             int64           `gorm:"not null"`
	Status           int32           `gorm:"not null"`
}

History represent record of history table

func (*History) Get

func (th *History) Get(txHash []byte) (*HistoryMergeHex, error)

func (*History) Get24HourTxAmount

func (th *History) Get24HourTxAmount() (string, error)

func (*History) GetAccountHistoryTotals

func (th *History) GetAccountHistoryTotals(id int64, keyId int64) (*WalletHistoryHex, error)

func (*History) GetBlockRewardById

func (th *History) GetBlockRewardById(blockId int64) (*BlockListResponse, error)

func (*History) GetByHash

func (th *History) GetByHash(txHash []byte) (bool, error)

func (*History) GetByHashExist

func (th *History) GetByHashExist(txHash []byte) (bool, error)

func (*History) GetEcosystem

func (th *History) GetEcosystem(ecosystem int64) (bool, error)

func (*History) GetEcosytemWallets

func (th *History) GetEcosytemWallets(id int64, page int, size int, wallet string, searchType string) (*[]HistoryHex, int64, decimal.Decimal, error)

GetEcosytemWallets Get is retrieving model from database

func (*History) GetExplorer

func (th *History) GetExplorer(txHash []byte) (*HistoryExplorer, error)

GetExplorer Not all transactions will exist in the history table

func (*History) GetGasFeeByTxHashList

func (th *History) GetGasFeeByTxHashList(txHash [][]byte) (*BlockListResponse, error)

func (*History) GetHashSum

func (th *History) GetHashSum(txHash []byte, ecosystem int64, blockId int64) string

func (*History) GetHistory

func (th *History) GetHistory(page int, size int, order string) (*[]HistoryHex, int64, error)

GetHistory Get is retrieving model from database

func (*History) GetHistoryIdList

func (th *History) GetHistoryIdList(id int64) (*[]History, error)

func (*History) GetHistoryTimeList

func (th *History) GetHistoryTimeList(time time.Time) (*[]History, error)

func (*History) GetHistorys_Sqlite

func (th *History) GetHistorys_Sqlite(page int, size int, order string) (*[]HistoryHex, int64, error)

Get is retrieving model from database

func (*History) GetTodayCirculationsAmount

func (th *History) GetTodayCirculationsAmount() (string, error)

func (*History) GetTxListExplorer

func (th *History) GetTxListExplorer(txHash []byte) (decimal.Decimal, decimal.Decimal, error)

func (*History) GetWalletTimeLineHistoryTotals

func (th *History) GetWalletTimeLineHistoryTotals(ecosystem int64, keyId int64, getDay int) (*AccountHistoryChart, error)

func (*History) GetWalletTotals_Sqlites

func (th *History) GetWalletTotals_Sqlites(wallet string) (*WalletHistoryHex, error)

func (*History) GetWallets

func (th *History) GetWallets(page int, size int, wallet string, searchType string) (*[]HistoryHex, int64, decimal.Decimal, error)

GetWallets Get is retrieving model from database

func (*History) GetWallets_EcosytemSqlite

func (th *History) GetWallets_EcosytemSqlite(id int64, page int, size int, wallet string, searchType string) (*[]HistoryHex, int64, decimal.Decimal, error)

Get is retrieving model from database

func (*History) GetWallets_Sqlite

func (th *History) GetWallets_Sqlite(page int, size int, wallet string, searchType string) (*[]HistoryHex, int64, decimal.Decimal, error)

Get is retrieving model from database

func (*History) Get_Sqlite

func (th *History) Get_Sqlite(txHash []byte) (*HistoryMergeHex, error)

func (*History) TableName

func (th *History) TableName() string

TableName returns name of table

type HistoryExplorer

type HistoryExplorer struct {
	Fees   HistoryItem `json:"fees"`
	Taxes  HistoryItem `json:"taxes"`
	GasFee struct {
		Amount      decimal.Decimal `json:"amount"`
		Digits      int64           `json:"digits"`
		TokenSymbol string          `json:"token_symbol,omitempty"`
	} `json:"gas_fee"`
	Detail    transDetail  `json:"detail"`
	EcoDetail *ecoExplorer `json:"eco_detail,omitempty"`
	Status    int32        `json:"status"`
}

type HistoryHex

type HistoryHex struct {
	ID               int64           `json:"id,omitempty"`
	Senderid         string          `json:"sender_id"`
	Recipientid      string          `json:"recipient_id"`
	SenderBalance    decimal.Decimal `json:"sender_balance"`
	RecipientBalance decimal.Decimal `json:"recipient_balance"`
	Amount           decimal.Decimal `json:"amount"`
	Comment          string          `json:"comment"`
	BlockId          int64           `json:"block_id"`
	Txhash           string          `json:"txhash"`
	Createdat        int64           `json:"created_at"`
	Ecosystem        int64           `json:"ecosystem"`
	Type             int64           `json:"type"`
	Ecosystemname    string          `json:"ecosystemname"`
	TokenSymbol      string          `json:"token_symbol"`
	ContractName     string          `json:"contract_name"`
}

type HistoryItem

type HistoryItem struct {
	Senderid    string          `json:"sender_id"`
	Recipientid string          `json:"recipient_id"`
	Amount      decimal.Decimal `json:"amount"`
	Events      int64           `json:"events,omitempty"`
	Scale       float64         `json:"scale,omitempty"`
	Flag        int             `json:"flag,omitempty"`
	TokenSymbol string          `json:"token_symbol,omitempty"`
	Combustion  string          `json:"combustion,omitempty"`
	FuelRate    int64           `json:"fuel_rate,omitempty"`
	Digits      int64           `json:"digits"`
}

type HistoryMergeHex

type HistoryMergeHex struct {
	Ecosystem     int64           `json:"ecosystem"`
	ID            int64           `json:"id"`
	Senderid      string          `json:"sender_id"`
	Recipientid1  string          `json:"recipientid1"`
	Recipientid2  string          `json:"recipientid2,omitempty"`
	Recipientid3  string          `json:"recipientid3,omitempty"`
	Recipientid4  string          `json:"recipientid4,omitempty"`
	Amount1       decimal.Decimal `json:"amount1,omitempty"`
	Amount2       decimal.Decimal `json:"amount2,omitempty"`
	Amount3       decimal.Decimal `json:"amount3,omitempty"`
	Amount4       decimal.Decimal `json:"amount4,omitempty"`
	Comment       string          `json:"comment"`
	Blockid       int64           `json:"blockid"`
	Txhash        string          `json:"txhash"`
	Createdat     time.Time       `json:"created_at"`
	Ecosystemname string          `json:"ecosystemname"`
	TokenSymbol   string          `json:"token_symbol"`
}

type HistoryTransaction

type HistoryTransaction struct {
	ID            int64  `json:"id"`
	Keyid         string `json:"key_id"`
	Blockid       int64  `json:"block_id"`
	Txhash        string `json:"txhash"`
	Createdat     int64  `json:"created_at"`
	Ecosystem     int64  `json:"ecosystem"`
	Ecosystemname string `json:"ecosystemname"`
	ContractName  string `json:"contract_name"`
}

type Historys

type Historys []History

func (Historys) Len

func (u Historys) Len() int

func (Historys) Less

func (u Historys) Less(i, j int) bool

func (Historys) Swap

func (u Historys) Swap(i, j int)

type HonorNodeChart

type HonorNodeChart struct {
	Time          []string `json:"time"`
	HonorNode     []string `json:"honor_node"`
	CandidateNode []string `json:"candidate_node"`
}

type HonorNodeInfo

type HonorNodeInfo struct {
	ID        int64   `gorm:"primary_key;not null"`
	Value     string  `json:"value,omitempty" gorm:"not null;type:jsonb"`
	Address   string  `json:"address,omitempty" gorm:"not null"`
	Latitude  float64 `json:"latitude,omitempty" gorm:"not null"`
	Longitude float64 `json:"longitude,omitempty" gorm:"not null"`
	Display   bool    `json:"display,omitempty" gorm:"not null"`
}

func (*HonorNodeInfo) DelRedis

func (p *HonorNodeInfo) DelRedis()

func (*HonorNodeInfo) GetNodeList

func (p *HonorNodeInfo) GetNodeList() (node []storage.HonorNodeModel, err error)

func (*HonorNodeInfo) GetRedis

func (p *HonorNodeInfo) GetRedis() (bool, string)

func (*HonorNodeInfo) InsertRedis

func (p *HonorNodeInfo) InsertRedis()

func (*HonorNodeInfo) TableName

func (p *HonorNodeInfo) TableName() string

type HonorNodeListResponse

type HonorNodeListResponse struct {
	NodeName        string          `json:"node_name"`
	KeyID           string          `json:"key_id"`
	Country         string          `json:"country"`
	IconUrl         string          `json:"icon_url"`
	GasFee          string          `json:"gas_fee"`
	NodeBlocks      int64           `json:"node_blocks"`
	PkgAccountedFor decimal.Decimal `json:"pkg_accounted_for"`
	NodePosition    int64           `json:"node_position"`
	// contains filtered or unexported fields
}

type HonorNodeMapResponse

type HonorNodeMapResponse struct {
	//LatestBlock         string `json:"latest_block"`
	//LatestNodePosition  string `json:"latest_node_position"`
	//LatestConsensusMode int32  `json:"latest_consensus_mode"`
	NodePositionInfo
	List []NodePositionInfo `json:"list"`
}

func GetHonorNodeMap

func GetHonorNodeMap() (*HonorNodeMapResponse, error)

func GetHonorNodeMapFromRedis

func GetHonorNodeMapFromRedis() (*HonorNodeMapResponse, error)

type IName

type IName struct {
	Id          int64 `gorm:"primary_key;not_null"`
	Account     string
	DateCreated int64
	Ecosystem   int64
	Name        string
	TxHash      []byte
}

func (*IName) Get

func (p *IName) Get(account string) (bool, error)

func (IName) TableName

func (p IName) TableName() string

type InfoBlock

type InfoBlock struct {
	Hash           []byte `gorm:"not null"`
	EcosystemID    int64  `gorm:"not null default 0"`
	KeyID          int64  `gorm:"not null default 0"`
	NodePosition   string `gorm:"not null default 0"`
	BlockID        int64  `gorm:"not null"`
	Time           int64  `gorm:"not null"`
	CurrentVersion string `gorm:"not null"`
	Sent           int8   `gorm:"not null"`
	RollbacksHash  []byte `gorm:"not null"`
	ConsensusMode  int32  `gorm:"not null"`
}

InfoBlock is model

func (*InfoBlock) Get

func (ib *InfoBlock) Get() (bool, error)

Get is retrieving model from database

func (*InfoBlock) TableName

func (ib *InfoBlock) TableName() string

TableName returns name of table

type Key

type Key struct {
	Ecosystem int64
	ID        int64           `gorm:"primary_key;not null"`
	PublicKey []byte          `gorm:"column:pub;not null"`
	Amount    decimal.Decimal `gorm:"not null"`
	Maxpay    decimal.Decimal `gorm:"not null"`
	Deposit   decimal.Decimal `gorm:"not null"`
	Multi     int64           `gorm:"not null"`
	Deleted   int64           `gorm:"not null"`
	Blocked   int64           `gorm:"not null"`
	Account   string          `gorm:"column:account;not null"`
	Lock      string          `gorm:"column:lock;type:jsonb"`
}

Key is model

func (*Key) Get

func (m *Key) Get(id int64, wallet string) (*EcosyKeyHex, error)

func (*Key) GetAccountList

func (m *Key) GetAccountList(page, limit int, ecosystem int64) (*KeysListResult, error)

func (*Key) GetEcosystemTokenSymbolList

func (k *Key) GetEcosystemTokenSymbolList(page, limit int, ecosystem int64) (*GeneralResponse, error)

func (*Key) GetKeyDetail

func (m *Key) GetKeyDetail(keyId int64, wallet string) (*EcosyKeyTotalHex, error)

func (*Key) GetKeys

func (ts *Key) GetKeys(id int64, page int, size int, order string) (*[]KeyHex, int64, error)

func (*Key) GetStakeAmount

func (m *Key) GetStakeAmount() (string, error)

func (*Key) GetWalletTotalBasisEcosystem

func (m *Key) GetWalletTotalBasisEcosystem(wallet string) (*EcosyKeyTotalHex, error)

func (*Key) GetWalletTotalEcosystem

func (m *Key) GetWalletTotalEcosystem(page, limit int, order string, wallet string) (*GeneralResponse, error)

GetWalletTotalEcosystem response 10-20ms The modified 4-9ms

func (*Key) SetTablePrefix

func (m *Key) SetTablePrefix(prefix int64) *Key

SetTablePrefix is setting table prefix

func (Key) TableName

func (m Key) TableName() string

TableName returns name of table

type KeyChangeChart

type KeyChangeChart struct {
	Time   []int64 `json:"time"`
	NewKey []int64 `json:"new_key"`
}

type KeyHex

type KeyHex struct {
	Ecosystem     int64           `json:"ecosystem"`
	ID            string          `json:"id"`
	PublicKey     string          `json:"publickey"`
	Amount        string          `json:"amount"`
	Maxpay        decimal.Decimal `json:"maxpay"`
	Multi         int64           `json:"multi"`
	Deleted       int64           `json:"deleted"`
	Blocked       int64           `json:"blocked"`
	Ecosystemname string          `json:"ecosystemname"`
	TokenSymbol   string          `json:"token_symbol"`
}

type KeyInfoChart

type KeyInfoChart struct {
	Name      string  `json:"name,omitempty"`
	Time      []int64 `json:"time"`
	NewKey    []int64 `json:"new_key,omitempty"`
	ActiveKey []int64 `json:"active_key,omitempty"`
}

func Get15DaysNewKeyFromRedis

func Get15DaysNewKeyFromRedis(ecosystem int64) (*KeyInfoChart, error)

func GetFifteenDaysActiveKeysFromRedis

func GetFifteenDaysActiveKeysFromRedis(ecosystem int64) (*KeyInfoChart, error)

type KeyLocks

type KeyLocks struct {
	NftMinerStake       string `json:"nft_miner_stake"`
	CandidateReferendum string `json:"candidate_referendum"`
	CandidateSubstitute string `json:"candidate_substitute"`
}

type KeysListChartResult

type KeysListChartResult struct {
	KeysInfo KeysRet      `json:"keys_info"`
	KeyChart KeyInfoChart `json:"key_chart"`
}

func GetAccountListChart

func GetAccountListChart(ecosystem int64) (*KeysListChartResult, error)

type KeysListResult

type KeysListResult struct {
	Total int64          `json:"total"`
	Page  int            `json:"page"`
	Limit int            `json:"limit"`
	Rets  []EcosyKeyList `json:"rets"`
}

type KeysResult

type KeysResult struct {
	Total int64              `json:"total"`
	Page  int                `json:"page"`
	Limit int                `json:"limit"`
	Rets  []EcosyKeyTotalHex `json:"rets"`
}

type KeysRet

type KeysRet struct {
	KeyCount       int64 `json:"key_count"`
	HasTokenKey    int64 `json:"has_token_key"`
	MonthActiveKey int64 `json:"month_active_key"`
	TwentyFourKey  int64 `json:"twenty_four_key"`
}

type Language

type Language struct {
	ID         int64  `gorm:"primary_key;not null"`
	Name       string `gorm:"not null;size:100"`
	Res        string `gorm:"type:jsonb"`
	Conditions string `gorm:"not null"`
	// contains filtered or unexported fields
}

func (*Language) TableName

func (l *Language) TableName() string

type LanguagesParams

type LanguagesParams struct {
	Type  string `json:"Type"`
	Name  string `json:"Name"`
	Trans string `json:"trans"`
}

type LeaderboardSlice

type LeaderboardSlice []storage.HonorNodeModel // Sort by LeaderboardSlice.number from largest to smallest

func (LeaderboardSlice) Len

func (a LeaderboardSlice) Len() int

func (LeaderboardSlice) Less

func (a LeaderboardSlice) Less(i, j int) bool

func (LeaderboardSlice) Swap

func (a LeaderboardSlice) Swap(i, j int)

type LogTransaction

type LogTransaction struct {
	Hash         []byte `gorm:"primary_key;not null"`
	Block        int64  `gorm:"not null"`
	Timestamp    int64  `gorm:"not null"`
	ContractName string `gorm:"not null"`
	Address      int64  `gorm:"not null"`
	EcosystemID  int64  `gorm:"not null"`
	Status       int32  `gorm:"not null"`
}

LogTransaction is model

func (*LogTransaction) GetBlockFirst

func (lt *LogTransaction) GetBlockFirst(block int64) (bool, error)

func (*LogTransaction) GetBlockIdByHash

func (lt *LogTransaction) GetBlockIdByHash(hash []byte) (bool, error)

func (*LogTransaction) GetBlockTransactions

func (lt *LogTransaction) GetBlockTransactions(page int, limit int, order string, reqType int) (*[]BlockTxDetailedInfoHex, int64, error)

func (*LogTransaction) GetByHash

func (lt *LogTransaction) GetByHash(hash []byte) (bool, error)

GetByHash returns LogTransactions existence by hash

func (*LogTransaction) GetContract

func (lt *LogTransaction) GetContract(hash []byte) (bool, error)

func (*LogTransaction) GetEcosystemAccountTransaction

func (lt *LogTransaction) GetEcosystemAccountTransaction(ecosystem int64, page int, size int, wallet string, where map[string]any) (*GeneralResponse, error)

func (*LogTransaction) GetEcosystemTransactionFind

func (lt *LogTransaction) GetEcosystemTransactionFind(ecosystem int64, page, limit int, order, search string, where map[string]any) (*[]EcoTxListResponse, int64, error)

func (*LogTransaction) GetLast

func (lt *LogTransaction) GetLast() (bool, error)

func (*LogTransaction) GetStatus

func (lt *LogTransaction) GetStatus(hash []byte) (bool, error)

func (*LogTransaction) GetTxTime

func (lt *LogTransaction) GetTxTime(hash []byte) (bool, error)

func (LogTransaction) TableName

func (m LogTransaction) TableName() string

TableName returns name of table

func (*LogTransaction) UnmarshalTransaction

func (lt *LogTransaction) UnmarshalTransaction(txData []byte) (*TxDetailedInfoHex, error)

type MaxInt64

type MaxInt64 struct {
	Max int64 `gorm:"column:max"`
}

type Member

type Member struct {
	Ecosystem  int64
	ID         int64  `gorm:"primary_key;not null"`
	MemberName string `gorm:"not null"`
	ImageID    *int64
	MemberInfo string `gorm:"type:jsonb(PostgreSQL)"`
}

Member represents a ecosystem member

func (*Member) Count

func (m *Member) Count() (count int64, err error)

Count returns count of records in table

func (*Member) Get

func (m *Member) Get(account string) (bool, error)

Get init m as member with ID

func (*Member) GetAccount

func (m *Member) GetAccount(eid int64, account string) (bool, error)

func (*Member) SetTablePrefix

func (m *Member) SetTablePrefix(prefix string)

SetTablePrefix is setting table prefix

func (*Member) TableName

func (m *Member) TableName() string

TableName returns name of table

type MenuParams struct {
	Type       string `json:"Type"`
	Name       string `json:"Name"`
	Conditions string `json:"Conditions"`
	Value      string `json:"Value"`
}

type MinInt64

type MinInt64 struct {
	Min int64 `gorm:"column:min"`
}

type MineGpsInfo

type MineGpsInfo struct {
	ID          int64  `gorm:"primary_key;not null"`
	Devid       int64  `gorm:"not null"`
	Ip          string `gorm:"not null"`
	Location    string `gorm:"not null"`
	Longitude   string `gorm:"not null"`
	Latitude    string `gorm:"not null"`
	DateUpdated int64  `gorm:"not null" example:"2019-07-19 17:45:31"`
	DateCreated int64  `gorm:"not null" example:"2019-07-19 17:45:31"`
}

type MineHistoryRequest

type MineHistoryRequest struct {
	Order       string `json:"order"`
	Page        int    `json:"page"`
	Limit       int    `json:"limit"`
	EcosystemID int64  `json:"ecosystem"`
	Opt         string `json:"opt"`
	KeyId       string `json:"keyid"`
}

type MineIncomehistory

type MineIncomehistory struct {
	ID                      int64           `gorm:"primary_key;not null"`
	Devid                   int64           `gorm:"not null"`
	Keyid                   int64           `gorm:"not null"`
	Mineid                  int64           `gorm:"not null"`
	Amount                  decimal.Decimal `gorm:"not null"`
	Type                    int64           `gorm:"not null"`
	Nonce                   int64           `gorm:"not null"`
	Mine_incomehistory_hash []byte          `gorm:"not null`
	Block_id                int64           `gorm:"not null"`
	Date_created            int64           `gorm:"not null default 0"`
}

func (*MineIncomehistory) Get

func (ts *MineIncomehistory) Get(hash []byte) (bool, error)

func (*MineIncomehistory) GetID

func (m *MineIncomehistory) GetID(id int64) (bool, error)

func (*MineIncomehistory) GetRedisByhash

func (b *MineIncomehistory) GetRedisByhash(hash []byte) (bool, error)

func (*MineIncomehistory) GetRedisbyid

func (b *MineIncomehistory) GetRedisbyid(id int64) (bool, error)

func (*MineIncomehistory) Insert_redis

func (b *MineIncomehistory) Insert_redis() error

func (*MineIncomehistory) Marshal

func (b *MineIncomehistory) Marshal() ([]byte, error)

func (MineIncomehistory) TableName

func (m MineIncomehistory) TableName() string

func (*MineIncomehistory) Unmarshal

func (b *MineIncomehistory) Unmarshal(bt []byte) error

type MineInfo

type MineInfo struct {
	ID                int64  `gorm:"primary_key not null" example:"1"` //
	Devid             int64  `gorm:"not null unique" example:"1"`      //
	Number            string `gorm:"not null" example:"1"`             //
	Name              string `gorm:"not null" example:"1"`             //
	Mine_info_pub_key []byte `gorm:"not null" example:"1"`             //
	//Mine_info_pri_key        []byte `gorm:"not null" example:"1"`             //
	Mine_info_active_pub_key []byte `gorm:"not null" example:"1"` //
	//Mine_info_active_pri_key []byte `gorm:"not null" example:"1"`             //
	Active_key_id int64  `gorm:"not null" example:"1"` //
	Type          int64  `gorm:"not null" example:"1"` //
	Maxcapacity   int64  `gorm:"not null" example:"1"` //
	Capacity      int64  `gorm:"not null" example:"1"` //
	Mincapacity   int64  `gorm:"not null" example:"1"` //
	Status        int64  `gorm:"not null" example:"1"` //
	Ip            string `gorm:"not null" example:"1"` //
	Location      string `gorm:"not null" example:"1"` //
	Gps           string `gorm:"not null" example:"1"` //
	Version       string `gorm:"not null" example:"1"` //
	Ver           int64  `gorm:"not null" example:"1"` //
	Atime         int64  `gorm:"not null default 0"`   //
	ValidTime     int64  `gorm:"not null default 0"`   //
	Stime         int64  `gorm:"not null default 0"`   //
	Etime         int64  `gorm:"not null default 0"`   //
	Date_created  int64  `gorm:"not null default 0"`   //
}

MineInfo example

func (*MineInfo) GetGuardianNodeCapacity

func (m *MineInfo) GetGuardianNodeCapacity() (int64, error)

func (MineInfo) TableName

func (m MineInfo) TableName() string

TableName returns name of table

type MinePledgeStatus

type MinePledgeStatus struct {
	Id           int64
	Number       int64           `gorm:"null" example:"1"`                                        //
	Devid        int64           `gorm:"primary_key;not null" example:"1823-6253-5248-2211-6348"` //ID
	Keyid        int64           `gorm:"not null" example:"7994306939897545753"`                  //ID
	Poolid       int64           `gorm:"not null" example:"7994306939897545753"`
	MineType     int64           `gorm:"not null" example:"1"`          //
	MineNumber   string          `gorm:"not null" example:"P9Mv0FeQ73"` //
	MineCapacity int64           `gorm:"not null" example:"1"`
	Cycle        int64           `gorm:"not null" example:"30"`            //
	Amount       decimal.Decimal `gorm:"not null default 0" example:"100"` //
	Expired      int64           `gorm:"null" `
	Status       int64           `gorm:"null" example:"1"`                       //
	Online       int64           `gorm:"null" example:"1"`                       //
	Review       int64           `gorm:"null default 0" example:"1"`             //
	Count        int64           `gorm:"null default 0" example:"1"`             //
	Pledges      int64           `gorm:"null"  example:"0"`                      //
	Transfers    int64           `gorm:"null"  example:"0"`                      //
	Stime        int64           `gorm:"not null" example:"2019-07-19 17:45:31"` //
	Etime        int64           `gorm:"not null" example:"2019-07-19 17:45:31"` //
	DateUpdated  int64           `gorm:"not null" example:"2019-07-19 17:45:31"` //
	DateCreated  int64           `gorm:"not null default 0"`                     //
}

MinePledgeStatus example

func (*MinePledgeStatus) GetCastNodeandGuardianNode

func (m *MinePledgeStatus) GetCastNodeandGuardianNode() (int64, int64, int64, error)

func (MinePledgeStatus) TableName

func (MinePledgeStatus) TableName() string

TableName returns name of table

type MultiFeeEcosystemRatioResponse

type MultiFeeEcosystemRatioResponse struct {
	MultiFee        int64           `json:"multi_fee"`
	MultiFeeRatio   decimal.Decimal `json:"multi_fee_ratio"`
	UnMultiFee      int64           `json:"un_multi_fee"`
	UnMultiFeeRatio decimal.Decimal `json:"un_multi_fee_ratio"`
}

func GetMultiFeeEcosystemChart

func GetMultiFeeEcosystemChart() (MultiFeeEcosystemRatioResponse, error)

type NewKeyHistoryChart

type NewKeyHistoryChart struct {
	Time   []string `json:"time"`
	NewKey []int64  `json:"new_key"`
}

func GetNewKeysChart

func GetNewKeysChart() (NewKeyHistoryChart, error)

type NewNftChangeChartResponse

type NewNftChangeChartResponse struct {
	Time  []int64           `json:"time"`
	New   []int64           `json:"new"`
	Stake []int64           `json:"stake"`
	Ratio []decimal.Decimal `json:"ratio"`
}

func GetNewNftMinerChangeChart

func GetNewNftMinerChangeChart() (NewNftChangeChartResponse, error)

type NftMinerCoordinate

type NftMinerCoordinate struct {
	Latitude  string `json:"latitude"`
	Longitude string `json:"longitude"`
}

type NftMinerEnergyPowerChangeResponse

type NftMinerEnergyPowerChangeResponse struct {
	Time        []string `json:"time"`
	EnergyPower []string `json:"energy_power"`
}

func GetNftEnergyPowerChangeChart

func GetNftEnergyPowerChangeChart() (NftMinerEnergyPowerChangeResponse, error)

type NftMinerEvents

type NftMinerEvents struct {
	ID           int64  `gorm:"primary_key;not null"`
	TokenId      int64  `gorm:"column:token_id;not null"`
	TokenHash    []byte `gorm:"column:token_hash;not null"`
	Event        string `gorm:"column:event;not null"`
	ContractName string `gorm:"column:contract_name;not null"`
	DateCreated  int64  `gorm:"column:date_created;not null"`
	TxHash       []byte `gorm:"column:tx_hash;not null"`
	Source       string `gorm:"column:source"`
}

func (*NftMinerEvents) GetByTokenHash

func (p *NftMinerEvents) GetByTokenHash(tokenHash string) (bool, error)

func (*NftMinerEvents) GetByTokenId

func (p *NftMinerEvents) GetByTokenId(tokenId int64) (bool, error)

func (*NftMinerEvents) GetNftHistoryInfo

func (p *NftMinerEvents) GetNftHistoryInfo(search any, page, limit int, order string) (*GeneralResponse, error)

func (*NftMinerEvents) TableName

func (p *NftMinerEvents) TableName() string

type NftMinerFindRequest

type NftMinerFindRequest struct {
	Keyid string `json:"keyid"`
}

type NftMinerHistoryInfoResponse

type NftMinerHistoryInfoResponse struct {
	ID       int64  `json:"id"`
	NftId    int64  `json:"nft_id"`
	TxHash   string `json:"tx_hash"`
	NftHash  string `json:"nft_hash"`
	Time     int64  `json:"time"`
	Events   string `json:"events"`
	Contract string `json:"contract"`
	Source   string `json:"source"`
}

type NftMinerInfoChart

type NftMinerInfoChart struct {
	Count           int64 `json:"count"`
	NowStakingCount int64 `json:"now_staking_count"`
	UnStakingCount  int64 `json:"un_staking_count"`
}

type NftMinerInfoRequest

type NftMinerInfoRequest struct {
	Search any    `json:"search"` //NFT Miner ID OR NFT Miner HASH
	Order  string `json:"order"`
	Page   int    `json:"page"`
	Limit  int    `json:"limit"`
}

type NftMinerInfoResponse

type NftMinerInfoResponse struct {
	ID          int64           `json:"id"`   //NFT Miner ID
	Hash        string          `json:"hash"` //NFT Miner hash
	EnergyPoint int             `json:"energy_point"`
	StakeCount  int64           `json:"stake_count"`
	StakeAmount decimal.Decimal `json:"stake_amount"` //starking
	Owner       string          `json:"owner"`        //owner account
	Creator     string          `json:"creator"`      //owner account
	RewardCount int64           `json:"reward_count"`
	Cycle       int64           `json:"cycle"`
	DateCreated int64           `json:"date_created"` //create time
	Ins         string          `json:"ins"`
	EnergyPower int64           `json:"energy_power"`
}

type NftMinerIntervalResponse

type NftMinerIntervalResponse struct {
	Time            string `json:"time,omitempty"`
	OneToTen        int64  `json:"one_to_ten"`
	TenToTwenty     int64  `json:"ten_to_twenty"`
	TwentyToThirty  int64  `json:"twenty_to_thirty"`
	ThirtyToForty   int64  `json:"thirty_to_forty"`
	FortyToFifty    int64  `json:"forty_to_fifty"`
	FiftyToSixty    int64  `json:"fifty_to_sixty"`
	SixtyToSeventy  int64  `json:"sixty_to_seventy"`
	SeventyToEighty int64  `json:"seventy_to_eighty"`
	EightyToNinety  int64  `json:"eighty_to_ninety"`
	NinetyToHundred int64  `json:"ninety_to_hundred"`
}

func GetNftMinerIntervalChart

func GetNftMinerIntervalChart() (NftMinerIntervalResponse, error)

func GetNftMinerIntervalListChart

func GetNftMinerIntervalListChart() ([]NftMinerIntervalResponse, error)

type NftMinerItems

type NftMinerItems struct {
	ID          int64  `gorm:"primary_key;not null"`         //NFT ID
	EnergyPoint int    `gorm:"column:energy_point;not null"` //power
	Owner       string `gorm:"column:owner;not null"`        //owner account
	Creator     string `gorm:"column:creator;not null"`      //create account
	MergeCount  int64  `gorm:"column:merge_count;not null"`  //merage count
	MergeStatus int64  `gorm:"column:merge_status;not null"` //1:un merge(valid) 0:merge(invalid)
	Attributes  string `gorm:"column:attributes;not null"`   //SVG Params
	TempId      int64  `gorm:"column:temp_id;not null"`
	DateCreated int64  `gorm:"column:date_created;not null"` //create time
	Coordinates string `gorm:"column:coordinates;type:jsonb"`
	TokenHash   []byte `gorm:"column:token_hash"`
	TxHash      []byte `gorm:"column:tx_hash"`
}

func (*NftMinerItems) GetAccountDetailNftMinerInfo

func (p *NftMinerItems) GetAccountDetailNftMinerInfo(keyid, order string, page, limit int) (*AccountNftMinerListResult, error)

func (*NftMinerItems) GetAllPower

func (p *NftMinerItems) GetAllPower() (int64, error)

func (*NftMinerItems) GetById

func (p *NftMinerItems) GetById(id int64) (bool, error)

func (*NftMinerItems) GetByTokenHash

func (p *NftMinerItems) GetByTokenHash(tokenHash string) (bool, error)

func (*NftMinerItems) GetNftMetaverse

func (p *NftMinerItems) GetNftMetaverse() (*NftMinerMetaverseInfoResponse, error)

func (*NftMinerItems) GetNftMinerBySearch

func (p *NftMinerItems) GetNftMinerBySearch(search string) (NftMinerInfoResponse, error)

func (*NftMinerItems) GetNftMinerTxInfo

func (p *NftMinerItems) GetNftMinerTxInfo(search any, page, limit int, order string) (*GeneralResponse, error)

func (*NftMinerItems) NftMinerMetaverseList

func (p *NftMinerItems) NftMinerMetaverseList(page, limit int, order string) (GeneralResponse, error)

func (*NftMinerItems) ParseSvgParams

func (p *NftMinerItems) ParseSvgParams() (string, error)

func (*NftMinerItems) TableName

func (p *NftMinerItems) TableName() string

type NftMinerListResponse

type NftMinerListResponse struct {
	ID          int64           `json:"id"` //NFT Miner ID
	Hash        string          `json:"hash"`
	EnergyPoint int             `json:"energy_point"`
	Owner       string          `json:"owner"`
	StakeAmount decimal.Decimal `json:"stake_amount"`
	EnergyPower int64           `json:"energy_power"`
	Time        int64           `json:"time"`
	Ins         string          `json:"ins"`
}

type NftMinerMetaverseInfoResponse

type NftMinerMetaverseInfoResponse struct {
	Count        int64           `json:"count"`
	ValidCount   int64           `json:"valid_count"`
	BlockReward  float64         `json:"block_reward"`
	HalveNumber  int64           `json:"halve_number"`
	StakeAmounts string          `json:"stake_amounts"`
	EnergyPower  decimal.Decimal `json:"energy_power"`
	RewardAmount string          `json:"reward_amount"`
	StakedCount  int64           `json:"staked_count"`
	StakingCount int64           `json:"staking_count"`
	Region       int64           `json:"region"`
	ValidRegion  int64           `json:"valid_region"`
}

type NftMinerOverviewResponse

type NftMinerOverviewResponse struct {
	Amount string `json:"amount"`
	Time   int64  `json:"time"`
}

type NftMinerRegionListResponse

type NftMinerRegionListResponse struct {
	Region        string `json:"region"`
	Total         int64  `json:"total"`
	StakingNumber int64  `json:"staking_number"`
	StakingAmount string `json:"staking_amount"`
}

type NftMinerRet

type NftMinerRet struct {
	Count        int64   `json:"count"`
	BlockReward  float64 `json:"block_reward"`
	HalveNumber  int64   `json:"halve_number"`
	StakeAmounts string  `json:"stake_amounts"`
}

Nft Miner

type NftMinerStakeInfoResponse

type NftMinerStakeInfoResponse struct {
	ID          int64  `json:"id"`
	NftId       int64  `json:"nft_id"`
	TxHash      string `json:"tx_hash"`
	BlockId     int64  `json:"block_id"`
	Time        int64  `json:"time"`
	StakeAmount int64  `json:"stake_amount"` //starking
	Cycle       int64  `json:"cycle"`
	EnergyPower string `json:"energy_power"`
	StakeStatus bool   `json:"stake_status"`
}

type NftMinerStaking

type NftMinerStaking struct {
	ID            int64           `gorm:"primary_key;not null"`         //ID
	TokenId       int64           `gorm:"column:token_id;not null"`     //NFT Miner ID
	StakeAmount   decimal.Decimal `gorm:"column:stake_amount;not null"` //starking
	EnergyPower   int64           `gorm:"column:energy_power;not null"`
	EnergyPoint   int64           `gorm:"column:energy_point;not null"`
	Source        int64           `gorm:"column:source;not null"`      //source
	StartDated    int64           `gorm:"column:start_dated;not null"` //start time
	EndDated      int64           `gorm:"column:end_dated;not null"`   //end time
	Staker        string          `gorm:"column:staker;not null"`      //owner account
	StakingStatus int64           `gorm:"column:staking_status;not null"`
	WithdrawDate  int64           `gorm:"column:withdraw_date;not null"` //withdraw time

}

func (*NftMinerStaking) GetAllStakeAmount

func (p *NftMinerStaking) GetAllStakeAmount() (int64, decimal.Decimal, error)

func (*NftMinerStaking) GetAllStakeAmountByStaker

func (p *NftMinerStaking) GetAllStakeAmountByStaker(keyid string) (int64, string, error)

func (*NftMinerStaking) GetById

func (p *NftMinerStaking) GetById(id int64) (bool, error)

func (*NftMinerStaking) GetByTokenId

func (p *NftMinerStaking) GetByTokenId(tokenId int64) (bool, error)

func (*NftMinerStaking) GetNftMinerStakeInfo

func (p *NftMinerStaking) GetNftMinerStakeInfo(search any, page, limit int, order string) (*GeneralResponse, error)

func (*NftMinerStaking) GetNftStakeByTokenId

func (p *NftMinerStaking) GetNftStakeByTokenId(tokenId int64) (bool, error)

func (*NftMinerStaking) TableName

func (p *NftMinerStaking) TableName() string

type NftMinerStakingChangeResponse

type NftMinerStakingChangeResponse struct {
	Time        []string `json:"time"`
	StakeAmount []int64  `json:"stake_amount"`
	Number      []int64  `json:"number"`
}

func GetNftMinerStakedChangeChart

func GetNftMinerStakedChangeChart() (NftMinerStakingChangeResponse, error)

type NftMinerSummaryResponse

type NftMinerSummaryResponse struct {
	NftMinerCount int64  `json:"nft_miner_count"`
	EnergyPower   int64  `json:"energy_power"`
	NftMinerIns   string `json:"nft_miner_ins"`
	StakeAmount   string `json:"stake_amount"`
}

type NftMinerTxInfoResponse

type NftMinerTxInfoResponse struct {
	ID      int64  `json:"id"`
	NftId   int64  `json:"nft_id"`
	BlockId int64  `json:"block_id"`
	Time    int64  `json:"time"`
	Ins     string `json:"ins"`
	Account string `json:"account"`
}

type NodeBlockListResponse

type NodeBlockListResponse struct {
	BlockId   int64  `json:"block_id"`
	Time      int64  `json:"time"`
	Tx        int32  `json:"tx"`
	EcoNumber int    `json:"eco_number"`
	GasFee1   GasFee `json:"gas_fee_1"` //IBXC
	GasFee2   GasFee `json:"gas_fee_2"`
	GasFee3   GasFee `json:"gas_fee_3"`
	GasFee4   GasFee `json:"gas_fee_4"`
	GasFee5   GasFee `json:"gas_fee_5"`
}

type NodeChangeResponse

type NodeChangeResponse struct {
	HonorNodeChart
	NewHonor []string `json:"new_honor"` //need add
}

func GetNodeChangeChart

func GetNodeChangeChart() (NodeChangeResponse, error)

type NodeContributionChartResponse

type NodeContributionChartResponse struct {
	Country   []string `json:"country"`
	NodeBlock []int64  `json:"node_block"`
}

func GetNodeContributionChart

func GetNodeContributionChart() (NodeContributionChartResponse, error)

type NodeContributionListResponse

type NodeContributionListResponse struct {
	Total int64                   `json:"total"`
	Page  int                     `json:"page"`
	Limit int                     `json:"limit"`
	List  []HonorNodeListResponse `json:"list"`
}

func GetNodeContributionList

func GetNodeContributionList(page, limit int) (NodeContributionListResponse, error)

type NodeDetailResponse

type NodeDetailResponse struct {
	NodeListResponse
	StakeRate string `json:"stake_rate"`
	Account   string `json:"account"`
}

func NodeDetail

func NodeDetail(id int64) (NodeDetailResponse, error)

type NodeInfo

type NodeInfo struct {
	ApiAddress string `json:"api_address"`
	PublicKey  string `json:"public_key"`
	TcpAddress string `json:"tcp_address"`
}

type NodeListResponse

type NodeListResponse struct {
	Ranking        int64  `json:"ranking"`
	Id             int64  `json:"id"`
	IconUrl        string `json:"icon_url"`
	Name           string `json:"name"`
	Website        string `json:"website"`
	ApiAddress     string `json:"api_address"`
	Address        string `json:"address"`
	Packed         int64  `json:"packed"`
	PackedRate     string `json:"packed_rate"`
	Vote           string `json:"vote"`
	VoteRate       string `json:"vote_rate"`
	VoteTrend      int    `json:"vote_trend"` //0:unknown 1:Up 2:Down 3:Equal
	Staking        string `json:"staking"`
	FrontCommittee bool   `json:"front_committee"`
	Committee      bool   `json:"committee"`
}

type NodeMapResponse

type NodeMapResponse struct {
	CandidateTotal int64         `json:"candidate_total"`
	HonorTotal     int64         `json:"honor_total"`
	NodeList       []Positioning `json:"node_list"`
}

Node Related

type NodePositionInfo

type NodePositionInfo struct {
	Id            int64  `json:"id"`
	NodeName      string `json:"node_name"`
	Latitude      string `json:"latitude"`
	Longitude     string `json:"longitude"`
	NodePosition  string `json:"node_position"`
	Block         string `json:"block"`
	NodeBlock     string `json:"node_block"`
	ConsensusMode int32  `json:"consensus_mode"`
	ApiAddress    string `json:"api_address"`
}

type NodeStakingChangeResponse

type NodeStakingChangeResponse struct {
	Time    []string `json:"time"`
	Staking []string `json:"staking"`
}

type NodeStakingHistoryResponse

type NodeStakingHistoryResponse struct {
	Id      int64  `json:"id"`
	TxHash  string `json:"tx_hash"`
	Address string `json:"address"`
	Time    int64  `json:"time"`
	Events  int64  `json:"events"`
	Amount  string `json:"amount"`
}

type NodeValue

type NodeValue struct {
	Id            int64  `json:"id"`
	NodeName      string `json:"node_name"`
	ApiAddress    string `json:"api_address"`
	Vote          int64  `json:"vote"`
	ConsensusMode int32  `json:"consensus_mode"`
	IsHonor       bool   `json:"is_honor"`
}

type NodeVoteChangeResponse

type NodeVoteChangeResponse struct {
	Time []int64  `json:"time"`
	Vote []string `json:"vote"`
}

type NodeVoteHistoryResponse

type NodeVoteHistoryResponse struct {
	Vote int64 `json:"vote"`
	NodeStakingHistoryResponse
}

type NodeVoteResponse

type NodeVoteResponse struct {
	VoteInfo
	Result int `json:"result"` //vote result
	Status int `json:"status"` //node vote status
}

type NullType

type NullType byte
const (

	// IsNull the same as `is null`
	IsNull NullType
	// IsNotNull the same as `is not null`
	IsNotNull
)

type OptionalInfo

type OptionalInfo struct {
	ContractAccept string `json:"contract_accept"`
	ContractReject string `json:"contract_reject"`
}

type PageParams

type PageParams struct {
	Id         int64  `json:"id,omitempty"`
	Type       string `json:"Type"`
	Name       string `json:"Name"`
	Value      string `json:"Value"`
	Conditions string `json:"Conditions"`
	Menu       string `json:"Menu"`
}

type PlatformParameter

type PlatformParameter struct {
	ID         int64  `gorm:"primary_key;not null;" json:"id"`
	Name       string `gorm:"not null;size:255" json:"name"`
	Value      string `gorm:"not null" json:"value"`
	Conditions string `gorm:"not null" json:"conditions"`
}

PlatformParameter is model

func (*PlatformParameter) FindAppParameters

func (sp *PlatformParameter) FindAppParameters(page int, size int, name, order string) (num int64, rets []PlatformParameter, err error)

func (*PlatformParameter) Get

func (sp *PlatformParameter) Get(name string) (bool, error)

Get is retrieving model from database

func (*PlatformParameter) GetJSONField

func (sp *PlatformParameter) GetJSONField(jsonField string, name string) (string, error)

GetJSONField returns fields as json

func (*PlatformParameter) GetValueParameterByName

func (sp *PlatformParameter) GetValueParameterByName(name, value string) (*string, error)

GetValueParameterByName returns value parameter by name

func (PlatformParameter) TableName

func (sp PlatformParameter) TableName() string

TableName returns name of table

func (*PlatformParameter) ToMap

func (sp *PlatformParameter) ToMap() map[string]string

ToMap is converting PlatformParameter to map

type Point

type Point struct {
	Lat float64 `json:"lat"`
	Lng float64 `json:"lng"`
}

Represents a Physical Point in geographic notation [lat, lng].

func NewPoint

func NewPoint(lat float64, lng float64) *Point

NewPoint returns a new Point populated by the passed in latitude (lat) and longitude (lng) values.

func (*Point) BearingTo

func (p *Point) BearingTo(p2 *Point) float64

BearingTo: Calculates the initial bearing (sometimes referred to as forward azimuth) Original Implementation from: http://www.movable-type.co.uk/scripts/latlong.html

func (*Point) GreatCircleDistance

func (p *Point) GreatCircleDistance(p2 *Point) float64

GreatCircleDistance: Calculates the Haversine distance between two points in kilometers. Original Implementation from: http://www.movable-type.co.uk/scripts/latlong.html

func (*Point) Latitude

func (p *Point) Latitude() float64

Lat returns Point p's latitude.

func (*Point) Longitude

func (p *Point) Longitude() float64

Lng returns Point p's longitude.

func (*Point) MarshalBinary

func (p *Point) MarshalBinary() ([]byte, error)

MarshalBinary renders the current point to a byte slice. Implements the encoding.BinaryMarshaler Interface.

func (*Point) MarshalJSON

func (p *Point) MarshalJSON() ([]byte, error)

MarshalJSON renders the current Point to valid JSON. Implements the json.Marshaller Interface.

func (*Point) MidpointTo

func (p *Point) MidpointTo(p2 *Point) *Point

MidpointTo: Calculates the midpoint between 'this' point and the supplied point. Original implementation from http://www.movable-type.co.uk/scripts/latlong.html

func (*Point) PointAtDistanceAndBearing

func (p *Point) PointAtDistanceAndBearing(dist float64, bearing float64) *Point

PointAtDistanceAndBearing returns a Point populated with the lat and lng coordinates by transposing the origin point the passed in distance (in kilometers) by the passed in compass bearing (in degrees). Original Implementation from: http://www.movable-type.co.uk/scripts/latlong.html

func (*Point) UnmarshalBinary

func (p *Point) UnmarshalBinary(data []byte) error

func (*Point) UnmarshalJSON

func (p *Point) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes the current Point from a JSON body. Throws an error if the body of the point cannot be interpreted by the JSON body

type Polygon

type Polygon struct {
	Points []*Point `json:"points"`
}

A Polygon is carved out of a 2D plane by a set of (possibly disjoint) contours. It can thus contain holes, and can be self-intersecting.

func NewPolygon

func NewPolygon(points []*Point) *Polygon

NewPolygon: Creates and returns a new pointer to a Polygon composed of the passed in points. Points are considered to be in order such that the last point forms an edge with the first point.

func (*Polygon) Add

func (p *Polygon) Add(point *Point)

Add: Appends the passed in contour to the current Polygon.

func (*Polygon) Contains

func (p *Polygon) Contains(point *Point) bool

Contains returns whether or not the current Polygon contains the passed in Point.

func (*Polygon) IsClosed

func (p *Polygon) IsClosed() bool

IsClosed returns whether or not the polygon is closed. TODO: This can obviously be improved, but for now,

this should be sufficient for detecting if points
are contained using the raycast algorithm.

func (*Polygon) Points2

func (p *Polygon) Points2() []*Point

Points returns the points of the current Polygon.

type Positioning

type Positioning struct {
	Lat string `json:"lat"`
	Lng string `json:"lng"`
	Val string `json:"val"` //value
}

type ProgressInfo

type ProgressInfo struct {
	NumberVoters       int    `json:"number_voters"`
	PercentVoters      int    `json:"percent_voters"`
	PercentSuccess     int    `json:"percent_success"`
	NumberParticipants string `json:"number_participants"`
}

type RatesInfo

type RatesInfo struct {
	Base      string         `json:"base"`
	Timestamp int64          `json:"timestamp"`
	Rates     map[string]any `json:"rates"`
}

type RedisParams

type RedisParams struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

func (*RedisParams) Del

func (rp *RedisParams) Del() error

func (*RedisParams) Exist

func (rp *RedisParams) Exist() (bool, error)

func (*RedisParams) Get

func (rp *RedisParams) Get() error

func (*RedisParams) Set

func (rp *RedisParams) Set() error

func (*RedisParams) SetExpire

func (rp *RedisParams) SetExpire(expire time.Duration) error

func (*RedisParams) Size

func (rp *RedisParams) Size() (int64, error)

func (*RedisParams) TTL

func (rp *RedisParams) TTL() (time.Duration, error)

type RefreshObject

type RefreshObject struct {
	Key       string
	Ecosystem int64
	Cmd       int //0:start 1:over
}

type RegionChangeResponse

type RegionChangeResponse struct {
	Time []any   `json:"time"`
	List [][]any `json:"list"`
}

func GetTopTwentyNftRegionChart

func GetTopTwentyNftRegionChart(limit int) (*RegionChangeResponse, error)

type ResponseDashboardTitle

type ResponseDashboardTitle struct {
	Cmd  string `json:"cmd,omitempty"`
	List any    `json:"list,omitempty"`
}

type ResponseTopDataBoby

type ResponseTopDataBoby struct {
	TopData           any `json:"topdata,omitempty"`
	TopBlocks         any `json:"topblocks,omitempty"`
	TopTransactions   any `json:"toptransactions,omitempty"`
	TopTransactiontps any `json:"toptransactiontps,omitempty"`
}

type ResultsInfo

type ResultsInfo struct {
	RatingAccepted  string `json:"rating_accepted"`
	RatingRejected  string `json:"rating_rejected"`
	PercentAccepted string `json:"percent_accepted"`
	PercentRejected string `json:"percent_rejected"`
}

type ScanOut

type ScanOut struct {
	BlockSizes        int64
	BlockTransactions int64
	Hash              string
	RollbacksHash     string
	KeyID             string
	NodePosition      int64
	ConsensusMode     int32
	Time              int64
	CurrentVersion    string

	TotalCounts          int64 //total count power
	BlockTransactionSize int64
	HonorNode            int64 //honorNode number
	CastNodes            int64
	SubNodes             int64
	CLBNodes             int64

	MintAmounts string

	BlockId         int64
	MaxTps          int32
	MaxBlockSize    string
	StorageCapacity string

	TotalTx         int64
	TwentyFourTx    int64
	WeekAverageTx   int64
	MaxActiveEcoLib string
	SingleDayMaxTx  int64

	Circulations            string
	TodayCirculationsAmount string
	TwentyFourAmount        string

	NftMinerCount   int64
	NftBlockReward  float64
	HalveNumber     int64
	NftStakeAmounts string

	EcoLibsInfo       EcoLibsRet
	KeysInfo          KeysRet
	CandidateNodeInfo CandidateHonorNodeRet
}

func (*ScanOut) Changes

func (ret *ScanOut) Changes() error

func (*ScanOut) GetDashboardFromRedis

func (m *ScanOut) GetDashboardFromRedis() (*ScanOutRet, error)

func (*ScanOut) GetRedisLatest

func (m *ScanOut) GetRedisLatest() (bool, error)

func (*ScanOut) InsertRedis

func (m *ScanOut) InsertRedis() error

func (*ScanOut) Marshal

func (s *ScanOut) Marshal() ([]byte, error)

func (*ScanOut) Unmarshal

func (s *ScanOut) Unmarshal(bt []byte) error

type ScanOutBlockTransactionRet

type ScanOutBlockTransactionRet struct {
	BlockId           int64 `json:"block_id"`            //
	BlockSizes        int64 `json:"block_size" `         //
	BlockTransactions int64 `json:"block_transactions" ` //
}

func (*ScanOutBlockTransactionRet) Marshal

func (*ScanOutBlockTransactionRet) Unmarshal

type ScanOutRet

type ScanOutRet struct {
	BlockId           int64  `json:"block_id"`    //Block Id
	BlockSizes        int64  `json:"block_sizes"` //Block Size
	BlockTransactions int64  `json:"block_transactions"`
	Hash              string `json:"hash"`
	RollbacksHash     string `json:"rollbacks_hash"`
	EcosystemID       int64  `json:"ecosystem_id"`
	KeyID             string `json:"key_id"`
	NodePosition      int64  `json:"node_position"`
	ConsensusMode     int32  `json:"consensus_mode"`
	Time              int64  `json:"time"`
	CurrentVersion    string `json:"current_version"`

	TotalCounts          int64  `json:"total_counts"` //total count
	BlockTransactionSize int64  `json:"block_transaction_size"`
	GuardianNodes        int64  `json:"guardian_nodes"`
	SubNodes             int64  `json:"sub_nodes"`
	CLBNodes             int64  `json:"clb_nodes"`
	MintAmounts          string `json:"mint_amount"`

	BlockInfo         BlockRet              `json:"block_info"`
	TxInfo            TxRet                 `json:"tx_info"`
	CirculationsInfo  CirculationsRet       `json:"circulations_info"`
	NftMinerInfo      NftMinerRet           `json:"nft_miner_info"`
	EcoLibsInfo       EcoLibsRet            `json:"eco_libs_info"`
	KeysInfo          KeysRet               `json:"keys_info"`
	CandidateNodeInfo CandidateHonorNodeRet `json:"candidate_node_info"`
	CastNodeInfo      CastNodeRet           `json:"cast_node_info"` //todo:Need Add
	Digits            int64                 `json:"digits"`
}

type SearchHashResponse

type SearchHashResponse struct {
	HashType int `json:"hash_type"`
}

func SearchHash

func SearchHash(hash string) (SearchHashResponse, error)

type SnippetsParams

type SnippetsParams struct {
	Id         int64  `json:"id,omitempty"`
	Type       string `json:"Type"`
	Name       string `json:"Name"`
	Value      string `json:"Value"`
	Conditions string `json:"Conditions"`
}

type SpentInfo

type SpentInfo struct {
	InputTxHash  []byte `gorm:"default:(-)"`
	InputIndex   int32
	OutputTxHash []byte `gorm:"not null"`
	OutputIndex  int32  `gorm:"not null"`
	OutputKeyId  int64  `gorm:"not null"`
	OutputValue  string `gorm:"not null"`
	Ecosystem    int64
	BlockId      int64
	Type         int64
}

SpentInfo is model

func (*SpentInfo) GetAmountByKeyId

func (si *SpentInfo) GetAmountByKeyId(keyId int64, ecosystem int64) (decimal.Decimal, error)

func (*SpentInfo) GetExplorer

func (si *SpentInfo) GetExplorer(txHash []byte) (*UtxoExplorer, error)

func (*SpentInfo) GetFirst

func (si *SpentInfo) GetFirst(blockId int64) (bool, error)

func (*SpentInfo) GetInputs

func (si *SpentInfo) GetInputs(txHash []byte, page, limit int) (rlts []utxoDetail, total int64, err error)

func (*SpentInfo) GetLast

func (si *SpentInfo) GetLast() (bool, error)

func (*SpentInfo) GetOutputKeysByBlockId

func (p *SpentInfo) GetOutputKeysByBlockId(blockId int64) (outputKeys []SpentInfo, err error)

func (*SpentInfo) GetOutputs

func (si *SpentInfo) GetOutputs(txHash []byte) (rlts []utxoDetail, list []SpentInfo, err error)

func (*SpentInfo) TableName

func (si *SpentInfo) TableName() string

TableName returns name of table

func (*SpentInfo) UnmarshalTransaction

func (si *SpentInfo) UnmarshalTransaction(txData []byte) (*UtxoExplorerInfo, error)

type SpentInfoHistory

type SpentInfoHistory struct {
	Id               int64  `gorm:"primary_key;not null"`
	SenderId         int64  `gorm:"column:sender_id;not null"`
	RecipientId      int64  `gorm:"column:recipient_id;not null"`
	SenderBalance    string `gorm:"type:decimal(30);default:'0';not null"`
	RecipientBalance string `gorm:"type:decimal(30);default:'0';not null"`
	Amount           string `gorm:"column:amount;type:decimal(30);default:'0';not null"`
	Block            int64  `gorm:"column:block;not null;index"`
	Hash             []byte `gorm:"column:hash;not null;index"`
	CreatedAt        int64  `gorm:"column:created_at;not null"`
	Ecosystem        int64  `gorm:"not null"`
	Type             int    `gorm:"not null"` //1:UTXO_TransferSelf 2:UTXO_Tx 3:fees 4:taxes 5:startUp 6:combustion
	SubType          int    `gorm:"not null"` //type is 1 then 1:AccountUTXO 2:UTXO-Account
}

func (*SpentInfoHistory) CreateTable

func (p *SpentInfoHistory) CreateTable() (err error)

func (*SpentInfoHistory) GetKeyBalance

func (p *SpentInfoHistory) GetKeyBalance(keyId int64, ecosystem int64) (balance decimal.Decimal, err error)

func (*SpentInfoHistory) GetLast

func (p *SpentInfoHistory) GetLast() (bool, error)

func (*SpentInfoHistory) RollbackOne

func (p *SpentInfoHistory) RollbackOne() error

func (*SpentInfoHistory) RollbackTransaction

func (p *SpentInfoHistory) RollbackTransaction() error

func (*SpentInfoHistory) TableName

func (p *SpentInfoHistory) TableName() string

type StakingAccountResponse

type StakingAccountResponse struct {
	Account      string          `json:"account" gorm:"column:account"`
	StakeAmount  decimal.Decimal `json:"stake_amount" gorm:"column:stake_amount"`
	AccountedFor decimal.Decimal `json:"accounted_for"`
}

func GetTopTenStakingAccount

func GetTopTenStakingAccount() ([]StakingAccountResponse, error)

type StateParameter

type StateParameter struct {
	ID         int64  `gorm:"primary_key;not null" json:"id"`
	Name       string `gorm:"not null;size:100" json:"name"`
	Value      string `gorm:"not null" json:"value"`
	Conditions string `gorm:"not null" json:"conditions"`
	// contains filtered or unexported fields
}

StateParameter is model

func (*StateParameter) FindStateParameters

func (sp *StateParameter) FindStateParameters(page int, size int, name, order string, ecosystem int64) (num int64, rets []StateParameter, err error)

func (*StateParameter) Get

func (sp *StateParameter) Get(name string) (bool, error)

Get is retrieving model from database

func (*StateParameter) GetMintAmount

func (sp *StateParameter) GetMintAmount() (string, error)

Get is retrieving model from database

func (*StateParameter) SetTableFix

func (sp *StateParameter) SetTableFix(fix int64)

SetTablePrefix is setting table prefix

func (*StateParameter) SetTablePrefix

func (sp *StateParameter) SetTablePrefix(prefix string)

SetTablePrefix is setting table prefix

func (*StateParameter) TableName

func (sp *StateParameter) TableName() string

TableName returns name of table

type StatisticsData

type StatisticsData struct {
	AllTransactionsNum int64 `json:"transactions"`
	ChainContractsNum  int64 `json:"contracts"`
	GuardNode          int64 `json:"node"`
	StorageCapacity    int64 `json:"storage"`
	EcosystemsNum      int64 `json:"ecosystems"`
}

type StorageCapacitysChart

type StorageCapacitysChart struct {
	Name             string   `json:"name,omitempty"` //ecosystem name
	Time             []int64  `json:"time"`
	StorageCapacitys []string `json:"storage_capacitys"`
}

func Get15DayBlockSizeChart

func Get15DayBlockSizeChart() (StorageCapacitysChart, error)

func Get15DaysStorageCapacityFromRedis

func Get15DaysStorageCapacityFromRedis(ecosystem int64) (*StorageCapacitysChart, error)

type StrReplaceStruct

type StrReplaceStruct struct {
	CapitalLetter    int `json:"capital_letter"`
	LowercaseLetters int `json:"lowercase_letters"`
	Number           int `json:"number"`
	OtherString      int `json:"other_string"`
}

type SubjectInfo

type SubjectInfo struct {
	ContractAccept       string `json:"contract_accept"`
	ContractReject       string `json:"contract_reject"`
	ContractAcceptParams struct {
		Value          string `json:"Value"`
		VotingId       int    `json:"VotingId"`
		Conditions     string `json:"Conditions"`
		TemplateId     int    `json:"TemplateId"`
		ApplicationId  int    `json:"ApplicationId"`
		TokenEcosystem int    `json:"TokenEcosystem"`
	} `json:"contract_accept_params"`
	ContractRejectParams struct {
	} `json:"contract_reject_params"`
}

type SumAmount

type SumAmount struct {
	Sum decimal.Decimal `gorm:"column:sum"`
}

type SumInt64

type SumInt64 struct {
	Sum int64 `gorm:"column:sum"`
}

type SvgParams

type SvgParams struct {
	Owner       string `json:"owner"`
	Point       string `json:"point"`
	Number      int64  `json:"number"`
	Location    string `json:"location"`
	DateCreated int64  `json:"date_created"` //milliseconds
}

type SystemParameterResult

type SystemParameterResult struct {
	Total int64               `json:"total"`
	Page  int                 `json:"page"`
	Limit int                 `json:"limit"`
	Rets  []PlatformParameter `json:"rets"`
}

type TableModel

type TableModel struct {
	ID           int64     `gorm:"primary_key;not_null" json:"id" `
	NodePosition int64     `gorm:"not null" json:"nodeposition"`
	Enable       bool      `gorm:"not null" json:"enable"`
	Fmode        int       `gorm:"not null" json:"fmode"` //  <0      1  id    2    3
	Smode        bool      `gorm:"not null" json:"smode"` //  false no flash   true flash  memory
	Name         string    `gorm:"not null" json:"name"`
	Time         time.Time `gorm:"not null" json:"time"`
	Dataid       int64     `gorm:"not null" json:"id"`
	Count        int       `gorm:"not null" json:"count"`
	Updatetime   int       `gorm:"not null" json:"updatetime"`
}

redisModel get redis information from config.yml

type TableParams

type TableParams struct {
	Id          int64  `json:"id,omitempty"`
	Type        string `json:"Type"`
	Name        string `json:"Name"`
	Columns     string `json:"Columns"`
	Permissions string `json:"Permissions"`
	Conditions  string `json:"conditions"`
}

type TableShowModel

type TableShowModel struct {
	ID     int    `gorm:"primary_key;not_null" json:"id" `
	Name   string `gorm:"not null" json:"name"`
	Cmdsql string `gorm:"not null" json:"_"`
}

type TokenEcosystemResponse

type TokenEcosystemResponse struct {
	Emission        int64           `json:"emission"`
	EmissionRatio   decimal.Decimal `json:"emission_ratio"`
	UnEmission      int64           `json:"un_emission"`
	UnEmissionRatio decimal.Decimal `json:"un_emission_ratio"`
}

func GetTokenEcosystemRatioChart

func GetTokenEcosystemRatioChart() (TokenEcosystemResponse, error)

type TotalResult

type TotalResult struct {
	Total int64 `json:"total"`
}

type Transaction

type Transaction struct {
	Hash     []byte          `gorm:"private_key;not null"`
	Data     []byte          `gorm:"not null"`
	Used     int8            `gorm:"not null"`
	HighRate transactionRate `gorm:"not null"`
	Expedite decimal.Decimal `gorm:"not null"`
	Type     int8            `gorm:"not null"`
	KeyID    int64           `gorm:"not null"`
	Sent     int8            `gorm:"not null"`
	Verified int8            `gorm:"not null"`
	Time     int64           `gorm:"not null"`
}

func (*Transaction) TableName

func (p *Transaction) TableName() string

TableName returns name of table

type TransactionData

type TransactionData struct {
	Hash   []byte `gorm:"primary_key;not null;index"`
	Block  int64  `gorm:"not null;index"`
	TxData []byte `gorm:"not null"`
	TxTime int64  `gorm:"not null"`
	Type   int    `gorm:"not null"` //type 1:utxo transaction 0:contract transaction
}

func (*TransactionData) CreateTable

func (p *TransactionData) CreateTable() (err error)

func (*TransactionData) GetByHash

func (p *TransactionData) GetByHash(hash []byte) (bool, error)

func (*TransactionData) GetFirstByType

func (p *TransactionData) GetFirstByType(blockId int64, txType int) (bool, error)

func (*TransactionData) GetLast

func (p *TransactionData) GetLast() (bool, error)

func (*TransactionData) GetLastByType

func (p *TransactionData) GetLastByType(txType int) (bool, error)

func (*TransactionData) GetTxDataByHash

func (p *TransactionData) GetTxDataByHash(hash []byte) (bool, error)

func (*TransactionData) RollbackOne

func (p *TransactionData) RollbackOne() error

func (*TransactionData) RollbackTransaction

func (p *TransactionData) RollbackTransaction() error

func (*TransactionData) TableName

func (p *TransactionData) TableName() string

type TransactionHistoryHex

type TransactionHistoryHex struct {
	Name      string  `json:"name,omitempty"`
	Latitude  float64 `json:"latitude,omitempty"`
	Longitude float64 `json:"longitude,omitempty"`
}

type TransactionList

type TransactionList struct {
	Hash         string `json:"hash"`
	Time         int64  `json:"time"`
	ContractName string `json:"contract_name"`
}

type TransactionListResponse

type TransactionListResponse struct {
	Hash     string `json:"hash"`
	Block    int64  `json:"block"`
	Time     int64  `json:"time"`
	Address  int64  `json:"address"`
	Name     string `json:"name"`
	Contract string `json:"contract"`
}

type TransactionRelation

type TransactionRelation struct {
	Hash         []byte `gorm:"column:hash;not null;index"`
	SenderIds    string `gorm:"column:sender_ids;not null"`
	RecipientIds string `gorm:"column:recipient_ids"`
	Ecosystem    int64  `gorm:"column:ecosystem;not null"`
	Block        int64  `gorm:"column:block;not null;index"`
	CreatedAt    int64  `gorm:"column:created_at;not null"`
}

func (*TransactionRelation) CreateIndex

func (p *TransactionRelation) CreateIndex() error

func (*TransactionRelation) CreateTable

func (p *TransactionRelation) CreateTable() (err error)

func (*TransactionRelation) GetLast

func (p *TransactionRelation) GetLast() (bool, error)

func (*TransactionRelation) RollbackOne

func (p *TransactionRelation) RollbackOne() error

func (*TransactionRelation) RollbackTransaction

func (p *TransactionRelation) RollbackTransaction() error

func (*TransactionRelation) TableName

func (p *TransactionRelation) TableName() string

type TransactionStatus

type TransactionStatus struct {
	Hash      []byte `gorm:"primary_key;not null"  json:"hash"`
	Time      int64  `gorm:"not null" json:"time"`
	Type      int64  `gorm:"not null"  json:"type"`
	Ecosystem int64  `gorm:"not null"  json:"ecosystem"`
	WalletID  int64  `gorm:"not null"  json:"wallet_id"`
	BlockID   int64  `gorm:"not null;index:tsblockid_idx"  json:"block_id"`
	Error     string `gorm:"not null"  json:"error"`
	Penalty   int64  `gorm:"not null"  json:"penalty"`
}

TransactionStatus is model

func (*TransactionStatus) BatchInsert_Sqlites

func (ts *TransactionStatus) BatchInsert_Sqlites(objArr *[]TransactionStatus) error

func (*TransactionStatus) BatchUpdate_Sqlite

func (ts *TransactionStatus) BatchUpdate_Sqlite(reportForms *[]TransactionStatus) error

func (*TransactionStatus) BatchinsertSqlite

func (ts *TransactionStatus) BatchinsertSqlite(objArr *[]TransactionStatus) error

func (*TransactionStatus) Create

func (ts *TransactionStatus) Create() error

func (*TransactionStatus) Create_Sqlite

func (ts *TransactionStatus) Create_Sqlite() error

func (*TransactionStatus) DBconnGetcount_Sqlite

func (ts *TransactionStatus) DBconnGetcount_Sqlite() (int64, error)

func (*TransactionStatus) DbconnbatchinsertSqlites

func (ts *TransactionStatus) DbconnbatchinsertSqlites(objArr *[]TransactionStatus) error

func (*TransactionStatus) DbconngetSqlite

func (ts *TransactionStatus) DbconngetSqlite(transactionHash []byte) (bool, error)

func (*TransactionStatus) Get

func (ts *TransactionStatus) Get(transactionHash []byte) (bool, error)

func (*TransactionStatus) GetNodecount

func (ts *TransactionStatus) GetNodecount(db *gorm.DB) (int64, error)

func (*TransactionStatus) GetTimelimit

func (ts *TransactionStatus) GetTimelimit(time time.Time) (*[]TransactionStatus, error)

func (*TransactionStatus) GetTimelimit_Sqlite

func (ts *TransactionStatus) GetTimelimit_Sqlite(time time.Time) (*[]TransactionStatus, error)

func (*TransactionStatus) GetTransactions

func (ts *TransactionStatus) GetTransactions(page int, size int, order string) (*[]TransactionStatusHex, int64, error)

func (*TransactionStatus) Get_Sqlite

func (ts *TransactionStatus) Get_Sqlite(transactionHash []byte) (bool, error)

func (*TransactionStatus) Getcount

func (ts *TransactionStatus) Getcount() (int64, error)

func (*TransactionStatus) Getcount_Sqlite

func (ts *TransactionStatus) Getcount_Sqlite() (int64, error)

func (*TransactionStatus) TableName

func (ts *TransactionStatus) TableName() string

TableName returns name of table

type TransactionStatusHex

type TransactionStatusHex struct {
	Hash          string `gorm:"primary_key;not null" json:"hash"`
	Time          int64  `gorm:"not null" json:"time"`
	Type          int64  `gorm:"not null" json:"type"`
	WalletID      string `gorm:"not null" json:"wallet_id"`
	BlockID       int64  `gorm:"not null" json:"block_id"`
	Error         string `gorm:"not null" json:"err"`
	Penalty       int64  `gorm:"not null"  json:"penalty"`
	Ecosystemname string `json:"ecosystemname"`
	TokenSymbol   string `json:"token_symbol"`
	Ecosystem     int64  `json:"ecosystem"`
}

type TransactionsResponse

type TransactionsResponse struct {
	CountResponse
	List []*Transaction `json:"list"`
}

func GetQueueTransactions

func GetQueueTransactions(reqUrl string, page, limit int) (*TransactionsResponse, error)

GetQueueTransactions get queue transactions from node

type TransactionsStatusResponse

type TransactionsStatusResponse struct {
	CountResponse
	List []TransactionStatus `json:"list"`
}

type TxChangeChart

type TxChangeChart struct {
	Time []int64 `json:"time"`
	Tx   []int64 `json:"tx"`
}

type TxDetailedInfo

type TxDetailedInfo struct {
	Hash         []byte         `json:"hash"`
	ContractName string         `json:"contract_name"`
	Params       map[string]any `json:"params"`
	KeyID        int64          `json:"key_id"`
	Time         int64          `json:"time"`
	Type         int64          `json:"type"`
}

type TxDetailedInfoHeadResponse

type TxDetailedInfoHeadResponse struct {
	BlockID      int64  `json:"block_id"`
	Hash         string `json:"hash"`
	ContractName string `json:"contract_name"`
	ContractCode string `json:"contract_code"`
	Params       string `json:"params"`
	Time         int64  `json:"time"`

	EcosystemName string `json:"ecosystem_name"`
	Ecosystem     int64  `json:"ecosystem"`
	LogoHash      string `json:"logo_hash"`
	TokenSymbol   string `json:"token_symbol"`
	Address       string `json:"address"`
	Size          string `json:"size"`
}

type TxDetailedInfoHex

type TxDetailedInfoHex struct {
	Hash         string `json:"hash"`
	ContractName string `json:"contract_name"`
	//Params       map[string]any `json:"params"`
	Params string `json:"params"`
	KeyID  string `json:"key_id"`
	Time   int64  `json:"time"`
	Type   int64  `json:"type"`
	Size   int64  `json:"size"`

	Ecosystemname string `json:"ecosystemname"`
	TokenSymbol   string `json:"token_symbol"`
	Ecosystem     int64  `json:"ecosystem"`
}

type TxDetailedInfoResponse

type TxDetailedInfoResponse struct {
	Hash         string `json:"hash"`
	ContractName string `json:"contract_name"`
	//Params       map[string]any `json:"params"`
	Params string `json:"params"`
	KeyID  string `json:"key_id"`
	Time   int64  `json:"time"`
	Type   int64  `json:"type"`
	Size   string `json:"size"`

	Ecosystemname string `json:"ecosystemname"`
	TokenSymbol   string `json:"token_symbol"`
	Ecosystem     int64  `json:"ecosystem"`
}

type TxListChart

type TxListChart struct {
	Name string  `json:"name,omitempty"`
	Time []int64 `json:"time"`
	Tx   []int64 `json:"tx"`
}

func Get15DaysTxCountFromRedis

func Get15DaysTxCountFromRedis(ecosystem int64) (*TxListChart, error)

type TxListRet

type TxListRet struct {
	TotalTx       int64  `json:"total_tx"`
	TwentyFourTx  int64  `json:"twenty_four_tx"`
	ActiveEcoLib  string `json:"active_eco_lib"`
	WeekAverageTx int64  `json:"week_average_tx"`
}

type TxRet

type TxRet struct {
	TotalTx        int64 `json:"total_tx"`
	TwentyFourTx   int64 `json:"twenty_four_tx"`
	SingleDayMaxTx int64 `json:"single_day_max_tx"`
	WeekAverageTx  int64 `json:"week_average_tx"`
}

type UtxoExplorer

type UtxoExplorer struct {
	UtxoType    string       `json:"utxo_type"`
	Comment     string       `json:"comment"`
	Sender      string       `json:"sender"`
	Recipient   string       `json:"recipient"`
	Amount      string       `json:"amount"`
	Expedite    string       `json:"expedite"`
	Ecosystem   int64        `json:"ecosystem"`
	TokenSymbol string       `json:"token_symbol"`
	Change      []utxoDetail `json:"change"`
	Outputs     []utxoDetail `json:"outputs"`
	BasisGasFee FeesInfo     `json:"basis_gas_fee"`
	EcoGasFee   FeesInfo     `json:"eco_gas_fee"`
	Size        string       `json:"size"`
	Digits      int64        `json:"digits"`
}

type UtxoExplorerInfo

type UtxoExplorerInfo struct {
	UtxoType    string `json:"utxo_type"`
	Comment     string `json:"comment"`
	Sender      string `json:"sender"`
	Recipient   string `json:"recipient"`
	Amount      string `json:"amount"`
	Expedite    string `json:"expedite"`
	Ecosystem   int64  `json:"ecosystem"`
	TokenSymbol string `json:"token_symbol"`
	Size        int64  `json:"size"`
}

type VoteInfo

type VoteInfo struct {
	Id           int64   `json:"id"`
	Title        string  `json:"title"`
	Created      int64   `json:"created"`
	VotedRate    int     `json:"voted_rate"`
	ResultRate   float64 `json:"result_rate"`
	RejectedRate float64 `json:"rejected_rate"`
}

type VoteStatus

type VoteStatus struct {
	Agree      int64 `json:"agree"`
	Rejected   int64 `json:"rejected"`
	DidNotVote int64 `json:"did_not_vote"`
}

type Voting

type Voting struct {
	Id          int64  `gorm:"primary_key;not null"`
	Creator     string `gorm:"column:lock;type:jsonb"`
	DateEnded   int64  `gorm:"column:date_ended"`
	DateStarted int64  `gorm:"column:date_started"`
	Deleted     int64  `gorm:"column:deleted"`
	Ecosystem   int64  `gorm:"column:ecosystem"`
	Flags       string `gorm:"column:flags;type:jsonb"`
	Optional    string `gorm:"column:optional;type:jsonb"`
	Progress    string `gorm:"column:progress;type:jsonb"`
	Status      int64  `gorm:"column:status"`
	Voting      string `gorm:"column:voting;type:jsonb"`
}

func (*Voting) GetLast

func (p *Voting) GetLast() (bool, error)

func (*Voting) TableName

func (p *Voting) TableName() string

type VotingInfo

type VotingInfo struct {
	Name             string `json:"name"`
	Type             int    `json:"type"`
	Quorum           int    `json:"quorum"`
	Rating           int    `json:"rating"`
	Volume           int    `json:"volume"`
	RoleId           string `json:"role_id"`
	Description      string `json:"description"`
	TypeDecision     int    `json:"type_decision"`
	CountTypeVoters  int    `json:"count_type_voters"`
	TypeParticipants int    `json:"type_participants"`
}

type VotingResponse

type VotingResponse struct {
	TotalResult
	VoteInfo
}

func GetLatestDaoVoting

func GetLatestDaoVoting() (VotingResponse, error)

type VotingSubject

type VotingSubject struct {
	Id           int64  `gorm:"primary_key;not null"`
	Ecosystem    int64  `gorm:"column:ecosystem"`
	NumberAccept int64  `gorm:"column:number_accept"`
	Results      string `gorm:"column:results;type:jsonb"`
	Subject      string `gorm:"column:subject;type:jsonb"`
	VotingId     int64  `gorm:"column:voting_id"`
}

func (*VotingSubject) GetByVotingId

func (p *VotingSubject) GetByVotingId(votingId int64, ecosystem int64) (bool, error)

func (*VotingSubject) TableName

func (p *VotingSubject) TableName() string

type WalletHistoryHex

type WalletHistoryHex struct {
	Transaction int64           `json:"transaction"`
	InTx        int64           `json:"in_tx"`
	OutTx       int64           `json:"out_tx"`
	InAmount    decimal.Decimal `json:"inamount"`
	OutAmount   decimal.Decimal `json:"outamount"`
	Amount      decimal.Decimal `json:"amount,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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