Read state and send transactions with the gateway client in client.js.
import { Gateway } from "./client.js";
const gateway = new Gateway(process.env.QUANTOVA_GATEWAY);
const head = await gateway.head(); // chain head and height
const params = await gateway.chainParams(); // chain id and parameters
const balance = await gateway.balanceQTOV("Q1q9k...a91b"); // QTOVA few things to keep in mind.
- Account addresses are Q1 bech32m strings written with a capital Q. There are no 0x addresses.
- Amounts are denominated in Quon, and one QTOV is one million Quon. The
balanceQTOVhelper converts Quon to QTOV for you. - Every read is an HTTP POST to /v1/ with a flat JSON body, and the response is flat JSON.
The path is sign locally, then submit.
- Build the payload with the account nonce from
nonce, the chain id fromchainParams, and the fee and value in Quon. - Sign it with the account ML-DSA-65 key using the QCore.js keyring.
- Submit the signed payload with
submitTransaction, then poll for the record.
const nonce = await gateway.nonce(myAddress);
// const signed = await account.signTransaction({ to, value, nonce, chainId });
const { hash } = await gateway.submitTransaction(signed);
const recorded = await gateway.waitForTransaction(hash);A recorded transaction is included. QORUS gives deterministic finality, and a finalized block does not reorg. Treat value as settled only after the block that carries the transaction is finalized. For anything that moves funds, wait for finality before showing success.
The gateway is an HTTP POST to /v1/ with a flat JSON body.
node_inforeturns node identity, version, and network name.headreturns the current chain head and height.validatorsreturns the active QORUS committee.chain_paramsreturns the chain id and parameters.get_accountreturns an account record, including balance in Quon and nonce.get_transactionreturns a transaction by hash.submit_transactionsubmits a signed transaction and returns the accepted hash.get_blockreturns a block by height or by hash.supplyreturns total and circulating supply in Quon.get_containerreturns the deployed container at a contract address.get_storagereturns a storage slot of a container.get_eventsreturns emitted events matching a filter.
The full reference is in the developer documentation.