灵符lingfu
L

ling-wallet

↓ 0 downloads

Ling Wallet: a post-quantum privacy-coin wallet, full node and HyperTorus miner for LNG

Windows · x86-64 ✕Linux · x86-64 ✕LingOS · x86-64LingOS · Pi 5 ARM64 ✕
Keywords wallet, cryptocurrency, lng, node, miner, ling
lingfu install ling-wallet
LicenseMIT
Authorsling-lin
READMECode / FilesVersionsDependency GraphDependentsSecurityBuildsSettings

Code / Files (116)

docs/LING_BACKEND.md
# UI ⇄ backend contract (Ling)

The UI (`ling/ui/*.ling`, main thread) calls only these functions, defined
in `ling/backend.ling`. `backend.ling` forwards to the real node (isolates
over channels) or, when started with `--mock`, to `ling/mock.ling`, which
implements the same functions as `mock_*` with simulated data. Every call
is non-blocking (anything slow happens in isolates and is polled).

Amounts are atomic units (1 LNG = 100 000 000), plain Ling numbers.
Hashes/keys are lowercase hex strings. Difficulty is a decimal string.

```text
form Summary   { unlocked, pending, short_address, address_hash, sync_kind, sync_height, sync_target, network_name }
                 sync_kind: "connecting" | "syncing" | "synced"
form TxRecord  { txid, direction, amount, fee, height, confirmations, timestamp, counterparty, memo, reduced }
                 direction: "in" | "out" | "mined"; height -1 = in mempool; counterparty/memo "" if none; reduced: bool
form Prepared  { id, to, address_hash, amount, fee, inputs, outputs, size_bytes, ring_size, reduced }
form Mining    { enabled, threads, max_threads, intensity, hashrate, blocks_found, difficulty, trace, pause_when_busy, paused_reason }
                 trace: list of [x, y, z, w, twist]; paused_reason "" if running
form NetStatus { peers, route, seeds_verified, height, difficulty, mempool, node_fp }
                 peers: list of [addr, inbound, fingerprint, is_seed, connected_secs]
```

| function | returns |
|---|---|
| `be_init()` | `()` — call once before the frame loop (reads CLI args) |
| `be_tick()` | `()` — call once per frame; drains backend messages |
| `be_state()` | `"nowallet"` / `"locked"` / `"unlocked"` |
| `be_create(password)` | `ok(words_list)` / `bad(msg)` |
| `be_restore(phrase, password)` | `ok(())` / `bad(msg)` |
| `be_unlock(password)` | `ok(())` / `bad(msg)` |
| `be_lock()` | `()` |
| `be_summary()` | `ok(Summary)` / `bad("locked")` |
| `be_history(limit)` | list of `TxRecord`, newest first |
| `be_lookup(address)` | `["pending"]` / `["verified", short_address, address_hash, identity_fp]` / `["failed", msg]` |
| `be_prepare(to, amount, memo)` | `ok(Prepared)` / `bad(msg)` |
| `be_confirm(id, password)` | `ok(())` / `bad(msg)` |
| `be_progress(id)` | `["none"]` / `["signing"]` / `["sent", txid]` / `["failed", msg]` |
| `be_export_bundle()` | `lngkey1…` string, `""` if locked |
| `be_reveal(password)` | `ok(words_list)` / `bad(msg)` |
| `be_change_password(old, new)` | `ok(())` / `bad(msg)` |
| `be_mining()` | `Mining` |
| `be_set_mining(enabled, threads, intensity, pause_when_busy)` | `()` |
| `be_network()` | `NetStatus` |
| `be_audit()` | list of `[denomination, outputs, key_images]` |
| `be_about()` | list of `[name, standard_or_status, detail]` rows for the About page |

← Back to index