VetorChain API Documentation

Comprehensive guide to interact with the VetorChain blockchain. Build decentralized applications, deploy smart contracts, and integrate with our high-performance blockchain.

The Vetorchain Testnet is not yet live, all of these informations below are to explain what will happen when our testnet goes live.

API Endpoints

Get Chain State

GET/chain

Returns the current state of the blockchain including blocks, transactions, and network stats.

Response Example

Submit Transaction

POST/transaction

Submit a signed transaction to the network.

Request Example

{
                "sender": "0x74f3d56c550c2e18165259d7975dbf0b32eb4955",
                "receiver": "0x...",
                "amount": 1000000000000000000, // 1 VeLC
                "gas_fee": 500000000000000, // 0.0005 VeLC
                "signature": "3045022100...",
                "nonce": 1
                }

Response Example

{
                "sender": "0x74f3d56c550c2e18165259d7975dbf0b32eb4955",
                "receiver": "0x...",
                "amount": 1000000000000000000, // 1 VeLC
                "gas_fee": 500000000000000, // 0.0005 VeLC
                "signature": "3045022100...",
                "nonce": 1
                }

Deploy Contract

POST/deploy

Deploy a new smart contract to the blockchain.

Request Example

{
                "transaction": {
                    "sender": "0x...",
                    "receiver": "",
                    "amount": 0,
                    "gas_fee": 500000000000000,
                    "nonce": 2,
                    "signature": "3045022100..."
                },
                "contract_type": "token",
                "bytecode": "0x608060405234801561001057...",
                "language": "solidity",
                "name": "MyToken",
                "symbol": "MTK",
                "standard": "vrct",
                "metadata": {
                    "category": "utility"
                }
            }

Response Example

{
                "transaction": {
                    "sender": "0x...",
                    "receiver": "",
                    "amount": 0,
                    "gas_fee": 500000000000000,
                    "nonce": 2,
                    "signature": "3045022100..."
                },
                "contract_type": "token",
                "bytecode": "0x608060405234801561001057...",
                "language": "solidity",
                "name": "MyToken",
                "symbol": "MTK",
                "standard": "vrct",
                "metadata": {
                    "category": "utility"
                }
            }

Get Address Balance

GET/address/{address}/balance

Get the current balance of an address in base units.

Response Example

Stake VeLC

POST/stake

Stake VeLC to become a validator.

Request Example

{
                "address": "0x...",
                "amount": 10000000000000000000 // 10 VeLC (minimum)
                }

Response Example

{
                "address": "0x...",
                "amount": 10000000000000000000 // 10 VeLC (minimum)
                }

Smart Contract Standards

VRCT

VetorChain Token Standard - Basic fungible token with metadata support

Key Features

  • ERC-20 compatible
  • Additional metadata fields
  • Built-in gas optimizations
  • Category support (utility, governance, etc.)

Example Contract

// SPDX-License-Identifier: MIT
                pragma solidity ^0.8.0;

                contract MyToken {
                    string public name;
                    string public symbol;
                    uint8 public decimals = 18;
                    uint256 public totalSupply;
                    string public category;
                    
                    mapping(address => uint256) public balanceOf;
                    mapping(address => mapping(address => uint256)) public allowance;
                    
                    event Transfer(address indexed from, address indexed to, uint256 value);
                    event Approval(address indexed owner, address indexed spender, uint256 value);
                    
                    constructor(
                        string memory _name,
                        string memory _symbol,
                        uint256 _initialSupply,
                        string memory _category
                    ) {
                        name = _name;
                        symbol = _symbol;
                        totalSupply = _initialSupply * 10 ** uint256(decimals);
                        balanceOf[msg.sender] = totalSupply;
                        category = _category;
                    }
                    
                    function transfer(address _to, uint256 _value) public returns (bool success) {
                        require(balanceOf[msg.sender] >= _value);
                        balanceOf[msg.sender] -= _value;
                        balanceOf[_to] += _value;
                        emit Transfer(msg.sender, _to, _value);
                        return true;
                    }
                    
                    // ... additional functions ...
                }

VRCU

VetorChain Unique Asset Standard - For NFTs and unique digital assets

Key Features

  • ERC-721 compatible
  • Enhanced metadata support
  • Royalty standards
  • Batch operations

Example Contract


                    // SPDX-License-Identifier: MIT
                    pragma solidity ^0.8.0;

                    contract MyUniqueAsset {
                        string public name;
                        string public symbol;
                        string public baseURI;
                        
                        mapping(uint256 => address) private _owners;
                        mapping(address => uint256) private _balances;
                        mapping(uint256 => address) private _tokenApprovals;
                        mapping(address => mapping(address => bool)) private _operatorApprovals;
                        
                        event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
                        event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
                        event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
                        
                        constructor(string memory _name, string memory _symbol) {
                            name = _name;
                            symbol = _symbol;
                        }
                        
                        function mint(address to, uint256 tokenId) public {
                            require(to != address(0), "VRCU: mint to the zero address");
                            require(_owners[tokenId] == address(0), "VRCU: token already minted");
                            
                            _balances[to] += 1;
                            _owners[tokenId] = to;
                            
                            emit Transfer(address(0), to, tokenId);
                        }
                        
                        // ... additional functions ...
                    }
            

Need Help?

Join our developer community for support and collaboration: