This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm run serve |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div id="app"> | |
<router-view /> | |
</div> | |
</template> | |
<script> | |
export default { | |
name: 'App' | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<TVChartContainer :symbol="'BITQUERY'" :interval="'60'"></TVChartContainer> | |
</template> | |
<script> | |
import TVChartContainer from "../components/TVChartContainer"; | |
export default { | |
name: "Home", | |
components: {TVChartContainer} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<div class="TVChartContainer" id="tv_chart_container"/> | |
</div> | |
</template> | |
<script> | |
import api from './api/index' | |
export default { | |
name: 'TVChartContainer', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
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} | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default(baseCurrency) => ({ | |
onReady: (callback) => { | |
setTimeout(() => callback(configurationData)); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const endpoint = 'https://graphql.bitquery.io'; |
NewerOlder