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
export const endpoint = 'https://graphql.bitquery.io'; | |
export const GET_COIN_INFO =` | |
{ | |
ethereum(network: bsc) { | |
dexTrades( | |
options: {desc: ["block.height", "transaction.index"], limit: 1} | |
exchangeAddress: {is: "0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73"} | |
baseCurrency: {is: "0x2170ed0880ac9a755fd29b2688956bd959f933f8"} | |
quoteCurrency: {is: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"} |
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 install lightweight-charts |
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
npx create-react-app tradingview-two |
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 install axios |
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 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
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
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( |
NewerOlder