Documentation
¶
Index ¶
- Constants
- func CalcExchangeRatio(fromToken, toToken, amountOut string, amountIn *big.Int) *big.Int
- func TokenIconsList(c echo.Context) error
- func TokenList(c echo.Context) error
- type AccountHandler
- type AccountHandlerBalancesIn
- type AccountHandlerBalancesOut
- type AggrInfoParams
- type EstimateInvestParams
- type InvestHandler
- func (h *InvestHandler) Estimate(c echo.Context) error
- func (h *InvestHandler) EstimateAndPrepare(c echo.Context) error
- func (h *InvestHandler) MultiAssetsInvest(c echo.Context) error
- func (h *InvestHandler) Pools(c echo.Context) error
- func (h *InvestHandler) Prepare(c echo.Context) error
- func (h *InvestHandler) RemoveLiquidity(c echo.Context) error
- type MultiAssetsInvestParams
- type MultiAssetsInvestResult
- type MultiAssetsInvestResultApprove
- type MultiAssetsInvestResultToken
- type PEResult
- type PoolsInfo
- type PrepareInvestParams
- type RemoveLiquidityIn
- type RemoveLiquidityOut
- type StakingHandler
- func (h *StakingHandler) ClaimReward(c echo.Context) error
- func (h *StakingHandler) Exit(c echo.Context) error
- func (h *StakingHandler) Pools(c echo.Context) error
- func (h *StakingHandler) PoolsV2(c echo.Context) error
- func (h *StakingHandler) Stake(c echo.Context) error
- func (h *StakingHandler) Withdraw(c echo.Context) error
- type StakingHandlerClaimRewardIn
- type StakingHandlerClaimRewardOut
- type StakingHandlerExitIn
- type StakingHandlerExitOut
- type StakingHandlerStakeIn
- type StakingHandlerStakeOut
- type StakingHandlerWithdrawIn
- type StakingHandlerWithdrawOut
- type SwapHandler
- type UserInvest
- type UserInvestCash
Constants ¶
View Source
const MAX_INVEST_POOLS = 100
Variables ¶
This section is empty.
Functions ¶
func CalcExchangeRatio ¶
func TokenIconsList ¶
Types ¶
type AccountHandler ¶
type AccountHandler struct {
}
func NewAccountHandler ¶
func NewAccountHandler() AccountHandler
func (AccountHandler) CurrentInvest ¶
func (h AccountHandler) CurrentInvest(c echo.Context) error
type AggrInfoParams ¶
type EstimateInvestParams ¶
type EstimateInvestParams struct {
Dex string `json:"dex" query:"dex" form:"dex"`
Platform string `json:"platform" query:"platform" form:"platform"`
Pool string `json:"pool" query:"pool" form:"pool"`
Amount string `json:"amount" query:"amount" form:"amount"`
Token string `json:"token" query:"token" form:"token"`
Slippage string `json:"slippage" query:"slippage" form:"slippage"`
}
type InvestHandler ¶
type InvestHandler struct{}
func (*InvestHandler) EstimateAndPrepare ¶
func (h *InvestHandler) EstimateAndPrepare(c echo.Context) error
func (*InvestHandler) MultiAssetsInvest ¶
func (h *InvestHandler) MultiAssetsInvest(c echo.Context) error
MultiAssetsInvest has some special treatment for ETH
func (*InvestHandler) RemoveLiquidity ¶
func (h *InvestHandler) RemoveLiquidity(c echo.Context) error
type MultiAssetsInvestParams ¶
type MultiAssetsInvestParams struct {
Dex string `json:"dex" query:"dex" form:"dex"`
Platform string `json:"platform" query:"platform" form:"platform"`
Pool string `json:"pool" query:"pool" form:"pool"`
User string `json:"user" query:"user" form:"user"`
Assets map[string]string `json:"assets" query:"assets" form:"assets"`
InfiniteAllowance bool `json:"infinite_allowance" query:"infinite_allowance" form:"infinite_allowance"`
}
type MultiAssetsInvestResult ¶
type MultiAssetsInvestResult struct {
Approves map[string]MultiAssetsInvestResultApprove `json:"approves"`
ContractAddress string `json:"contract_address"`
CallData string `json:"calldata"`
Tokens []MultiAssetsInvestResultToken `json:"tokens"`
}
type MultiAssetsInvestResultApprove ¶
type MultiAssetsInvestResultApprove struct {
CallData string `json:"calldata"`
}
type PEResult ¶
type PEResult struct {
Prepare *investfactory.PrepareResult `json:"prepare"`
Estimate *investfactory.EstimateResult `json:"estimate"`
}
type PrepareInvestParams ¶
type PrepareInvestParams struct {
Dex string `json:"dex" query:"dex" form:"dex"`
Platform string `json:"platform" query:"platform" form:"platform"`
Pool string `json:"pool" query:"pool" form:"pool"`
Amount string `json:"amount" query:"amount" form:"amount"`
Token string `json:"token" query:"token" form:"token"`
UserAddr string `json:"user" query:"user" form:"user"`
Slippage string `json:"slippage" query:"slippage" form:"slippage"`
}
type RemoveLiquidityIn ¶
type RemoveLiquidityOut ¶
type RemoveLiquidityOut struct {
CallData string `json:"calldata"`
ContractAddress string `json:"contract_address"`
Tokens []MultiAssetsInvestResultToken `json:"tokens"`
LPToken string `json:"from_token_addr"`
Allowance string `json:"allowance"`
AllowanceSatisfied bool `json:"allowance_satisfied"`
AllowanceData string `json:"allowance_data"`
}
type StakingHandler ¶
type StakingHandler struct {
Harvest stkh.HarvestFarm
}
func NewStakingHandler ¶
func NewStakingHandler() StakingHandler
func (*StakingHandler) ClaimReward ¶
func (h *StakingHandler) ClaimReward(c echo.Context) error
type StakingHandlerExitIn ¶
type StakingHandlerExitOut ¶
type StakingHandlerExitOut struct {
Data string `json:"data"`
TxFee string `json:"tx_fee"`
ContractAddr string `json:"contract_addr"`
StakingTokenAddr string `json:"staking_token_addr"`
RewardTokenAddr string `json:"reward_token_addr"`
RewardAmount string `json:"reward_amount"`
WithdrawAmount string `json:"withdraw_amount"`
RewardAmountPretty string `json:"reward_amount_pretty"`
WithdrawAmountPretty string `json:"withdraw_amount_pretty"`
}
type StakingHandlerStakeIn ¶
type StakingHandlerStakeIn struct {
Platform string `json:"platform" query:"platform" form:"platform"`
Dex string `json:"dex" query:"dex" form:"dex"`
Pool string `json:"pool" query:"pool" form:"pool"`
Amount string `json:"amount" query:"amount" form:"amount"`
Token string `json:"token" query:"token" form:"token"`
UserAddr string `json:"user" query:"user" form:"user"`
}
type StakingHandlerStakeOut ¶
type StakingHandlerStakeOut struct {
Data string `json:"data"`
TxFee string `json:"tx_fee"`
ContractAddr string `json:"contract_addr"`
FromTokenAddr string `json:"from_token_addr"`
FromTokenAmount string `json:"from_token_amount"`
Allowance string `json:"allowance"`
AllowanceSatisfied bool `json:"allowance_satisfied"`
AllowanceData string `json:"allowance_data"`
}
type StakingHandlerWithdrawIn ¶
type StakingHandlerWithdrawIn struct {
Platform string `json:"platform" query:"platform" form:"platform"`
Dex string `json:"dex" query:"dex" form:"dex"`
Pool string `json:"pool" query:"pool" form:"pool"`
UserAddr string `json:"user" query:"user" form:"user"`
Amount string `json:"amount" query:"amount" form:"amount"`
}
type SwapHandler ¶
type SwapHandler struct{}
func NewSwapHandler ¶
func NewSwapHandler() SwapHandler
type UserInvest ¶
type UserInvest struct {
Platform string `json:"platform"`
PoolName string `json:"pool_name"`
InvestType string `json:"invest_type"` // staking or addLiquidity
InteractContract string `json:"interact_contract"` // if is uniswap staking: user can ciaim reward & unstake
InvestLPAmount string `json:"invest_lp_amount"`
InitValue string `json:"init_value"`
CurrentValue string `json:"current_value"`
PendingReceiveAmount string `json:"pending_receive_amount"`
PendingReceiveValue string `json:"pending_receive_value"`
}
type UserInvestCash ¶
type UserInvestCash struct {
LastUpdateTime int64
UserInvestCash []*UserInvest
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.