Documentation ¶
Index ¶
- Variables
- func BigIntSliceToStrSlice(vv []*big.Int) []string
- func BuildKeys(privateKeyStr string) (*ecdsa.PrivateKey, *ecdsa.PublicKey, error)
- func BuildSignedTransaction(contract common.Address, ethClient *ethclient.Client, chainID *big.Int, ...) (*types.Transaction, error)
- func GetSecret(secretName, region string) (string, error)
- func InitLogger(config LogConfig)
- func InitTgAlerter(cfg AlertConfig)
- func PackERC721AgentInput(method string, params ...interface{}) ([]byte, error)
- func SendTelegramMessage(msg string)
- func StrSliceToBigIntSlice(ss []string) []*big.Int
- func StrToBigInt(val string) *big.Int
- func TxOpts(ctx context.Context, ethClient client.ETHClient, privateKey string, ...) (*bind.TransactOpts, error)
- func ULID() string
- type AdminConfig
- type AlertConfig
- type ChainConfig
- type Config
- type DBConfig
- type HmacSigner
- type KeyConfig
- type KeyManagerConfig
- type LogConfig
- type Signer
- type TgAlerter
- type TokenSecretKey
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Logger instance for quick declarative logging levels Logger = logging.MustGetLogger("deputy") SdkLogger = &sdkLogger{} )
Functions ¶
func BigIntSliceToStrSlice ¶
func BuildSignedTransaction ¶
func InitTgAlerter ¶
func InitTgAlerter(cfg AlertConfig)
func PackERC721AgentInput ¶
func SendTelegramMessage ¶
func SendTelegramMessage(msg string)
func StrSliceToBigIntSlice ¶
func StrToBigInt ¶
Types ¶
type AdminConfig ¶
type AdminConfig struct {
ListenAddr string `json:"listen_addr"`
}
type AlertConfig ¶
type AlertConfig struct { TelegramBotId string `json:"telegram_bot_id"` TelegramChatId string `json:"telegram_chat_id"` BlockUpdateTimeout int64 `json:"block_update_timeout"` }
func (AlertConfig) Validate ¶
func (cfg AlertConfig) Validate()
type ChainConfig ¶
type ChainConfig struct { BalanceAlertThreshold string `json:"balance_alert_threshold"` BalanceMonitorInterval int64 `json:"balance_monitor_interval"` ID string `json:"id"` Name string `json:"name"` ObserverFetchInterval int64 `json:"observer_fetch_interval"` StartHeight int64 `json:"start_height"` PrivateKey string `json:"private_key"` Provider string `json:"provider"` ConfirmNum int64 `json:"confirm_num"` ERC721SwapAgentAddr string `json:"erc_721_swap_agent_addr"` ERC1155SwapAgentAddr string `json:"erc_1155_swap_agent_addr"` ExplorerUrl string `json:"explorer_url"` MaxTrackRetry int64 `json:"max_track_retry"` WaitMilliSecBetweenTx int64 `json:"wait_milli_sec_between_tx"` }
func (ChainConfig) Validate ¶
func (cfg ChainConfig) Validate()
type Config ¶
type Config struct { KeyManagerConfig KeyManagerConfig `json:"key_manager_config"` DBConfig DBConfig `json:"db_config"` ChainConfigs []ChainConfig `json:"chain_configs"` LogConfig LogConfig `json:"log_config"` AlertConfig AlertConfig `json:"alert_config"` AdminConfig AdminConfig `json:"admin_config"` }
func ParseConfigFromFile ¶
func ParseConfigFromJson ¶
type HmacSigner ¶
hmacSigner uses HMAC SHA256 for signing payloads.
type KeyManagerConfig ¶
type KeyManagerConfig struct { KeyType string `json:"key_type"` AWSRegion string `json:"aws_region"` AWSSecretName string `json:"aws_secret_name"` HMACKey string `json:"hmac_key"` }
func (KeyManagerConfig) Validate ¶
func (cfg KeyManagerConfig) Validate()
type LogConfig ¶
type LogConfig struct { Level string `json:"level"` Filename string `json:"filename"` MaxFileSizeInMB int `json:"max_file_size_in_mb"` MaxBackupsOfLogFiles int `json:"max_backups_of_log_files"` MaxAgeToRetainLogFilesInDays int `json:"max_age_to_retain_log_files_in_days"` UseConsoleLogger bool `json:"use_console_logger"` UseFileLogger bool `json:"use_file_logger"` Compress bool `json:"compress"` }
type Signer ¶
type Signer interface { // Sign signs provided payload and returns encoded string sum. Sign(payload []byte) string Verify(payload []byte, hash string) bool }
Signer signs provided payloads.
type TokenSecretKey ¶
Click to show internal directories.
Click to hide internal directories.