mirror of
https://github.com/Qortal/piratewallet-light-cli.git
synced 2025-07-30 20:01:26 +00:00
Simple demo displaying address of a fixed spending key
This commit is contained in:
@@ -1,5 +1,32 @@
|
||||
import * as wasm from 'zcash-client-backend-wasm'
|
||||
import { Client } from 'zcash-client-backend-wasm'
|
||||
|
||||
export function greet () {
|
||||
wasm.greet()
|
||||
const COIN = 100000000
|
||||
|
||||
export class ZcashClient {
|
||||
constructor (uiHandlers) {
|
||||
this.client = Client.new()
|
||||
this.uiHandlers = uiHandlers
|
||||
}
|
||||
|
||||
updateUI () {
|
||||
this.uiHandlers.updateBalance(this.client.balance() / COIN)
|
||||
}
|
||||
|
||||
load (onFinished) {
|
||||
var self = this
|
||||
|
||||
var loader = () => {
|
||||
// Register event handlers
|
||||
|
||||
// Initial UI updates
|
||||
self.uiHandlers.setAddress(self.client.address())
|
||||
self.updateUI()
|
||||
|
||||
// Finished loading!
|
||||
onFinished()
|
||||
}
|
||||
|
||||
// document.addEventListener('DOMContentLoaded', loader, false)
|
||||
loader()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user