VIZ has two forms of value: liquid VIZ you can send freely, and capital (SHARES) — staked VIZ that carries voting power, energy capacity, and a share of the reward pool. Moving between them is powering up and powering down. Every serious VIZ app touches this lifecycle.
Step 1 — Create a signing client
npm install @viz-cx/coreimport { createClient } from '@viz-cx/core'
// A signing client. Load the WIF from the environment — never hardcode
// it or put it in browser code.
const client = createClient({
account: 'alice',
activeKey: process.env.VIZ_ACTIVE_KEY!,
endpoint: 'https://node.viz.cx',
})Step 2 — Power up (stake)
transferToVesting converts liquid VIZ into SHARES. Point to at yourself to build your own stake, or at another account to hand them capital directly.
// Power up: convert liquid VIZ into capital (SHARES).
// 'from' is implicit (the client's account). 'to' can be yourself,
// or another account — a simple way to gift someone capital.
const result = await client.transferToVesting({
to: 'alice', // stake to your own account
amount: '100.000 VIZ', // liquid VIZ to convert
})
console.log('Powered up:', result.id)Step 3 — Power down (unstake)
withdrawVesting starts the reverse. The amount is denominated in SHARES (six decimals). Unlike powering up, the payout is gradual — the chain releases it back to liquid VIZ over scheduled installments.
// Power down: begin converting capital back to liquid VIZ.
// The amount is in SHARES (6 decimals), not VIZ.
// 'account' is implicit.
await client.withdrawVesting({
vestingShares: '50.000000 SHARES',
})
// The network returns it to your liquid balance in scheduled weekly
// installments — it is NOT instant. This lets governance stay stable.Optional — Cancel a power-down
Withdrawing 0.000000 SHARES stops an active power-down and keeps your capital staked.
// Cancel an in-progress power-down by withdrawing zero.
await client.withdrawVesting({
vestingShares: '0.000000 SHARES',
})Capital that's scheduled to power down still counts as yours until each installment lands. To lend capital to others without unstaking, see Delegate SHARES.