VIZ.cx
← Learn

Transfer VIZ

5 minbeginner

A transfer moves liquid VIZ from one account to another. It is the simplest write operation on the chain — no energy is spent, only the amount you send. This guide sends one using @viz-cx/core.

Unlike an award (which pays out of your energy reserve), a transfer debits your spendable balance directly. Capital held as SHARES is not touched — power it down first if you need it liquid.

Step 1 — Install the SDK

npm install @viz-cx/core

Step 2 — Create a signing client

Passing account and activeKey to createClient returns a client that can sign and broadcast. Keep the WIF out of client-side code — use it in a Node.js script or server only.

import { createClient } from '@viz-cx/core'

// Pass account + activeKey to get a signing-capable client.
// WARNING: a WIF is a private key. Never ship it in browser code
// or commit it — load it from an environment variable in a
// Node.js script or on your server.
const client = createClient({
  account: 'alice',                        // the sender
  activeKey: process.env.VIZ_ACTIVE_KEY!,  // WIF string from env
  endpoint: 'https://node.viz.cx',
})

Step 3 — Check the balance, then send

Amounts are strings with three decimals and the symbol, e.g. '1.000 VIZ'. A quick balance read keeps the failure client-side.

// Transfers move liquid VIZ, not capital (SHARES).
// Read the balance first so you fail fast instead of on-chain.
const [alice] = await client.api.getAccounts(['alice'])
const liquid = parseFloat(alice.balance.split(' ')[0])  // "42.000 VIZ" -> 42
if (liquid < 1) throw new Error('Not enough liquid VIZ')
// The 'from' field is implicit — it's the client's account.
const result = await client.transfer({
  to: 'bob',
  amount: '1.000 VIZ',   // always 3 decimals + the VIZ symbol
  memo: 'Thanks for the coffee',
})

console.log('Transaction ID:', result.id)
console.log('Block:         ', result.blockNum)

Memos are stored on-chain in plain textand are publicly visible — never put anything secret in one. When you're ready to reward contributions rather than just move funds, see Send an award.