Transferring assets

This tutorial walks you through how to transfer custom assets between accounts on the VSL network using the vsl-cli tool.

We assume you’ve already created and funded accounts and have a custom asset in circulation. If not, check out the Creating Accounts and Creating Custom Assets tutorials first.

Step 1: Enter REPL Mode

Start the interactive CLI in temporary configuration mode:

vsl-cli repl --tmp-config

Step 2: Connect to a Network

You can either connect to a local node or the remote Devnet.

Option A: Local Node

If you're running a local VSL node (e.g., with a genesis.json file), make sure it’s running in another terminal:

vsl-cli server:launch --db tmp --genesis-file "genesis.json"

Option B: Remote Devnet

To use the public test network:

vsl> network:add remote --url https://rpc.vsl.pi2.network
vsl> network:use remote

Verify network health:

vsl> health:check

Step 3: Check Available Accounts and Balances

Switch to the account holding the asset (e.g., alice):

vsl> account:use alice

Check asset balances:

vsl> asset:balances

Confirm the recipient’s account exists (e.g., bob):

vsl> account:list

Step 4: Transfer the Asset

To transfer a custom asset (e.g., DEMO) to another account:

vsl> asset:transfer --asset DEMO --to bob --amount 0x64

Here:

  • --asset is the symbol of the asset.

  • --to is the recipient’s account name.

  • --amount is the amount (in hexadecimal).

Step 5: Verify the Transfer

Switch to the recipient account:

vsl> account:use bob

Check asset balances:

vsl> asset:balances

You should see the transferred amount of DEMO.

Optional: View Asset Info

You can get more details about a specific asset:

vsl> asset:get DEMO

Cleanup (Optional)

If you're working locally and want to remove everything:

vsl> server:stop
vsl> account:remove alice
vsl> account:remove bob
vsl> network:remove remote

Next Steps

You've successfully transferred custom assets on the VSL network. You can now explore how to submit and settle claims, subscribe to settled events, or create new tokens.

Need help? Join the Pi Squared Discord and connect with the community!

Last updated

Was this helpful?