Documentation ¶
Index ¶
- Constants
- func Begin() *gorm.DB
- func ConnRedis() error
- func CreateSession(session *common.Session) error
- func CreateWallet(model *common.Wallet) error
- func GetAllActiveCrowdSaleCount(keyword string) (int, error)
- func GetBalanceForAddress(addresses []string) (map[string][]model.BalanceForAddress, error)
- func GetBalanceForAddresses(addrs []string) (map[string][]model.BalanceForAddress, error)
- func GetFeeRate() (*view.FeeRate, error)
- func GetHistoryDetail(tx_hash string) (string, error)
- func GetHistoryListCount(addrs []string, pid int) (int, error)
- func GetHistorySpDetail(tx_hash string) (string, error)
- func GetLastBlock() *common.Block
- func GetNewestVersionFroDevice(device string) (*model.Version, error)
- func GetNotificationItem(address string, pid int64, txID int) (*model.AddressesInTx, error)
- func GetPropertiesNumberByAddresses(addresses []string) (int, error)
- func GetPropertyById(pid uint64) (string, error)
- func GetPropertyByKeyword(keyword string) ([]string, error)
- func GetPropertyByName(name string) ([]string, error)
- func GetPropertyName(pid uint64) (string, error)
- func GetPurchasedCrowdsaleNumber(pid uint64) (int, error)
- func GetSessionById(id string) (*common.Session, bool)
- func GetWalletById(id string) (*common.Wallet, bool)
- func InsertAddressesInTx(addrInTx *common.AddressesInTx, dbtx *gorm.DB) error
- func InsertTx(tx *common.Tx, dbtx *gorm.DB) (int, error)
- func InsertTxJson(txJson *common.TxJson, dbtx *gorm.DB) error
- func IsExistTx(txid string, protocol common.Protocol) bool
- func ListOwners(pageSize int, pageNo int, propertyId int) ([]view.AddressBalance, error)
- func ListOwnersCount(propertyId int) (int64, error)
- func PropertyListCount(keyword string) (int, error)
- func Publish(channel string, msg string) error
- func QueryTotal(property_id int64, address string) (int64, error)
- func QueryTransactions(property_id int64, address string, start, count int64) ([]string, error)
- func StoreBalanceForAddress(bals map[string][]model.BalanceForAddress) error
- func StoreFeeRate(fee *view.FeeRate) error
- func StoreNotification(addr string, item *model.AddressesInTx) error
- func Subscribe(ctx context.Context, channel string, ret chan<- []byte) error
- func UpdateSessionById(session *common.Session) error
- func UpdateWallet(wallet *common.Wallet) error
- func VerifyWalletByEmail(email string) bool
- type APINotify
- type AddressPropertyListWithBalance
- type AddressesInTxInherit
- type CrowdSaleList
- type HistoryList
- type PropertiesByAddresses
- type PropertyWithTime
- type PurchaseCrowdSaleRecode
- type QuestionAnswer
- type Secret
- type WalletSetting
Constants ¶
View Source
const ( BalancePrefix = "balance:" // WARNING: the maintained address set only supports bash32 encoded address AddressSetKey = "address:set" // channels // update block tip UpdateBlockTip = "block:tip" MempoolTxTip = "transaction:tip" FeeRateKey = "transaction:feeRate" // notify balance for wormhole BalanceUpdated = "balance:wormhole:updated" // Redis will persist the balance information for 20 minute unless the program // refresh it or timeout. BalanceExpire = 1200 )
Variables ¶
This section is empty.
Functions ¶
func CreateSession ¶
func CreateWallet ¶
func GetBalanceForAddress ¶
func GetBalanceForAddress(addresses []string) (map[string][]model.BalanceForAddress, error)
func GetBalanceForAddresses ¶
func GetBalanceForAddresses(addrs []string) (map[string][]model.BalanceForAddress, error)
func GetFeeRate ¶
func GetHistoryDetail ¶
func GetHistorySpDetail ¶
func GetLastBlock ¶
func GetNotificationItem ¶
func GetPropertyById ¶
func GetPropertyByKeyword ¶
support query via property name or property id input
func GetPropertyByName ¶
func GetPropertyName ¶
func InsertAddressesInTx ¶
func InsertAddressesInTx(addrInTx *common.AddressesInTx, dbtx *gorm.DB) error
func ListOwners ¶
func ListOwnersCount ¶
func PropertyListCount ¶
func QueryTransactions ¶
func StoreBalanceForAddress ¶
func StoreBalanceForAddress(bals map[string][]model.BalanceForAddress) error
func StoreFeeRate ¶
func StoreNotification ¶
func StoreNotification(addr string, item *model.AddressesInTx) error
func UpdateSessionById ¶
func UpdateWallet ¶
func VerifyWalletByEmail ¶
Types ¶
type APINotify ¶
type APINotify struct { Address string `json:"address"` PropertyID int64 `json:"property_id"` PropertyName string `json:"property_name"` Protocol model.Protocol `json:"protocol"` AddressRole model.AddressRole `json:"address_role"` BalanceAvailableCreditDebit *decimal.Decimal `json:"balance_available_credit_debit"` BalanceReservedCreditDebit *decimal.Decimal `json:"balance_reserved_credit_debit"` BalanceAcceptedCreditDebit *decimal.Decimal `json:"balance_accepted_credit_debit"` BalanceFrozenCreditDebit *decimal.Decimal `json:"balance_frozen_credit_debit"` Timestamp int64 `json:"block_time"` TxTypeName string `json:"tx_type_name"` }
type AddressPropertyListWithBalance ¶
type AddressPropertyListWithBalance struct { Balance float64 `json:"balance"` Property interface{} `json:"property"` }
func GetPropertyListByAddress ¶
func GetPropertyListByAddress(addr string) ([]AddressPropertyListWithBalance, error)
type AddressesInTxInherit ¶
type AddressesInTxInherit struct { TxTypeName string PropertyName string BlockTime int64 model.AddressesInTx }
type CrowdSaleList ¶
type CrowdSaleList struct { PropertyData string `json:"property_data"` BlockTime int64 `json:"block_time"` }
func GetAllActiveCrowdSale ¶
func GetAllActiveCrowdSale(keyword string, pagesize int, pageno int) ([]CrowdSaleList, error)
type HistoryList ¶
type HistoryList struct { TxHash string `json:"tx_hash" gorm:"column:tx_hash"` TxType int32 `json:"tx_type" gorm:"column:tx_type"` TxState string `json:"tx_state" gorm:"column:tx_state"` Address string `json:"address"` AddressRole string `json:"address_role" gorm:"column:address_role"` BalanceAvailableCreditDebit decimal.Decimal `json:"balance_available_credit_debit" gorm:"column:balance_available_credit_debit"` BlockTime int64 `json:"block_time" gorm:"column:block_time"` PropertyName string `json:"property_name" gorm:"column:property_name"` PropertyID uint64 `json:"property_id" gorm:"column:property_id"` }
func GetHistoryList ¶
func GetHistoryList(addrs []string, pid, pageSize, pageNo int) ([]HistoryList, error)
type PropertiesByAddresses ¶
type PropertiesByAddresses struct { TxData string `json:"tx_data"` PropertyData string `json:"property_data"` }
func GetPropertiesByAddresses ¶
func GetPropertiesByAddresses(addresses []string, pageSize, pageNo int) ([]PropertiesByAddresses, error)
type PropertyWithTime ¶
type PropertyWithTime struct { PropertyData string `json:"property_data"` BlockTime int64 `json:"block_time"` }
func ListAllProperties ¶
func ListAllProperties(keyword string, pageSize, pageNo int) ([]PropertyWithTime, error)
type PurchaseCrowdSaleRecode ¶
type PurchaseCrowdSaleRecode struct { Fee string `json:"fee"` Txid string `json:"txid"` Type string `json:"type"` Block int `json:"block"` Valid bool `json:"valid"` Amount string `json:"amount"` Ismine bool `json:"ismine"` Version int `json:"version"` Subsends interface{} `json:"subsends"` TypeInt int `json:"type_int"` Blockhash string `json:"blockhash"` Blocktime int `json:"blocktime"` Precision string `json:"precision"` Propertyid int `json:"propertyid"` Issuertokens string `json:"issuertokens"` Confirmations int `json:"confirmations"` Actualinvested string `json:"actualinvested"` Sendingaddress string `json:"sendingaddress"` Purchasedtokens string `json:"purchasedtokens"` Referenceaddress string `json:"referenceaddress"` Purchasedpropertyid int `json:"purchasedpropertyid"` Purchasedpropertyname string `json:"purchasedpropertyname"` Purchasedpropertyprecision string `json:"purchasedpropertyprecision"` }
func ListPurchaseCrowdsaleTxes ¶
func ListPurchaseCrowdsaleTxes(pid uint64, pageSize, pageNo int) ([]PurchaseCrowdSaleRecode, error)
type QuestionAnswer ¶
type WalletSetting ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.