Token Program
A Token program on the Velas blockchain.
This program defines a common implementation for Fungible and Non Fungible tokens.
Background
Solana's programming model and the definitions of the Velas terms used in this document are available at:
Source
The Token Program's source is available on github
Interface
The Token Program is written in Rust and available on crates.io and docs.rs.
Auto-generated C bindings are also available here
JavaScript bindings are available that support loading the Token Program on to a chain and issue instructions.
See the SPL Associated Token Account program for convention around wallet address to token account mapping and funding.
Command-line Utility
The spl-token
command-line utility can be used to experiment with SPL tokens. Once you have Rust installed, run:
$ cargo install spl-token-cli
Run spl-token --help
for a full description of available commands.
Configuration
The spl-token
configuration is shared with the velas
command-line tool.
Current Configuration
velas config get
Config File: ${HOME}/.config/velas/cli/config.yml
RPC URL: https://api.mainnet-beta.velas.com
WebSocket URL: wss://api.mainnet-beta.velas.com/ (computed)
Keypair Path: ${HOME}/.config/velas/id.json
Cluster RPC URL
See Velas clusters for cluster-specific RPC URLs
velas config set --url https://api.devnet.velas.com
Default Keypair
See Keypair conventions for information on how to setup a keypair if you don't already have one.
Keypair File
velas config set --keypair ${HOME}/new-keypair.json
Airdrop VLX
Creating tokens and accounts requires VLX for account rent deposits and transaction fees. If the cluster you are targeting offers a faucet, you can get a little VLX for testing:
velas airdrop 1