Ckb Wallet SDK
  • What is Ckb Wallet SDK?
  • Getting Started
    • Installation
    • Launch your nervos local node
    • Instantiate a connection service
    • Instantiate your wallet service
    • Next steps
  • Examples
    • Introduction
    • How to run them
    • Examples code
      • Create wallet
      • Import wallet error
      • Import wallet
      • Wallet balance
      • Get transactions
      • Send transaction
      • Get DAO Statistics
      • Get DAO unlockable amounts
      • Deposit in DAO
      • Withdraw or unlock from DAO
      • Send Tokens
      • Issue Tokens
  • Usage
    • Introduction
    • Creating a connection for each network
    • Wallet loader
    • Use your wallet where necessary
  • Services Documentation
    • Preface
    • WalletService
      • Static methods
      • Common methods
      • CKB methods
      • DAO methods
      • Nft methods
      • Token methods
    • ConnectionService
    • Logger
Powered by GitBook
On this page
  1. Examples
  2. Examples code

Get DAO unlockable amounts

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";

const ckbUrl = "http://localhost:8117/rpc";
const indexerUrl = "http://localhost:8117/indexer";
const mnemonic = "private pond zero popular fashion omit february obscure pattern city camp pistol";

const main = async () => {
    try {
        const connectionService = new ConnectionService(ckbUrl, indexerUrl, Environments.Testnet);
        const wallet = new WalletService(connectionService, mnemonic);
        await wallet.synchronize();

        const unlockableAmounts = await wallet.getDAOUnlockableAmounts();
        Logger.info(unlockableAmounts);
    } catch (error) {
        Logger.error(`${error.name}: ${error.message}`);
    }
};

main();
PreviousGet DAO StatisticsNextDeposit in DAO

Last updated 3 years ago

Unlockable amounts are used to either withdraw and unlock from the DAO. To see the full documentation on the type go .

here