Here we can see how to get DAO unlockable amounts. An unlockable amount is either a deposit in the dao or a withdraw not yet unlocked. Both types have and approximated optimal time to unlock and the current compensation amount.
import { ConnectionService, Environments, WalletService, Logger } from"../src";constckbUrl="http://localhost:8117/rpc";constindexerUrl="http://localhost:8117/indexer";constmnemonic="private pond zero popular fashion omit february obscure pattern city camp pistol";constmain=async () => {try {constconnectionService=newConnectionService(ckbUrl, indexerUrl,Environments.Testnet);constwallet=newWalletService(connectionService, mnemonic);awaitwallet.synchronize();constunlockableAmounts=awaitwallet.getDAOUnlockableAmounts();Logger.info(unlockableAmounts); } catch (error) {Logger.error(`${error.name}: ${error.message}`); }};main();
Unlockable amounts are used to either withdraw and unlock from the DAO. To see the full documentation on the type go here.