Skip to content

Commit

Permalink
Merge pull request #417 from theQRL/master
Browse files Browse the repository at this point in the history
Even Testnet version with Mainnet version
  • Loading branch information
jplomas committed Jun 9, 2022
2 parents cbe1c5e + 7f625e7 commit b93d43c
Show file tree
Hide file tree
Showing 9 changed files with 619 additions and 419 deletions.
6 changes: 3 additions & 3 deletions .meteor/packages
Expand Up @@ -6,12 +6,12 @@

meteor-base@1.5.1 # Packages every Meteor app needs to have
mobile-experience@1.1.0 # Packages for a great mobile UX
mongo@1.13.0 # The database Meteor supports right now
mongo@1.15.0 # The database Meteor supports right now
blaze-html-templates # Compile .html files into Meteor Blaze views
tracker@1.2.0 # Meteor's client-side reactive programming library
standard-minifier-js@2.7.2 # JS minifier run for production mode
standard-minifier-js@2.8.0 # JS minifier run for production mode
es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers
ecmascript@0.16.0 # Enable ECMAScript2015+ syntax in app code
ecmascript@0.16.2 # Enable ECMAScript2015+ syntax in app code
kadira:blaze-layout # Layout manager for blaze (works well with FlowRouter)
practicalmeteor:mocha # A package for writing and running your meteor app and package tests with mocha
johanbrook:publication-collector # Test a Meteor publication by collecting its output
Expand Down
2 changes: 1 addition & 1 deletion .meteor/release
@@ -1 +1 @@
METEOR@2.5.1
METEOR@2.7.3
50 changes: 25 additions & 25 deletions .meteor/versions
@@ -1,13 +1,13 @@
allow-deny@1.1.0
allow-deny@1.1.1
audit-argument-checks@1.0.7
autoupdate@1.8.0
babel-compiler@7.7.0
babel-runtime@1.5.0
babel-compiler@7.9.0
babel-runtime@1.5.1
base64@1.0.12
binary-heap@1.0.11
blaze@2.5.0
blaze-html-templates@1.2.0
blaze-tools@1.1.1
blaze-html-templates@1.2.1
blaze-tools@1.1.3
boilerplate-generator@1.7.1
browser-policy-common@1.0.11
browser-policy-content@1.1.1
Expand All @@ -24,11 +24,11 @@ ddp-server@2.5.0
deps@1.0.12
diff-sequence@1.1.1
dynamic-import@0.7.2
ecmascript@0.16.0
ecmascript@0.16.2
ecmascript-runtime@0.8.0
ecmascript-runtime-client@0.12.1
ecmascript-runtime-server@0.11.0
ejson@1.1.1
ejson@1.1.2
es5-shim@4.8.0
fastclick@1.0.13
fetch@0.1.1
Expand All @@ -37,9 +37,9 @@ force-ssl-common@1.1.0
frozeman:storage@0.1.9
geojson-utils@1.0.10
hot-code-push@1.0.4
html-tools@1.1.1
htmljs@1.1.0
http@1.4.3
html-tools@1.1.3
htmljs@1.1.1
http@1.4.4
id-map@1.1.1
inter-process-messaging@0.1.1
jayuda:flx-qrcode@0.0.1
Expand All @@ -54,21 +54,21 @@ logging@1.3.1
meteor@1.10.0
meteor-base@1.5.1
meteor-platform@1.2.6
minifier-js@2.7.2
minimongo@1.7.0
minifier-js@2.7.4
minimongo@1.8.0
mobile-experience@1.1.0
mobile-status-bar@1.1.0
modern-browsers@0.1.7
modules@0.17.0
modules-runtime@0.12.0
momentjs:moment@2.29.1
mongo@1.13.0
mongo-decimal@0.1.2
modern-browsers@0.1.8
modules@0.18.0
modules-runtime@0.13.0
momentjs:moment@2.29.3
mongo@1.15.0
mongo-decimal@0.1.3
mongo-dev-server@1.1.0
mongo-id@1.0.8
npm-mongo@3.9.1
npm-mongo@4.3.1
oaf:moment-duration-format@1.3.2
observe-sequence@1.0.16
observe-sequence@1.0.20
ordered-dict@1.1.0
practicalmeteor:chai@2.1.0_1
practicalmeteor:loglevel@1.2.0_2
Expand All @@ -79,18 +79,18 @@ promise@0.12.0
qrl:browser-policy@1.1.1
qrl:browser-policy-common@1.0.13
random@1.2.0
react-fast-refresh@0.2.0
react-fast-refresh@0.2.3
reactive-dict@1.3.0
reactive-var@1.0.11
reload@1.3.1
retry@1.1.0
routepolicy@1.1.1
session@1.2.0
simple:json-routes@2.1.0
socket-stream-client@0.4.0
simple:json-routes@2.3.1
socket-stream-client@0.5.0
spacebars@1.2.0
spacebars-compiler@1.2.1
standard-minifier-js@2.7.2
standard-minifier-js@2.8.0
steeve:jquery-qrcode@0.2.2
templating@1.4.1
templating-compiler@1.4.1
Expand All @@ -101,5 +101,5 @@ tracker@1.2.0
ui@1.0.13
underscore@1.0.10
url@1.3.2
webapp@1.13.0
webapp@1.13.1
webapp-hashing@1.1.0
18 changes: 9 additions & 9 deletions imports/startup/server/cron.js
@@ -1,7 +1,8 @@
/* eslint max-len: 0 */
/* global _ */
import { HTTP } from 'meteor/http'
import { JsonRoutes } from 'meteor/simple:json-routes'
import {SHA512} from 'jscrypto/es6'
import { SHA512 } from 'jscrypto/es6'
// import helpers from '@theqrl/explorer-helpers'
/* eslint import/no-cycle: 0 */
import {
Expand All @@ -13,6 +14,7 @@ import {
} from '/imports/api/index.js'

import { SHOR_PER_QUANTA } from '../both/index.js'
import axios from 'axios'

const refreshBlocks = () => {
const request = { filter: 'BLOCKHEADERS', offset: 0, quantity: 10 }
Expand Down Expand Up @@ -231,15 +233,13 @@ function refreshStats() {
homechart.insert(chartLineData)
}

const refreshQuantaUsd = () => {
const apiUrl = 'https://bittrex.com/api/v1.1/public/getmarketsummary?market=btc-qrl'
const apiUrlUSD = 'https://bittrex.com/api/v1.1/public/getmarketsummary?market=usdt-btc'
const response = Meteor.wrapAsync(apiCall)(apiUrl)
const responseUSD = Meteor.wrapAsync(apiCall)(apiUrlUSD)
const usd = response.result[0].Last * responseUSD.result[0].Last
const price = { price: usd }
const refreshQuantaUsd = async () => {
const apiUrl = 'https://market-data.automated.theqrl.org/'
const response = await axios.get(apiUrl)
console.log(response.data)
const { price } = response.data
quantausd.remove({})
quantausd.insert(price)
quantausd.insert({ price })
}

const refreshPeerStats = () => {
Expand Down
14 changes: 6 additions & 8 deletions imports/startup/server/index.js
@@ -1,4 +1,6 @@
/* eslint no-console: 0, max-len: 0 */
/* global _ */

// server-side startup
import grpc from '@grpc/grpc-js'
import protoloader from '@grpc/proto-loader'
Expand All @@ -10,7 +12,7 @@ import qrlAddressValdidator from '@theqrl/validate-qrl-address'
import { JsonRoutes } from 'meteor/simple:json-routes'
import { check } from 'meteor/check'
import { BrowserPolicy } from 'meteor/qrl:browser-policy'
import { blockData } from '/imports/api/index.js'
import { blockData, quantausd } from '/imports/api/index.js'
import '/imports/startup/server/cron.js' /* eslint-disable-line */
import {
EXPLORER_VERSION, SHOR_PER_QUANTA, anyAddressToRaw,
Expand Down Expand Up @@ -686,13 +688,9 @@ Meteor.methods({
QRLvalue() {
console.log('QRLvalue method called')
this.unblock()
const apiUrl = 'https://bittrex.com/api/v1.1/public/getmarketsummary?market=btc-qrl'
const apiUrlUSD = 'https://bittrex.com/api/v1.1/public/getmarketsummary?market=usdt-btc'
// asynchronous call to API
const response = Meteor.wrapAsync(apiCall)(apiUrl)
const responseUSD = Meteor.wrapAsync(apiCall)(apiUrlUSD)
const usd = response.result[0].Last * responseUSD.result[0].Last
return usd
const priceData = quantausd.findOne({})
console.log(priceData)
return priceData.price
},

status() {
Expand Down
2 changes: 1 addition & 1 deletion imports/ui/components/address/address.html
Expand Up @@ -100,7 +100,7 @@ <h3 class="value">Signatories</h3>
<a class="item active" data-tab="transactions">Quanta</a>
<a class="item" data-tab="tokenBalances">Tokens</a>
<a class="item" data-tab="nftBalances">NFTs</a>
<a class="item" data-tab="otsTrackerTab">OTS Tracker</a>
<a class="item" data-tab="otsTrackerTab">OTS</a>
<a class="item" data-tab="slavesTab">Slaves</a>
</div>
<div class="ui bottom attached tab segment active" data-tab="transactions">
Expand Down
56 changes: 32 additions & 24 deletions imports/ui/components/address/address.js
Expand Up @@ -793,34 +793,42 @@ Template.address.helpers({
return Session.get('tokensHeld')
},
ownTokens() {
const tokens = Session.get('tokensHeld')
let count = tokens.length
if (count > 0) {
_.each(tokens, (token) => {
if (token.nft) {
count -= 1
}
})
}
if (count > 0) {
return true
try {
const tokens = Session.get('tokensHeld')
let count = tokens.length
if (count > 0) {
_.each(tokens, (token) => {
if (token.nft) {
count -= 1
}
})
}
if (count > 0) {
return true
}
return false
} catch (e) {
return false
}
return false
},
ownNFTs() {
const tokens = Session.get('tokensHeld')
let count = tokens.length
if (count > 0) {
_.each(tokens, (token) => {
if (!token.nft) {
count -= 1
}
})
}
if (count > 0) {
return true
try {
const tokens = Session.get('tokensHeld')
let count = tokens.length
if (count > 0) {
_.each(tokens, (token) => {
if (!token.nft) {
count -= 1
}
})
}
if (count > 0) {
return true
}
return false
} catch (e) {
return false
}
return false
},
addressValidation() {
try {
Expand Down

0 comments on commit b93d43c

Please sign in to comment.