Repository navigation
Integration Examples
Verified against: Pinned source and release revisions, Qwertycoin mainnet where applicable, 2026-09-29.
Examples target authenticated
qwertycoin-wallet-rpc v2.0.2on loopback18082. Placeholder addresses/hashes are non-executable.
{"jsonrpc":"2.0","id":"balance-1","method":"get_balance","params":{"account_index":0,"strict":true}}A deterministic illustrative response shape (amounts are atomic units):
{"jsonrpc":"2.0","id":"balance-1","result":{"balance":12300000000,"unlocked_balance":12000000000,"multisig_import_needed":false,"per_subaddress":[],"blocks_to_unlock":0,"time_to_unlock":0}}- Call
validate_addresswithany_net_type:falseandallow_openalias:false. - Require
valid:true,nettype:"mainnet"and the expected address type. - Call
get_address_index; success proves the address belongs to the currently open wallet. - Re-read it with
get_addressusing the returned major/minor indexes.
Assign one subaddress per customer with create_address. Poll get_transfers/get_transfer_by_txid and store transaction hash, output/subaddress index, atomic amount, block height and observed canonical block hash. Credit only after the exchange's documented confirmation policy. Re-check credited deposits across reorganizations and make credit state reversible until final policy depth.
Use transfer with do_not_relay:true and get_tx_metadata:true to construct without broadcasting. Persist the returned metadata and fee, then use relay_tx once policy checks approve it. If a relay response times out, reconcile by hash/history/mempool before any retry.
from decimal import Decimal
import itertools, json, netrc, urllib.request
ATOMIC = Decimal(100_000_000)
counter = itertools.count(1)
RPC_URL = "http://127.0.0.1:18082/json_rpc"
login, _, password = netrc.netrc("/run/secrets/qwc-wallet-rpc.netrc").authenticators("127.0.0.1")
passwords = urllib.request.HTTPPasswordMgrWithDefaultRealm()
passwords.add_password(None, RPC_URL, login, password)
opener = urllib.request.build_opener(urllib.request.HTTPDigestAuthHandler(passwords))
def to_atomic(text: str) -> int:
value = Decimal(text) * ATOMIC
if value != value.to_integral_value() or value < 0:
raise ValueError("amount is not an exact non-negative atomic value")
return int(value)
def rpc(method: str, params: dict) -> dict:
body = json.dumps({"jsonrpc":"2.0","id":next(counter),"method":method,"params":params}).encode()
request = urllib.request.Request(
RPC_URL, body,
{"Content-Type":"application/json"}, method="POST")
with opener.open(request, timeout=15) as response:
payload = json.load(response)
if "error" in payload:
raise RuntimeError(f"RPC {payload['error'].get('code')}: {payload['error'].get('message')}")
if "result" not in payload:
raise RuntimeError("missing JSON-RPC result")
return payload["result"]
balance = rpc("get_balance", {"account_index": 0, "strict": True})
print(balance["unlocked_balance"]) # integer only; do not log addresses/keysIn production, use a client that supplies HTTP Digest credentials from a protected store, verifies response size/content type, caps concurrency, serializes wallet access and redacts secret-bearing fields.
Qwertycoin documentation · Verified against pinned revisions · Report a documentation issue
Start
Project
Wallets
Nodes and builds
- Run a Full Node
- Configuration and Ports
- Docker
- Linux Service Operation
- Upgrade and Recovery
- Synchronization Troubleshooting
- Build Overview
EPoSE
- Overview
- Service Node Quickstart
- Configuration and Identity
- Admission and Lifecycle
- Epochs and Qualification
- Rewards
- Monitoring and Diagnostics
- FAQ and Troubleshooting
APIs
- API Overview
- Daemon JSON-RPC
- Daemon HTTP and Binary RPC
- Wallet RPC Setup
- Wallet RPC Reference
- EPoSE RPC Reference
- Errors and Compatibility
- Integration Examples
- Complete Route Inventory
Mining and ecosystem
- RandomX Mining
- Solo Mining
- Pool Mining
- Pool Operator Integration
- Explorer and Web Wallet Hosting
- Exchanges and Compatibility
Contributing