mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-26 16:25:21 +00:00
df2c4271e4
* status: refactor deposit type to claim type * refactor all deposit types to claim types * refactor msg withdraw * update module errors * refactor querier and rest * update spec * update tests * update handler, alias * refactor to IterateDepositsByDenom * v0_12 legacy types * fix build
31 lines
1.2 KiB
Markdown
31 lines
1.2 KiB
Markdown
<!--
|
|
order: 3
|
|
-->
|
|
|
|
# Messages
|
|
|
|
There are three messages in the harvest module. Deposit allows users to deposit assets to the harvest module. In version 2, depositors will be able to use their deposits as collateral to borrow from harvest. Withdraw removes assets from the harvest module, returning them to the user. Claim allows users to claim earned HARD tokens.
|
|
|
|
```go
|
|
// MsgDeposit deposit asset to the harvest module.
|
|
type MsgDeposit struct {
|
|
Depositor sdk.AccAddress `json:"depositor" yaml:"depositor"`
|
|
Amount sdk.Coin `json:"amount" yaml:"amount"`
|
|
}
|
|
|
|
// MsgWithdraw withdraw from the harvest module.
|
|
type MsgWithdraw struct {
|
|
Depositor sdk.AccAddress `json:"depositor" yaml:"depositor"`
|
|
Amount sdk.Coin `json:"amount" yaml:"amount"`
|
|
}
|
|
|
|
// MsgClaimReward message type used to claim HARD tokens
|
|
type MsgClaimReward struct {
|
|
Sender sdk.AccAddress `json:"sender" yaml:"sender"`
|
|
Receiver sdk.AccAddress `json:"receiver" yaml:"receiver"`
|
|
DepositDenom string `json:"deposit_denom" yaml:"deposit_denom"`
|
|
RewardMultiplier string `json:"reward_multiplier" yaml:"reward_multiplier"`
|
|
DepositType string `json:"deposit_type" yaml:"deposit_type"`
|
|
}
|
|
```
|