Simple demo displaying address of a fixed spending key

This commit is contained in:
Jack Grigg
2019-06-11 00:39:28 +01:00
parent a56c4c2630
commit 4caf14baa2
7 changed files with 214 additions and 10 deletions

View File

@@ -1,3 +1,25 @@
import * as wasm from 'zcash-client-sdk'
import { ZcashClient } from 'zcash-client-sdk'
wasm.greet();
const address = document.getElementById('zcash-client-address')
const balance = document.getElementById('zcash-client-balance')
const noBalance = document.getElementById('zcash-client-no-balance')
var zcashClient = new ZcashClient({
setAddress: (newAddress) => {
address.textContent = newAddress
},
updateBalance: (newBalance) => {
balance.textContent = `Balance: ${newBalance} TAZ`
if (newBalance > 0) {
noBalance.style.display = 'none'
} else {
noBalance.style.display = ''
}
}
})
zcashClient.load(() => {
// Loading complete, show the wallet
document.getElementById('zcash-client-loading').remove()
document.getElementById('zcash-client-content').style.display = ''
})