Manage Witnet wallets
Create HD-wallets and check Witnet account balances using the Witnet SDK.
Last updated
Was this helpful?
Create HD-wallets and check Witnet account balances using the Witnet SDK.
Last updated
Was this helpful?
The code examples below assume that the environment is properly set up as described in . You can easily adapt the examples to pass the URL of the Wit/RPC provider to use, and/or the wallet master key (and the password, if encrypted).
The wallet's coinbase address corresponds to the address that a node using the wallet's master key would derive for signing block and super-block proposals, data witnessing commits and data reveal transactions.
When importing a wallet you may rather derive only the accounts holding some $WIT balance. In these cases, a "gap" number can be provided, standing for the number of consecutively derived accounts with no available funds required before stopping the search. The search can also be limited to a maximum number of entries.
You can also search for some specific address within a wallet, even if holding no current balance. A "gap" parameter can also be provided, as to set the number of consecutive accounts with no funds to derive before giving up the search.
The balance of any Witnet address is divided in three different fields:
locked
Time-locked balance, in nanowits. Cannot be spent at this moment.
staked
Funds currently staked into one or more validators, in nanowits. Delegated stake can be eventually withdrawn. Once withdrawn, deposits will remain time-locked for at least two weeks.
unlocked
Currently available funds, in nanowits.