Documentation ¶
Index ¶
- type AddDepositAddressRequest
- type Assignment
- type BatchValidatorAssignmentParams
- type BroadcastBabylonStakingTxResp
- type CreateUserParams
- type DelegateTransaction
- type DelegateTransactionList
- type DelegatedValidator
- type DelegatedValidatorList
- type DelegatedValidatorReward
- type DelegatedValidatorRewardList
- type Delegator
- type DelegatorOverview
- type DelegatorReward
- type DelegatorRewardList
- type Deposit
- type DepositDataInfo
- type DepositDataRequestParams
- type DepositDataResponse
- type DepositDetails
- type EthereumResponse
- type GenerateBroadcastStakingRequestParams
- type GenerateStakingRequestParams
- type GenerateStakingRequestResp
- type ListDelegatesParams
- type PageParams
- type PageResult
- type PoolRewardInfo
- type PoolRewardInfoList
- type PooledStakingInfo
- type PooledStakingInfoList
- type PooledWithdrawRequestInfo
- type Response
- type Reward
- type RewardList
- type SendTransactionRequestParams
- type SendTransactionResponse
- type StakingService
- func (stakingService *StakingService) AddDepositAddress(uid string, depositaddresses []string) (result *string, code uint, msg string, err error)
- func (stakingService *StakingService) AnnuallyRewards(uid string, startTime int64, endTime int64) (result *RewardList, code uint, msg string, err error)
- func (stakingService *StakingService) AssignDepositedValidators(txHash string, validatorAssignmentParams ValidatorAssignmentParams) (result *[]UserValidators, code uint, msg string, err error)
- func (stakingService *StakingService) BatchAssignDepositedValidators(batchValidatorAssignmentParams BatchValidatorAssignmentParams) (result *[]UserValidators, code uint, msg string, err error)
- func (stakingService *StakingService) CreateUser(uid string, depositaddresses []string) (result *User, code uint, msg string, err error)
- func (stakingService *StakingService) DailyRewards(uid string, startTime int64, endTime int64) (result *RewardList, code uint, msg string, err error)
- func (stakingService *StakingService) DeleteUser(uid string) (result *string, code uint, msg string, err error)
- func (stakingService *StakingService) DepositData(depositDataRequestParams DepositDataRequestParams) (result *DepositDataResponse, code uint, msg string, err error)
- func (stakingService *StakingService) GenerateBroadcastStakingRequest(params GenerateBroadcastStakingRequestParams) (result *BroadcastBabylonStakingTxResp, code uint, msg string, err error)
- func (stakingService *StakingService) GenerateStakingRequest(params GenerateStakingRequestParams) (result *GenerateStakingRequestResp, code uint, msg string, err error)
- func (stakingService *StakingService) GetDelegatedValidatorInfo(chainName, validatorID string) (result *DelegatedValidator, code uint, msg string, err error)
- func (stakingService *StakingService) GetDelegatorInfo(chainName, validatorID, delegatorID string) (result *Delegator, code uint, msg string, err error)
- func (stakingService *StakingService) GetDelegatorOverview(chainName, validatorID, delegatorID string) (result *DelegatorOverview, code uint, msg string, err error)
- func (stakingService *StakingService) GetDepositDetails(txHash string) (result *DepositDetails, code uint, msg string, err error)
- func (stakingService *StakingService) GetPoolRewards(date *string, limit *uint) (result *PoolRewardInfoList, code uint, msg string, err error)
- func (stakingService *StakingService) GetPooledStakingInfo() (result *PooledStakingInfoList, code uint, msg string, err error)
- func (stakingService *StakingService) GetTransactionHistory(userAddress string, txType, pageNum, pageSize int64) (result *PageResult[TransactionList], code uint, msg string, err error)
- func (stakingService *StakingService) GetUnusedKeys() (result *uint64, code uint, msg string, err error)
- func (stakingService *StakingService) GetUserDetails(uid string) (result *UserDetails, code uint, msg string, err error)
- func (stakingService *StakingService) GetUserPooledStakingInfo(address string) (result *UserPooledStakingInfo, code uint, msg string, err error)
- func (stakingService *StakingService) GetUserWithdrawPossible(userAddress string) (result *WithdrawPossibleBlock, code uint, msg string, err error)
- func (stakingService *StakingService) GetWithdrawRequestInfo(requestID uint64) (result *PooledWithdrawRequestInfo, code uint, msg string, err error)
- func (stakingService *StakingService) ListDelegatedValidators(chainName string) (result *DelegatedValidatorList, code uint, msg string, err error)
- func (stakingService *StakingService) ListDelegatesForDelegator(chainName, validatorID, delegatorID string, params ListDelegatesParams) (result *PageResult[DelegateTransaction], code uint, msg string, err error)
- func (stakingService *StakingService) ListDelegatesForValidator(chainName, validatorID string, params ListDelegatesParams) (result *PageResult[DelegateTransaction], code uint, msg string, err error)
- func (stakingService *StakingService) ListDelegators(chainName, validatorID string) (result *[]Delegator, code uint, msg string, err error)
- func (stakingService *StakingService) ListDeposits(pageNum, pageSize uint) (result *PageResult[Deposit], code uint, msg string, err error)
- func (stakingService *StakingService) ListRewardsForDelegator(chainName, validatorID, delegatorID string, pageParams PageParams) (result *PageResult[DelegatorReward], code uint, msg string, err error)
- func (stakingService *StakingService) ListRewardsForValidator(chainName, validatorID string, pageParams PageParams) (result *PageResult[DelegatedValidatorReward], code uint, msg string, err error)
- func (stakingService *StakingService) ListUsers(pageNum, pageSize uint) (result *PageResult[User], code uint, msg string, err error)
- func (stakingService *StakingService) ManualDepositBroker(txHash string) (result *string, code uint, msg string, err error)
- func (stakingService *StakingService) ManualDepositBrokerUser(txHash string) (result *string, code uint, msg string, err error)
- func (stakingService *StakingService) MonthlyRewards(uid string, startTime int64, endTime int64) (result *RewardList, code uint, msg string, err error)
- func (stakingService *StakingService) QuarterlyRewards(uid string, startTime int64, endTime int64) (result *RewardList, code uint, msg string, err error)
- func (stakingService *StakingService) SendTransaction(sendTransactionRequestParams SendTransactionRequestParams) (result *SendTransactionResponse, code uint, msg string, err error)
- func (stakingService *StakingService) ValidatorExit(pubkey string, validatorExitParam ValidatorExitParam) (result *ValidatorExitRes, code uint, msg string, err error)
- func (stakingService *StakingService) ValidatorList(validatorListRequestParam ValidatorListRequestParam) (result *PageResult[ValidatorDetail], code uint, msg string, err error)
- type TransactionInfo
- type TransactionList
- type User
- type UserDetails
- type UserPooledStakingInfo
- type UserValidators
- type Validator
- type ValidatorAssignmentParams
- type ValidatorDetail
- type ValidatorDetailList
- type ValidatorExitParam
- type ValidatorExitRes
- type ValidatorList
- type ValidatorListRequestParam
- type WithdrawPossibleBlock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddDepositAddressRequest ¶
type AddDepositAddressRequest struct {
DepositAddresses []string `json:"deposit_addresses"`
}
type Assignment ¶
type BatchValidatorAssignmentParams ¶
type BatchValidatorAssignmentParams struct { Assignments []Assignment `json:"assignments"` TxHashs []string `json:"tx_hashs"` }
type BroadcastBabylonStakingTxResp ¶
type BroadcastBabylonStakingTxResp struct {
TxHex string `json:"txHex"`
}
type CreateUserParams ¶
type DelegateTransaction ¶
type DelegateTransaction struct { ChainName string `json:"chainName"` ValidatorID string `json:"validatorID"` DelegatorID string `json:"delegatorID"` Amount float64 `json:"amount"` // 交易中的operationType在数据库中存为数字,1为Delegate,2为Undelegate,3为Claim Reward,注意在任何场景中,给用户打钱的交易都记为Claim,即假如取款不分两部,则取款交易记为3 OperationType string `json:"operationType"` OperationTypeOrigin int `json:"operationTypeOrigin"` Block string `json:"block"` // 在aptos中block和txHash都是version TxHash string `json:"txHash"` TxTime int64 `json:"txTime"` }
type DelegateTransactionList ¶
type DelegateTransactionList []DelegateTransaction
type DelegatedValidator ¶
type DelegatedValidator struct { ChainName string `json:"chainName"` ValidatorID string `json:"validatorID"` Commission uint `json:"commission"` Principal string `json:"principal"` SelfPrincipal string `json:"selfPrincipal"` Status string `json:"status"` StatusOrigin int `json:"statusOrigin"` APR int64 `json:"apr"` AppearTime uint64 `json:"appearTime"` DelegatorNum int64 `json:"delegatorNum"` MaxDelegatorNum int64 `json:"maxDelegatorNum"` Extra string `json:"extra"` }
type DelegatedValidatorList ¶
type DelegatedValidatorList []DelegatedValidator
type DelegatedValidatorReward ¶
type DelegatedValidatorReward struct { ChainName string `json:"chainName"` ValidatorID string `json:"validatorID"` // Identifier为收益周期,即如果是每个Epoch统计收益即为Epoch,如果是某个BlockHeight分发收益则记录BlockHeight,如果是按时间周期,则记录时间或者日期。 Identifier string `json:"identifier"` // 确定的Block Height或者收益周期的block起始值,用逗号分隔 Block string `json:"block"` Amount float64 `json:"amount"` RewardTime uint64 `json:"rewardTime"` Principal float64 `json:"principal"` Commission uint `json:"commission"` // Commission Rate, 统一为 百分比 * 100,例如: 12.34% 为 1234 }
type DelegatedValidatorRewardList ¶
type DelegatedValidatorRewardList []DelegatedValidatorReward
type DelegatorOverview ¶
type DelegatorOverview struct { StakedAmount float64 `json:"stakedAmount"` UnlockAmount float64 `json:"unlockAmount"` PendingAmount float64 `json:"pendingAmount"` ReadyToClaim float64 `json:"readyToClaim"` HistoricalRewardsForDelegator float64 `json:"historicalRewardsForDelegator"` HistoricalClaimedRewards float64 `json:"historicalClaimedRewards"` HistoricalRewardsForValidator float64 `json:"historicalRewardsForValidator"` HistoricalReferralCommission float64 `json:"historicalReferralCommission"` SettledReferralCommission float64 `json:"settledReferralCommission"` UnsettledReferralCommission float64 `json:"unsettledReferralCommission"` }
type DelegatorReward ¶
type DelegatorReward struct { DelegatedValidatorReward DelegatorID string `json:"delegatorID"` }
type DelegatorRewardList ¶
type DelegatorRewardList []DelegatorReward
type Deposit ¶
type Deposit struct { ID uint64 `json:"id"` BrokerID uint64 `json:"brokerId"` FromAddress string `json:"fromAddress"` ContractAddress string `json:"contractAddress"` TxHash string `json:"txHash"` ChainName string `json:"chainName"` BlockHeight uint64 `json:"blockHeight"` Slot uint64 `json:"slot"` BlockTime uint64 `json:"blockTime"` }
type DepositDataInfo ¶
type DepositDataResponse ¶
type DepositDataResponse struct { Network string `json:"network"` Protocol string `json:"protocol"` Period string `json:"period"` Ethereum *EthereumResponse `json:"ethereum"` }
type DepositDetails ¶
type DepositDetails struct { Deposit Validators ValidatorDetailList `json:"validators"` }
type EthereumResponse ¶
type EthereumResponse struct { ContractAddress string `json:"contractAddress"` EstimatedGas uint64 `json:"estimatedGas"` UnsignedTransaction string `json:"unsignedTransaction"` DepositData []*DepositDataInfo `json:"depositData"` }
type ListDelegatesParams ¶
type ListDelegatesParams struct { PageParams OperationType int `json:"operationType"` }
type PageParams ¶
type PageResult ¶
type PoolRewardInfo ¶
type PoolRewardInfoList ¶
type PoolRewardInfoList []PoolRewardInfo
type PooledStakingInfo ¶
type PooledStakingInfoList ¶
type PooledStakingInfoList []PooledStakingInfo
type Reward ¶
type Reward struct { Date string `json:"date"` TotalCount int64 `json:"totalCount"` ActiveCount int64 `json:"activeCount"` ExitCount int64 `json:"exitCount"` Balance string `json:"balance"` Principal string `json:"principal"` Apr string `json:"apr"` CumulativeRewards string `json:"cumulativeRewards"` CumulativeStaking string `json:"cumulativeStaking"` CumulativeGasFee string `json:"cumulativeGasFee"` Rewards string `json:"rewards"` Staking string `json:"staking"` GasFee string `json:"gasFee"` Withdrawal string `json:"withdrawal"` Rate string `json:"rate"` }
type RewardList ¶
type RewardList []Reward
type SendTransactionRequestParams ¶
type SendTransactionRequestParams struct {
SignedTransaction string `json:"signedTransaction"`
}
type SendTransactionResponse ¶
type SendTransactionResponse struct {
TxHash string `json:"txHash"`
}
type StakingService ¶
type StakingService struct {
// contains filtered or unexported fields
}
func NewStakingService ¶
func NewStakingService(baseURL, privateKey, address string) (*StakingService, error)
func (*StakingService) AddDepositAddress ¶
func (*StakingService) AnnuallyRewards ¶
func (stakingService *StakingService) AnnuallyRewards(uid string, startTime int64, endTime int64) (result *RewardList, code uint, msg string, err error)
func (*StakingService) AssignDepositedValidators ¶
func (stakingService *StakingService) AssignDepositedValidators(txHash string, validatorAssignmentParams ValidatorAssignmentParams) (result *[]UserValidators, code uint, msg string, err error)
func (*StakingService) BatchAssignDepositedValidators ¶
func (stakingService *StakingService) BatchAssignDepositedValidators(batchValidatorAssignmentParams BatchValidatorAssignmentParams) (result *[]UserValidators, code uint, msg string, err error)
func (*StakingService) CreateUser ¶
func (*StakingService) DailyRewards ¶
func (stakingService *StakingService) DailyRewards(uid string, startTime int64, endTime int64) (result *RewardList, code uint, msg string, err error)
func (*StakingService) DeleteUser ¶
func (*StakingService) DepositData ¶
func (stakingService *StakingService) DepositData(depositDataRequestParams DepositDataRequestParams) (result *DepositDataResponse, code uint, msg string, err error)
func (*StakingService) GenerateBroadcastStakingRequest ¶
func (stakingService *StakingService) GenerateBroadcastStakingRequest(params GenerateBroadcastStakingRequestParams) (result *BroadcastBabylonStakingTxResp, code uint, msg string, err error)
func (*StakingService) GenerateStakingRequest ¶
func (stakingService *StakingService) GenerateStakingRequest(params GenerateStakingRequestParams) (result *GenerateStakingRequestResp, code uint, msg string, err error)
func (*StakingService) GetDelegatedValidatorInfo ¶
func (stakingService *StakingService) GetDelegatedValidatorInfo(chainName, validatorID string) (result *DelegatedValidator, code uint, msg string, err error)
func (*StakingService) GetDelegatorInfo ¶
func (*StakingService) GetDelegatorOverview ¶
func (stakingService *StakingService) GetDelegatorOverview(chainName, validatorID, delegatorID string) (result *DelegatorOverview, code uint, msg string, err error)
func (*StakingService) GetDepositDetails ¶
func (stakingService *StakingService) GetDepositDetails(txHash string) (result *DepositDetails, code uint, msg string, err error)
func (*StakingService) GetPoolRewards ¶
func (stakingService *StakingService) GetPoolRewards(date *string, limit *uint) (result *PoolRewardInfoList, code uint, msg string, err error)
func (*StakingService) GetPooledStakingInfo ¶
func (stakingService *StakingService) GetPooledStakingInfo() (result *PooledStakingInfoList, code uint, msg string, err error)
func (*StakingService) GetTransactionHistory ¶
func (stakingService *StakingService) GetTransactionHistory(userAddress string, txType, pageNum, pageSize int64) (result *PageResult[TransactionList], code uint, msg string, err error)
func (*StakingService) GetUnusedKeys ¶
func (stakingService *StakingService) GetUnusedKeys() (result *uint64, code uint, msg string, err error)
func (*StakingService) GetUserDetails ¶
func (stakingService *StakingService) GetUserDetails(uid string) (result *UserDetails, code uint, msg string, err error)
func (*StakingService) GetUserPooledStakingInfo ¶
func (stakingService *StakingService) GetUserPooledStakingInfo(address string) (result *UserPooledStakingInfo, code uint, msg string, err error)
func (*StakingService) GetUserWithdrawPossible ¶
func (stakingService *StakingService) GetUserWithdrawPossible(userAddress string) (result *WithdrawPossibleBlock, code uint, msg string, err error)
func (*StakingService) GetWithdrawRequestInfo ¶
func (stakingService *StakingService) GetWithdrawRequestInfo(requestID uint64) (result *PooledWithdrawRequestInfo, code uint, msg string, err error)
func (*StakingService) ListDelegatedValidators ¶
func (stakingService *StakingService) ListDelegatedValidators(chainName string) (result *DelegatedValidatorList, code uint, msg string, err error)
func (*StakingService) ListDelegatesForDelegator ¶
func (stakingService *StakingService) ListDelegatesForDelegator(chainName, validatorID, delegatorID string, params ListDelegatesParams) (result *PageResult[DelegateTransaction], code uint, msg string, err error)
func (*StakingService) ListDelegatesForValidator ¶
func (stakingService *StakingService) ListDelegatesForValidator(chainName, validatorID string, params ListDelegatesParams) (result *PageResult[DelegateTransaction], code uint, msg string, err error)
ListDelegatesForValidator 方法用于获取某个验证者的所有委托记录
func (*StakingService) ListDelegators ¶
func (*StakingService) ListDeposits ¶
func (stakingService *StakingService) ListDeposits(pageNum, pageSize uint) (result *PageResult[Deposit], code uint, msg string, err error)
func (*StakingService) ListRewardsForDelegator ¶
func (stakingService *StakingService) ListRewardsForDelegator(chainName, validatorID, delegatorID string, pageParams PageParams) (result *PageResult[DelegatorReward], code uint, msg string, err error)
func (*StakingService) ListRewardsForValidator ¶
func (stakingService *StakingService) ListRewardsForValidator(chainName, validatorID string, pageParams PageParams) (result *PageResult[DelegatedValidatorReward], code uint, msg string, err error)
func (*StakingService) ListUsers ¶
func (stakingService *StakingService) ListUsers(pageNum, pageSize uint) (result *PageResult[User], code uint, msg string, err error)
func (*StakingService) ManualDepositBroker ¶
func (*StakingService) ManualDepositBrokerUser ¶
func (*StakingService) MonthlyRewards ¶
func (stakingService *StakingService) MonthlyRewards(uid string, startTime int64, endTime int64) (result *RewardList, code uint, msg string, err error)
func (*StakingService) QuarterlyRewards ¶
func (stakingService *StakingService) QuarterlyRewards(uid string, startTime int64, endTime int64) (result *RewardList, code uint, msg string, err error)
func (*StakingService) SendTransaction ¶
func (stakingService *StakingService) SendTransaction(sendTransactionRequestParams SendTransactionRequestParams) (result *SendTransactionResponse, code uint, msg string, err error)
func (*StakingService) ValidatorExit ¶
func (stakingService *StakingService) ValidatorExit(pubkey string, validatorExitParam ValidatorExitParam) (result *ValidatorExitRes, code uint, msg string, err error)
func (*StakingService) ValidatorList ¶
func (stakingService *StakingService) ValidatorList(validatorListRequestParam ValidatorListRequestParam) (result *PageResult[ValidatorDetail], code uint, msg string, err error)
type TransactionInfo ¶
type TransactionList ¶
type TransactionList []*TransactionInfo
type UserDetails ¶
type UserDetails struct { User DepositAddresses []string `json:"depositAddresses"` Validators ValidatorDetailList `json:"validators"` }
type UserPooledStakingInfo ¶
type UserValidators ¶
type UserValidators struct { UID string `json:"uid"` Validators ValidatorList `json:"validators"` }
type ValidatorAssignmentParams ¶
type ValidatorAssignmentParams struct {
Assignments []Assignment `json:"assignments"`
}
type ValidatorDetail ¶
type ValidatorDetailList ¶
type ValidatorDetailList []ValidatorDetail
type ValidatorExitParam ¶
type ValidatorExitRes ¶
type ValidatorExitRes struct {
Signature string `json:"signature"`
}
type ValidatorList ¶
type ValidatorList []Validator
type ValidatorListRequestParam ¶
type ValidatorListRequestParam struct { Uid string `form:"uid"` PageParams }
type WithdrawPossibleBlock ¶
type WithdrawPossibleBlock struct {
CanWithdrawBlock string `json:"can_withdraw_block"`
}
Click to show internal directories.
Click to hide internal directories.