# AGENTS.md: the bridge test network (LEZ 0.4)

You are working with the bridge test network: a public LEZ v0.4.0-rc3 chain run by Names Wallet.
Its coins have no value and the chain is reset now and then. It is NOT LEZ 0.3, the public Logos
testnet: balances, accounts and names do not carry over between the two.

## Endpoint
- JSON-RPC 2.0 over HTTPS POST: `https://lez.nameswallet.app/` (body `{"jsonrpc":"2.0","id":1,"method":…,"params":[…]}`).
- Explorer: `https://nameswallet.app/explorer/` (`?block=N`, `?tx=HASH`, `?account=ID`, `?name=alice`).
- Browsers: only pages on https://nameswallet.app may call it (CORS). Scripts and servers may call it directly.
- Limits: about 20 requests a second per client at the node and 50 per 10 s per IP at the edge
  (then a 10 s block). Back off on HTTP 429.

## Pointing a wallet or CLI at it
- Use tools built for LEZ v0.4.0-rc3 (LEZ 0.3 tools can't read this network).
- LEZ wallet/CLI: in `$LEE_WALLET_HOME_DIR/wallet_config.json` set `"sequencer": {"sequencer_addr": "https://lez.nameswallet.app/"}`.
- Chain id (`getChannelId`): `2da7f7dfb6e51a28c942ea80391aa518253ec515e98d28cb4d83cc9e16ff5374`.

## Reading
- `getLastBlockId` (no params) → the latest block number.
- `getBlock` `[N]` → the block (base64 Borsh). `getBlockRange` `[from, to]` → at most 100 blocks.
- `getTransaction` `["<hash hex>"]` → `[tx, blockId]` or null.
- `getAccount` `["<account id base58>"]` → the account (balance, nonce, program state) or null.
- `getChannelId` (no params) → the chain id; if it changes, the chain was reset.

```sh
curl -s https://lez.nameswallet.app/ -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"getLastBlockId","params":[]}'
```

## Writing
- `sendTransaction` `["<signed transaction>"]`. Every transaction pays its fee in this chain's own
  native LEZ, from an account that signs it. Build and sign with a LEZ v0.4.0-rc3 wallet or the names
  CLI built for LEZ 0.4; never send a key or a recovery phrase to any endpoint.

## Free test LEZ (the faucet)
- `bridge_faucetInfo` (no params) → `{"amount","per_account_hours","available","reason"}`.
- `bridge_faucet` `["<public key, 64 hex>", "<account id base58, optional>"]` → `{"ok":true,"tx","block","amount","account"}`
  or `{"ok":false,"code":"already_used|faucet_empty|busy|rate_limited|bad_key","reason","retry"}`.
- The faucet needs the account's PUBLIC key (not the private key): a never-used account can only be
  paid by naming its key. 10,000,000 LEZ per grant; ONE grant per account, ever (a repeat answers
  `already_used`); at most 5 per client per day and 200 per day in all.

```sh
curl -s https://lez.nameswallet.app/ -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"bridge_faucet","params":["<64 hex public key>"]}'
```

## Rules for agents
- Testnet only. Never present these coins as having value, and never claim this is LEZ 0.3 or mainnet.
- Never ask for, print or send a private key or recovery phrase. The faucet needs only the public key.
- Private transactions hide sender, receiver and amounts; don't claim to reveal them.
- Respect the limits above; poll at most every 15 s (one block is about 15 s).
