Documentation
¶
Index ¶
- Variables
- type BlockNotification
- type Config
- type Manager
- func (s *Manager) BlockEvent(blockNum int64, blockId string)
- func (s *Manager) NotifySubscriber(serviceId ServiceId, subject string, data Signer)
- func (s *Manager) SearchTransactionsAfterBlock(blockNum int) (txList []*TransferInfoRecord, err error)
- func (s *Manager) SearchTransactionsBeforeBlock(blockNum int) (txList []*TransferInfoRecord, err error)
- func (s *Manager) SubscriptionEdit(serviceId ServiceId, edit func(subscription *Subscription)) (err error)
- func (s *Manager) SubscriptionGet(serviceId ServiceId) (subscription *Subscription, err error)
- func (s *Manager) TransactionEvent(transactionInfo *types.TransferInfo)
- type Option
- func WithAddressManager(pool *address.Manager) Option
- func WithBlockchainClient(client types.ChainClient) Option
- func WithConfigStorage(storage storage.BinStorage) Option
- func WithGlobalConfig(config types.Config) Option
- func WithSubscribersStorage(storage storage.BinStorage) Option
- func WithTransactionStorage(storage *storage.BadgerHoldStorage) Option
- type ServiceId
- type Signer
- type Subscription
- type TransferInfoRecord
- type TransferNotification
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type BlockNotification ¶
type Config ¶
type Config struct {
Debug bool `json:"debug"`
// contains filtered or unexported fields
}
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) BlockEvent ¶
func (*Manager) NotifySubscriber ¶
func (*Manager) SearchTransactionsAfterBlock ¶
func (s *Manager) SearchTransactionsAfterBlock(blockNum int) (txList []*TransferInfoRecord, err error)
func (*Manager) SearchTransactionsBeforeBlock ¶
func (s *Manager) SearchTransactionsBeforeBlock(blockNum int) (txList []*TransferInfoRecord, err error)
func (*Manager) SubscriptionEdit ¶
func (s *Manager) SubscriptionEdit(serviceId ServiceId, edit func(subscription *Subscription)) (err error)
func (*Manager) SubscriptionGet ¶
func (s *Manager) SubscriptionGet(serviceId ServiceId) (subscription *Subscription, err error)
func (*Manager) TransactionEvent ¶
func (s *Manager) TransactionEvent(transactionInfo *types.TransferInfo)
type Option ¶
func WithAddressManager ¶
func WithBlockchainClient ¶
func WithBlockchainClient(client types.ChainClient) Option
func WithConfigStorage ¶
func WithConfigStorage(storage storage.BinStorage) Option
func WithGlobalConfig ¶
func WithSubscribersStorage ¶
func WithSubscribersStorage(storage storage.BinStorage) Option
func WithTransactionStorage ¶
func WithTransactionStorage(storage *storage.BadgerHoldStorage) Option
type Subscription ¶
type Subscription struct {
ServiceName string `json:"serviceName"`
ServiceId ServiceId `json:"serviceId"`
Internal bool `json:"internal,omitempty"`
ApiToken string `json:"apiToken"`
ApiKey string `json:"apiKey"`
EndpointUrl string `json:"eventUrl"`
ReportNewBlock bool `json:"reportNewBlock"`
ReportIncomingTx bool `json:"reportIncomingTx"`
ReportOutgoingTx bool `json:"reportOutgoingTx"`
ReportMainCoin bool `json:"reportMainCoin"`
ReportTokens map[string]bool `json:"reportTokens"`
ReportBalanceChange bool `json:"balanceChange"`
GatherToMaster bool `json:"gatherToMaster"`
MasterList []string `json:"masterList"`
SecuritySignRequests bool `json:"securitySignRequests,omitempty"`
SecuritySignResponse bool `json:"securitySignResponse,omitempty"`
//Reserved for future use
SecurityUseEncryption bool `json:"securityUseEncryption,omitempty"`
// contains filtered or unexported fields
}
func NewSubscription ¶
func NewSubscription(serviceId ServiceId, endpointUrl string, fillSettings func(s *Subscription)) *Subscription
type TransferInfoRecord ¶
type TransferInfoRecord struct {
TxID string `json:"tx_id" badgerhold:"key"`
Timestamp int64 `json:"timestamp"`
BlockNum int `json:"blockNum" badgerhold:"index"`
Ignore bool `json:"ignore"`
Success bool `json:"success"`
Transfer bool `json:"transfer"`
NativeCoin bool `json:"nativeCoin,omitempty"`
Symbol string `json:"symbol,omitempty"`
SmartContract bool `json:"smartContract,omitempty"`
From string `json:"from" badgerhold:"index"`
To string `json:"to" badgerhold:"index"`
Amount *big.Int `json:"amount"`
Token string `json:"token,omitempty"`
TokenSymbol string `json:"tokenSymbol,omitempty"`
Fee *big.Int `json:"fee"`
InPool bool `json:"inPool"`
Confirmed bool `json:"confirmed" badgerhold:"index"`
ChainSpecificData []byte `json:"chainSpecificData,omitempty"`
}
type TransferNotification ¶
type TransferNotification struct {
ChainId string `json:"chainId"`
TxID string `json:"tx_id"`
Timestamp int64 `json:"timestamp"`
BlockNum int `json:"blockNum"`
Success bool `json:"success"`
Transfer bool `json:"transfer"`
NativeCoin bool `json:"nativeCoin,omitempty"`
Symbol string `json:"symbol,omitempty"`
SmartContract bool `json:"smartContract,omitempty"`
From string `json:"from"`
To string `json:"to"`
Amount *big.Int `json:"amount"`
Token string `json:"token,omitempty"`
TokenSymbol string `json:"tokenSymbol,omitempty"`
Fee *big.Int `json:"fee"`
InPool bool `json:"inPool"`
Confirmed bool `json:"confirmed"`
Confirmations int `json:"confirmations"`
UserId int64 `json:"userId,omitempty"`
InvoiceId int64 `json:"invoiceId,omitempty"`
Signature string `json:"sign,omitempty"`
}
func (*TransferNotification) Sign ¶
func (n *TransferNotification) Sign(apiKey string)
Click to show internal directories.
Click to hide internal directories.