Qwai Get the wallet

Build on Qwai.

READ

A plain JSON API.

Every node answers over HTTPS. No key, no sign-up. Any website may call it.

Read the docsAPI reference

GET https://rpc.qwai.io/api/status
GET https://rpc.qwai.io/api/account/<address>
GET https://rpc.qwai.io/api/tx/<id>
GET https://rpc.qwai.io/api/dex/tokens

POST https://rpc.qwai.io/api/query
{ "contract": "<address>", "input": "<hex>" }
SIGN

The wallet is already there.

Qwail gives every page window.qwail. Your site asks; the user approves; the wallet signs and sends. Your code never touches a key.

const { address } = await window.qwail.connect();

const result = await window.qwail.signAndSend({
  kind: 'call',
  contract: '<address>',
  input: '<hex>',
  value: '1.5',
});
// { id, ok, output, created }
CONTRACTS

Rust in, RISC-V out.

A contract is an ordinary Rust program compiled for RISC-V. It can store data, hold and send QWAI, emit events, and call other contracts. Every instruction is metered, and a failed call undoes everything it did.

#![no_std]
#![no_main]
use contract_sdk as chain;

fn main() {
    let who = chain::caller();
    let sent = chain::value();
    chain::storage_set(&chain::hash(&who), &sent.to_le_bytes());
    chain::emit(&who);
}

chain::entry!(main);
START

One folder. One guide.

The developer kit has the contract toolkit, a starter contract, the real token, NFT and exchange contracts, and one guide written for people and AI assistants alike. Hand the guide to your assistant and describe what you want.

  • Tokens. One standard program, with tax for holders, creator and burn built in.
  • NFTs. One collection per contract, pictures and details stored on the chain, found by wallets and explorers automatically.
  • Your own. Anything you can write in Rust, checked instruction by instruction.

What contracts get from the chain.

Storage

Keyed values in the chain's state tree, private to each contract.

Coins

Receive QWAI with a call, hold it, send it.

Events

Records any app can read back, filtered by contract or subject.

Calls

Call other contracts, and check exactly which program they run.