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:
@@ -2,9 +2,20 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Hello wasm-pack!</title>
|
||||
<title>Zcash Demo Wallet</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Welcome to your demo Zcash wallet!</h1>
|
||||
<p>You can interact with it using a <code>zcashd</code> testnet node.</p>
|
||||
<div id="zcash-client-loading">
|
||||
<h2>Loading...</h2>
|
||||
</div>
|
||||
<div id="zcash-client-content" style="display: none">
|
||||
<h2 id="zcash-client-address"></h2>
|
||||
<p>That's your Zcash address!</p>
|
||||
<h2 id="zcash-client-balance"></h2>
|
||||
<p id="zcash-client-no-balance">You have no TAZ. Go <a href="https://faucet.testnet.z.cash/" target="blank">here</a> to get some!</p>
|
||||
</div>
|
||||
<script src="./bootstrap.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -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 = ''
|
||||
})
|
||||
|
Reference in New Issue
Block a user