If there is an escrow and people click on it there should be a popup with three information: How many tokens where in total in the wallet, how many are unvested and how many are ready for withdraw. Already withdrawn is just total minus unvested minus ready to withdraw.
the withdraw button executes the withdraw
Total
// AccountId to check for total tokens
const account = '...'; // Replace with the actual AccountId
// Query total tokens
const totalTokens = await contract.query.getTotal(account, { gasLimit: -1 }, account);
if (totalTokens.result.isOk) {
console.log(`Total tokens: ${totalTokens.output.toHuman()}`);
} else {
console.error('Error fetching total tokens');
}
How many tokens are unvested:
// AccountId to check for unvested tokens
const account = '...'; // Replace with the actual AccountId
// Query unvested tokens
const unvestedTokens = await contract.query.getUnvested(account, { gasLimit: -1 }, account);
if (unvestedTokens.result.isOk) {
console.log(`Unvested tokens: ${unvestedTokens.output.toHuman()}`);
} else {
console.error('Error fetching unvested tokens');
}
How many tokens are available for withdraw
// AccountId to check for available withdrawal
const account = '...'; // Replace with the actual AccountId
// Query available tokens for withdrawal
const availableForWithdraw = await contract.query.getAvailableForWithdraw(account, { gasLimit: -1 }, account);
if (availableForWithdraw.result.isOk) {
console.log(`Available for withdrawal: ${availableForWithdraw.output.toHuman()}`);
} else {
console.error('Error fetching available tokens for withdrawal');
}
Withdraw:
// AccountId from which tokens will be withdrawn
const account = '...'; // Replace with the actual AccountId
// Withdraw vested tokens
await contract.tx.withdraw({ value, gasLimit }, account)
.signAndSend(sender, (result) => {
if (result.status.isInBlock) {
console.log('Withdrawal in a block');
} else if (result.status.isFinalized) {
console.log('Withdrawal finalized');
}
});
There should be a tooltip for escrow on the asset page, it should show up if https://service.genesis-dao.org/redoc/#operation/List%20Asset%20Holdings /
vesting_contract
is notnull
If there is an escrow and people click on it there should be a popup with three information: How many tokens where in total in the wallet, how many are unvested and how many are ready for withdraw. Already withdrawn is just total minus unvested minus ready to withdraw.
the withdraw button executes the withdraw
Total
How many tokens are unvested:
How many tokens are available for withdraw
Withdraw: