L
ling-wallet
↓ 0 downloadsLing Wallet: a post-quantum privacy-coin wallet, full node and HyperTorus miner for LNG
Keywords wallet, cryptocurrency, lng, node, miner, ling
lingfu install ling-walletCode / Files (116)
ling/backend.ling
# backend.ling — the be_* contract the UI codes against (docs/LING_BACKEND.md).
# Each call goes to the live backend (real_*), or to the simulated one
# (mock_*) when the app is started with --mock.
use "api.ling"
use "real_backend.ling"
use "mock.ling"
fn be_mock() { return st_get("be_mock", 0) > 0 }
fn be_init() {
bind args = get_args()
bind i = 0
while i < len(args) {
if list_get(args, i) == "--mock" { st_set("be_mock", 1) }
bind i = i + 1
}
if be_mock() { return mock_init() }
return real_init()
}
fn be_tick() {
if be_mock() { return mock_tick() }
return real_tick()
}
fn be_state() {
if be_mock() { return mock_state() }
return real_state()
}
fn be_create(password) {
if be_mock() { return mock_create(password) }
return real_create(password)
}
fn be_restore(phrase, password) {
if be_mock() { return mock_restore(phrase, password) }
return real_restore(phrase, password)
}
fn be_unlock(password) {
if be_mock() { return mock_unlock(password) }
return real_unlock(password)
}
fn be_lock() {
if be_mock() { return mock_lock() }
return real_lock()
}
fn be_summary() {
if be_mock() { return mock_summary() }
return real_summary()
}
fn be_history(limit) {
if be_mock() { return mock_history(limit) }
return real_history(limit)
}
fn be_lookup(address) {
if be_mock() { return mock_lookup(address) }
return real_lookup(address)
}
fn be_prepare(to, amount, memo) {
if be_mock() { return mock_prepare(to, amount, memo) }
return real_prepare(to, amount, memo)
}
fn be_confirm(id, password) {
if be_mock() { return mock_confirm(id, password) }
return real_confirm(id, password)
}
fn be_progress(id) {
if be_mock() { return mock_progress(id) }
return real_progress(id)
}
fn be_export_bundle() {
if be_mock() { return mock_export_bundle() }
return real_export_bundle()
}
fn be_reveal(password) {
if be_mock() { return mock_reveal(password) }
return real_reveal(password)
}
fn be_change_password(old, new) {
if be_mock() { return mock_change_password(old, new) }
return real_change_password(old, new)
}
fn be_mining() {
if be_mock() { return mock_mining() }
return real_mining()
}
fn be_set_mining(enabled, threads, intensity, pause_when_busy) {
if be_mock() { return mock_set_mining(enabled, threads, intensity, pause_when_busy) }
return real_set_mining(enabled, threads, intensity, pause_when_busy)
}
fn be_network() {
if be_mock() { return mock_network() }
return real_network()
}
fn be_audit() {
if be_mock() { return mock_audit() }
return real_audit()
}
fn be_about() {
if be_mock() { return mock_about() }
return real_about()
}