| Crates.io | astroport-vesting |
| lib.rs | astroport-vesting |
| version | 1.4.0 |
| created_at | 2023-07-20 17:04:44.169574+00 |
| updated_at | 2024-06-20 08:56:05.333435+00 |
| description | Astroport Vesting Contract holds tokens and releases them to the beneficiary over time. |
| homepage | https://astroport.fi |
| repository | https://github.com/astroport-fi/astroport |
| max_upload_size | |
| id | 921558 |
| size | 115,452 |
The Generator Vesting contract progressively unlocks ASTRO that can then be distributed to LP stakers via the Generator contract.
Initializes the contract with the address of the ASTRO token.
{
"token_addr": "terra..."
}
receiveCW20 receive msg.
{
"receive": {
"sender": "terra...",
"amount": "123",
"msg": "<base64_encoded_json_string>"
}
}
RegisterVestingAccountsCreates vesting schedules for the ASTRO token. Each vesting token should have the Generator contract address as the VestingContractAddress. Also, each schedule will unlock tokens at a different rate according to its time duration.
Execute this message by calling the ASTRO token contract address.
{
"send": {
"contract": <VestingContractAddress>,
"amount": "999",
"msg": "base64-encodedStringOfWithdrawMsg"
}
}
In send.msg, you may encode this JSON string into base64 encoding.
{
"RegisterVestingAccounts": {
"vesting_accounts": [
{
"address": "terra...",
"schedules": {
"start_point": {
"time": "1634125119000000000",
"amount": "123"
},
"end_point": {
"time": "1664125119000000000",
"amount": "123"
}
}
}
]
}
}
claimTransfer vested tokens from all vesting schedules that have the same VestingContractAddress (address that's vesting tokens).
{
"claim": {
"recipient": "terra...",
"amount": "123"
}
}
withdraw_from_active_scheduleWithdraw tokens from active vesting schedule.
Withdraw is possible if there is only one active vesting schedule. Active schedule's remaining amount must be greater than withdraw amount.
This endpoint terminates current active schedule (updates end_point) and creates a new one with remaining amount minus withdrawn amount.
{
"withdraw_from_active_schedule": {
"account": "terra...",
"recipient": "terra...",
"withdraw_amount": "123"
}
}
All query messages are described below. A custom struct is defined for each query response.
configReturns the vesting token contract address (the ASTRO token address).
{
"config": {}
}
vesting_accountReturns all vesting schedules with their details for a specific vesting recipient.
{
"vesting_account": {
"address": "terra..."
}
}
vesting_accountsReturns a paginated list of vesting schedules in chronological order. Given fields are optional.
{
"vesting_accounts": {
"start_after": "terra...",
"limit": 10,
"order_by": {
"desc": {}
}
}
}
available amountReturns the claimable amount (vested but not yet claimed) of ASTRO tokens that a vesting target can claim.
{
"available_amount": {
"address": "terra..."
}
}