Skip to content

Instantly share code, notes, and snippets.

View terminal
npm run serve
View App.vue
<template>
<div id="app">
<router-view />
</div>
</template>
<script>
export default {
name: 'App'
};
View Home.vue
<template>
<TVChartContainer :symbol="'BITQUERY'" :interval="'60'"></TVChartContainer>
</template>
<script>
import TVChartContainer from "../components/TVChartContainer";
export default {
name: "Home",
components: {TVChartContainer}
}
View TVChartContainer.vue
<template>
<div>
<div class="TVChartContainer" id="tv_chart_container"/>
</div>
</template>
<script>
import api from './api/index'
export default {
name: 'TVChartContainer',
View TVChartContainer.vue
mounted() {
const widgetOptions = {
symbol: this.symbol,
datafeed: api(this.baseCurrency),
interval: this.interval,
container_id: this.containerId,
library_path: this.libraryPath,
theme: 'Dark',
locale: 'en',
disabled_features: ['use_localstorage_for_settings'],
View index.js
getBars: async(symbolInfo, resolution, periodParams, onHistoryCallback, onErrorCallback) =>{
try{
if (resolution==='1D') {
resolution = 1440;
}
const response2 = await axios.post(Bitquery.endpoint, {
query: `
{
ethereum(network: bsc) {
dexTrades(
@sayon-bitquery
sayon-bitquery / index.js
Last active Jul 21, 2021
Tradingview-3.9
View index.js
{
ethereum(network: bsc) {
dexTrades(
options: {asc: "timeInterval.minute"}
date: {since: "2021-06-20T07:23:21.000Z", till: "${new Date().toISOString()}"}
exchangeAddress: {is: "0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73"}
baseCurrency: {is: "${baseCurrency}"},
quoteCurrency: {is: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"},
tradeAmountUsd: {gt: 10}
)
View index.js
resolveSymbol: async (symbolName, onSymbolResolvedCallback, onResolveErrorCallback) =>{
const response = await axios.post(
Bitquery.endpoint, {
query: `
{
ethereum(network: bsc) {
dexTrades(
options: {desc: ["block.height", "transaction.index"], limit: 1}
exchangeAddress: {is: "0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73"}
View index.js
export default(baseCurrency) => ({
onReady: (callback) => {
setTimeout(() => callback(configurationData));
},
View Bitquery.js
export const endpoint = 'https://graphql.bitquery.io';