Skip to content

Instantly share code, notes, and snippets.

<template>
<div>
<div class="TVChartContainer" id="tv_chart_container"/>
</div>
</template>
<script>
import api from './api/index'
export default {
name: 'TVChartContainer',
@sayon-bitquery
sayon-bitquery / Bitquery.js
Last active November 1, 2023 14:34
tradingview-2:7
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"}
@sayon-bitquery
sayon-bitquery / terminal
Created June 21, 2021 18:19
TradingView#1
npm install lightweight-charts
@sayon-bitquery
sayon-bitquery / bash
Created June 25, 2021 15:40
tradingview-2:2
npx create-react-app tradingview-two
@sayon-bitquery
sayon-bitquery / bash
Created June 25, 2021 15:36
tradingview-2:1
npm install axios
@sayon-bitquery
sayon-bitquery / Home.vue
Created July 21, 2021 18:43
Tradingview-3.13
<template>
<TVChartContainer :symbol="'BITQUERY'" :interval="'60'"></TVChartContainer>
</template>
<script>
import TVChartContainer from "../components/TVChartContainer";
export default {
name: "Home",
components: {TVChartContainer}
}
@sayon-bitquery
sayon-bitquery / App.vue
Created July 21, 2021 18:49
Tradingview-3.14
<template>
<div id="app">
<router-view />
</div>
</template>
<script>
export default {
name: 'App'
};
@sayon-bitquery
sayon-bitquery / terminal
Created July 21, 2021 18:52
Tradingview-3.15
npm run serve
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'],
@sayon-bitquery
sayon-bitquery / index.js
Created July 21, 2021 17:36
Tradingview-3.10
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(