123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299 |
- <template>
- <main>
- <!-- Page Section -->
- <section class="content">
- <div class="container-fluid">
- <div class="row">
- <div class="col-md-6">
- <!-- <Navbar /> -->
- <div class="card">
- <div class="card-body">
- <dl class="row" v-if="stats">
- <dt class="col-sm-4 text-right">Server</dt>
- <dd class="col-sm-8 mb-0">
- <a :href="serverUri" target="_blank">
- <strong class="text-info">{{serverUri}}</strong>
- </a>
- </dd>
- <dd class="col-sm-8 offset-sm-4 mt-0">
- <small class="text-danger">
- <strong>
- This is a public server operated by ...
- </strong>
- </small>
- </dd>
- <dt class="col-sm-4 text-right">Shuffle Port</dt>
- <dd class="col-sm-8">
- <strong class="text-info">{{stats.shufflePort}}</strong>
- </dd>
- <dt class="col-sm-4 text-right">Websocket Port</dt>
- <dd class="col-sm-8">
- <strong class="text-info">{{stats.shuffleWebSocketPort}}</strong>
- </dd>
- <dt class="col-sm-4 text-right">Ban Score</dt>
- <dd class="col-sm-8">
- <strong class="text-info">{{stats.banScore}}</strong>
- </dd>
- <dt class="col-sm-4 text-right">Banned</dt>
- <dd class="col-sm-8">
- <strong class="text-info">{{stats.banned}}</strong>
- </dd>
- <dt class="col-sm-4 text-right">Connections</dt>
- <dd class="col-sm-8">
- <strong class="text-info">{{stats.connections}}</strong>
- </dd>
- <dt class="col-sm-4 text-right">Pool Size</dt>
- <dd class="col-sm-8">
- <strong class="text-info">{{stats.poolSize}}</strong>
- </dd>
- </dl>
- <hr />
- <dl class="row" v-for="pool of pools(network)" :key="pool.version + '.' + pool.amount">
- <dt class="col-sm-4 text-right">Members</dt>
- <dd class="col-sm-8">
- <strong class="text-info">{{pool.members}}</strong>
- </dd>
- <dt class="col-sm-4 text-right">Amount</dt>
- <dd class="col-sm-8 mb-0">
- <strong class="text-info">{{satoshis(pool.amount)}}</strong> satoshis
- </dd>
- <dd class="col-sm-8 offset-sm-4 mt-0">
- <small><strong class="text-danger">{{bch(pool.amount)}}</strong> BCH</small> |
- <small><strong class="text-danger">{{fiat(pool.amount)}}</strong> USD</small>
- </dd>
- <dt class="col-sm-4 text-right">Type</dt>
- <dd class="col-sm-8">
- <strong class="text-info">{{pool.type}}</strong>
- </dd>
- <dt class="col-sm-4 text-right">Full</dt>
- <dd class="col-sm-8">
- <strong class="text-info">{{pool.full}}</strong>
- </dd>
- <dt class="col-sm-4 text-right">Version</dt>
- <dd class="col-sm-8">
- <strong class="text-info">{{pool.version}}</strong>
- </dd>
- </dl>
- <!-- <pre v-if="stats">
- <code>
- {{stats}}
- </code>
- </pre> -->
- </div>
- </div>
- </div>
- <div class="col-md-6">
- <div class="card">
- <div class="card-header">
- <h3 class="card-title">
- <i class="fas fa-info-circle mr-1"></i>
- CashShuffle Guide
- </h3>
- </div>
- <div class="card-body">
- <div class="mb-0">
- CashShuffle is an anonymity protocol designed to shuffle <em>(using the CoinJoin spec)</em> a coin input with 4 other random participants, each with an equal output.
- </div>
- <div class="mt-0 mb-3">
- <small class="text-danger"><strong>NOTE:</strong> Shuffled outputs <strong>MUST</strong> be handled with care to prevent privacy leaks.</small>
- </div>
- <dl class="row">
- <dt class="col-sm-4"># of Participants</dt>
- <dd class="col-sm-8">
- <strong class="text-info">5</strong> per pool
- </dd>
- <dt class="col-sm-4"># of Shuffle Pools</dt>
- <dd class="col-sm-8">
- Up to <strong class="text-info">8</strong> per server
- <br />Lowest: <strong class="text-info">100 bits</strong> <small><strong class="text-danger">{{fiat(10000)}}</strong> USD</small>
- <br />Highest: <strong class="text-info">1,000 BCH</strong> <small><strong class="text-danger">{{fiat(100000000000)}}</strong> USD</small>
- </dd>
- <!-- <dd class="col-sm-8 offset-sm-4">Donec id elit non mi porta gravida at eget metus.</dd> -->
- <dt class="col-sm-4">Avg Completion</dt>
- <dd class="col-sm-8">
- Minimum: <strong class="text-info">less than 1min</strong>
- <br />Maximum: <strong class="text-info">n/a</strong>
- </dd>
- <dt class="col-sm-4">Felis euismod semper eget lacinia</dt>
- <dd class="col-sm-8">Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo
- sit amet risus.
- </dd>
- </dl>
- </div>
- </div>
- </div>
- </div>
- </div>
- </section>
- </main>
- </template>
- <script>
- /* Import modules. */
- import numeral from 'numeral'
- export default {
- data: () => {
- return {
- network: 'mainnet',
- usd: 0,
- serverUri: null,
- stats: null,
- }
- },
- computed: {
- //
- },
- methods: {
- /**
- * Update Price
- */
- async updatePrice() {
- try {
- // const current = await this.bitbox.Price.current('usd')
- // console.log('CURRENT PRICE', current)
- // this.usd = current
- } catch (err) {
- console.error(err)
- }
- },
- /**
- * Pools
- *
- * Filters the available pools (based on network type).
- */
- pools(_network) {
- if (!this.stats || !this.stats.pools) {
- return []
- }
- if (_network === 'mainnet') {
- /* Filter pools. */
- const filtered = this.stats.pools.filter(pool => pool.version === 300)
- /* Sort pools. */
- const sorted = filtered.sort((a, b) => {
- return a.amount - b.amount
- })
- /* Return pools. */
- return sorted
- } else {
- /* Filter pools. */
- const filtered = this.stats.pools.filter(pool => pool.version === 301)
- /* Sort pools. */
- const sorted = filtered.sort((a, b) => {
- return a.amount - b.amount
- })
- /* Return pools. */
- return sorted
- }
- },
- /**
- * Satoshis
- *
- * Formated with commas.
- */
- satoshis(_satoshis) {
- return numeral(_satoshis).format('0,0')
- },
- /**
- * Bitcoin Cash (BCH)
- *
- * Calculated from satoshis to BCH value.
- */
- bch(_satoshis) {
- /* Calculate BCH value. */
- const bchVal = parseFloat(_satoshis / 100000000.0)
- return numeral(bchVal).format('0,0.[0000]')
- },
- /**
- * Fiat
- *
- * Calculated from satoshis to fiat (USD) value.
- */
- fiat(_satoshis) {
- /* Validate USD price. */
- if (!this.usd) {
- return 0.00
- }
- /* Calculate BCH value. */
- const bchVal = parseFloat(_satoshis / 100000000.0)
- /* Calculate fiat value. */
- const fiat = bchVal * parseFloat(this.usd / 100.0)
- /* Return value. */
- return numeral(fiat).format('$0,0.00[00]')
- },
- },
- created: async function () {
- /* Update USD. */
- this.updatePrice()
- /* Set server URI. */
- this.serverUri = 'https://shuffle.servo.cash:8080/stats'
- // fetch(this.serverUri)
- // .set('accept', 'json')
- // .end((err, res) => {
- // if (err) {
- // return console.error('API ERROR:', err)
- // }
- // console.log('API RESPONSE', res)
- // /* Set statistics. */
- // const stats = res.body
- // console.log('STATISTICS', stats)
- // /* Set statistics. */
- // this.stats = stats
- // })
- },
- mounted: function () {
- //
- },
- beforeDestroy: function () {
- //
- },
- }
- </script>
|