Commit e1dec817 authored by Bitcoin Please's avatar Bitcoin Please
Browse files

Added coin list to wallet UI.

parent 5da920d3
......@@ -20,7 +20,7 @@ export default {
'getOrbitDB',
]),
...mapGetters('system', [
...mapGetters([
'getFlags',
'getLocale',
]),
......@@ -30,7 +30,7 @@ export default {
'updateAssetSource',
]),
...mapActions('system', [
...mapActions([
'updateFlags',
'updateLocale',
]),
......
......@@ -20,7 +20,7 @@ const state = {
*
* NOTE: They are regularly updated, based on timestamps.
*/
assets: {},
assets: null,
}
/* Getters. */
......
/* Import modules. */
const msgpack = require('msgpack-lite')
/**
* Get Asset
*/
......@@ -6,8 +9,13 @@ const getAsset = (state) => (_ownerSlug, _assetId) => {
// console.log('GET ASSET (_ownerSlug):', _ownerSlug)
// console.log('GET ASSET (_assetId):', _assetId)
/* Validate state. */
if (!state || !state.assets) {
return null
}
/* Set owner. */
const owner = state.assets[_ownerSlug]
const owner = msgpack.decode(Buffer.from(state.assets[_ownerSlug]))
// console.log('GET ASSET (owner):', owner)
/* Validate owner. */
......
/* Import modules. */
const msgpack = require('msgpack-lite')
/**
* Set Asset
*
......@@ -21,6 +24,12 @@ const setAsset = (state, _asset) => {
// TODO: Validate body.
/* Validate assets. */
if (!state.assets) {
/* Initialize assets. */
state.assets = {}
}
/* Validate owner assets. */
if (!state.assets[ownerSlug]) {
/* Initialize owner assets. */
......@@ -28,7 +37,7 @@ const setAsset = (state, _asset) => {
}
/* Update the asset resource. */
state.assets[ownerSlug][id] = body
state.assets[ownerSlug][id] = msgpack.encode(body)
}
/* Export module. */
......
......@@ -41,7 +41,7 @@ const state = {
* An object, used to retrieve the address / location of
* our latest assets from our IPFS storage.
*/
assets: {},
assets: null,
/**
* Authorization Hashes
......@@ -50,7 +50,7 @@ const state = {
* In the case of a first-time use of supplied credentials, we will notify
* the user and request confirmation.
*/
authHashes: [],
authHashes: null,
/**
* Error Message
......@@ -83,7 +83,7 @@ const state = {
* NOTE: Unique 1-byte (hex) codes (up to 255) are used to reduce the size
* of this storage field.
*/
notices: {},
notices: null,
/**
* Notification Message
......
/* Import modules. */
const msgpack = require('msgpack-lite')
/**
* Get Asset Source
*
* Retrieves the latest source of data from our Eternal Db.
*/
const getAssetSource = (state, _assetType) => {
/* Validate state. */
if (!state || !state.assets) {
return null
}
/* Initialize assets. */
let assets = null
/* Set assets. */
try {
assets = msgpack.decode(Buffer.from(state.assets))
} catch (err) {
console.error(err) // eslint-disable-line no-console
assets = state.assets // DEPRECATED in June '20
}
/* Return source. */
return state.assets[_assetType]
return assets[_assetType]
}
/* Export module. */
......
/* Import modules. */
const msgpack = require('msgpack-lite')
/**
* Set Assets
*
......@@ -15,7 +18,7 @@ const setAssets = (state, _source) => {
console.log('SYSTEM ASSETS (updated):', updated)
/* Set updated (merged) assets. */
state.assets = updated
state.assets = msgpack.encode(updated)
}
/* Export module. */
......
......@@ -29,28 +29,28 @@
<td>July 21, 2017</td>
<td>Pending</td>
<td>$250 for 1 item</td>
<td><a href="#">View</a></td>
<td><a href="javascript://">View</a></td>
</tr>
<tr>
<td>#1146</td>
<td>July 22, 2017</td>
<td>Completed</td>
<td>$5150 for 3 item</td>
<td><a href="#">View</a></td>
<td><a href="javascript://">View</a></td>
</tr>
<tr>
<td>#1147</td>
<td>July 23, 2017</td>
<td>Cancel</td>
<td>$180 for 1 item</td>
<td><a href="#">View</a></td>
<td><a href="javascript://">View</a></td>
</tr>
<tr>
<td>#1148</td>
<td>July 24, 2017</td>
<td>Completed</td>
<td>$2700 for 1 item</td>
<td><a href="#">View</a></td>
<td><a href="javascript://">View</a></td>
</tr>
</tbody>
</table>
......
......@@ -29,28 +29,28 @@
<td>July 21, 2017</td>
<td>Pending</td>
<td>$250 for 1 item</td>
<td><a href="#">View</a></td>
<td><a href="javascript://">View</a></td>
</tr>
<tr>
<td>#1146</td>
<td>July 22, 2017</td>
<td>Completed</td>
<td>$5150 for 3 item</td>
<td><a href="#">View</a></td>
<td><a href="javascript://">View</a></td>
</tr>
<tr>
<td>#1147</td>
<td>July 23, 2017</td>
<td>Cancel</td>
<td>$180 for 1 item</td>
<td><a href="#">View</a></td>
<td><a href="javascript://">View</a></td>
</tr>
<tr>
<td>#1148</td>
<td>July 24, 2017</td>
<td>Completed</td>
<td>$2700 for 1 item</td>
<td><a href="#">View</a></td>
<td><a href="javascript://">View</a></td>
</tr>
</tbody>
</table>
......
......@@ -29,28 +29,28 @@
<td>July 21, 2017</td>
<td>Pending</td>
<td>$250 for 1 item</td>
<td><a href="#">View</a></td>
<td><a href="javascript://">View</a></td>
</tr>
<tr>
<td>#1146</td>
<td>July 22, 2017</td>
<td>Completed</td>
<td>$5150 for 3 item</td>
<td><a href="#">View</a></td>
<td><a href="javascript://">View</a></td>
</tr>
<tr>
<td>#1147</td>
<td>July 23, 2017</td>
<td>Cancel</td>
<td>$180 for 1 item</td>
<td><a href="#">View</a></td>
<td><a href="javascript://">View</a></td>
</tr>
<tr>
<td>#1148</td>
<td>July 24, 2017</td>
<td>Completed</td>
<td>$2700 for 1 item</td>
<td><a href="#">View</a></td>
<td><a href="javascript://">View</a></td>
</tr>
</tbody>
</table>
......
......@@ -29,28 +29,28 @@
<td>July 21, 2017</td>
<td>Pending</td>
<td>$250 for 1 item</td>
<td><a href="#">View</a></td>
<td><a href="javascript://">View</a></td>
</tr>
<tr>
<td>#1146</td>
<td>July 22, 2017</td>
<td>Completed</td>
<td>$5150 for 3 item</td>
<td><a href="#">View</a></td>
<td><a href="javascript://">View</a></td>
</tr>
<tr>
<td>#1147</td>
<td>July 23, 2017</td>
<td>Cancel</td>
<td>$180 for 1 item</td>
<td><a href="#">View</a></td>
<td><a href="javascript://">View</a></td>
</tr>
<tr>
<td>#1148</td>
<td>July 24, 2017</td>
<td>Completed</td>
<td>$2700 for 1 item</td>
<td><a href="#">View</a></td>
<td><a href="javascript://">View</a></td>
</tr>
</tbody>
</table>
......
......@@ -82,6 +82,67 @@
<div class="qr-code text-center d-md-none" v-html="qr" />
</div>
<div class="col-1">
<!-- offset fix -->
</div>
</div>
<div class="row my-3">
<div class="col-1">
<!-- offset fix -->
</div>
<div class="col-10">
<div class="account-content account-table">
<h3>My Available Coins</h3>
<div v-if="utxos" class="utxos">
<table>
<thead>
<tr>
<th>Order</th>
<th>Date</th>
<th>Status</th>
<th>Total</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr>
<td>#1145</td>
<td>July 21, 2017</td>
<td>Pending</td>
<td>$250 for 1 item</td>
<td><a href="javascript://">View</a></td>
</tr>
<tr>
<td>#1146</td>
<td>July 22, 2017</td>
<td>Completed</td>
<td>$5150 for 3 item</td>
<td><a href="javascript://">View</a></td>
</tr>
<tr>
<td>#1147</td>
<td>July 23, 2017</td>
<td>Cancel</td>
<td>$180 for 1 item</td>
<td><a href="javascript://">View</a></td>
</tr>
<tr>
<td>#1148</td>
<td>July 24, 2017</td>
<td>Completed</td>
<td>$2700 for 1 item</td>
<td><a href="javascript://">View</a></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-1">
<!-- offset fix -->
</div>
......@@ -129,6 +190,8 @@ export default {
blockchain: null,
balance: null,
showMnemonic: null,
utxos: null,
}
},
computed: {
......@@ -147,8 +210,13 @@ export default {
return 'loading...'
}
const balance = `${this.balance.rounded} ${this.balance.unit} | ${this.balance.fiat}`
/* Set balance. */
const balance = `
${this.balance.value} ${this.balance.unit} |
${this.balance.fiat}
`
/* Return balance. */
return balance
},
......@@ -195,10 +263,6 @@ export default {
// 'updateCoins',
]),
toggleMnemonic() {
this.showMnemonic = !this.showMnemonic
},
/**
* Initialize Blockchain
*/
......@@ -235,6 +299,20 @@ export default {
console.log('DEPOSIT (balance):', this.balance)
},
/**
* Update Transactions
*/
async updateTxs() {
this.utxos = true
},
/**
* Toggle Mnemonic
*/
toggleMnemonic() {
this.showMnemonic = !this.showMnemonic
},
/**
* Set Clipboard
*/
......@@ -295,6 +373,9 @@ export default {
/* Update balance. */
this.updateBalance()
/* Update transactions. */
this.updateTxs()
},
beforeDestroy() {
/* Validate blockchain. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment