Skip to content

Instantly share code, notes, and snippets.

View buddies2705's full-sized avatar
🏠
Working from home

Gaurav buddies2705

🏠
Working from home
  • Bangalore
View GitHub Profile
@buddies2705
buddies2705 / bitflyer-fetch-ohlcv-to-csv.py
Created May 28, 2020 21:56
Fetching Bitflyer ohlcv data
# -*- coding: utf-8 -*-
import os
import sys
import csv
import pandas as pd
import datetime
# -----------------------------------------------------------------------------
@buddies2705
buddies2705 / pool_details
Last active May 21, 2022 07:00
Uniswap pool initial balance
{
ethereum {
address(address: {is: "0x930ed81ad809603baf727117385d01f04354612e"}) {
annotation
address
smartContract {
contractType
currency {
symbol
name
@buddies2705
buddies2705 / graphql_example.rb
Created October 15, 2020 17:28
Using GraphQL with Ruby
require 'net/http'
require 'uri'
require 'json'
uri = URI.parse('https://graphql.bitquery.io/')
header = {'Content-Type': 'application/json'}
query = ' { bitcoin { blocks { count } } }'
puts query
# Create the HTTP objects
http = Net::HTTP.new(uri.host, uri.port)
@buddies2705
buddies2705 / DEX_OHLC.ql
Last active April 3, 2022 10:40
OHLC data for currency pair on DEX
{
ethereum(network: ethereum) {
dexTrades(options: {limit: 10, asc: "timeInterval.minute"},
protocol: {is: "Uniswap v2"},
date: {is: "2020-10-10"}
buyCurrency: {is: "0xdac17f958d2ee523a2206206994597c13d831ec7"},
sellCurrency: {is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}) {
timeInterval {
minute(count: 5)
}
@buddies2705
buddies2705 / data.py
Created October 30, 2020 11:21
week start from Thursday
# Hello World program in Python
import requests
import datetime
def run_query(query): # A simple function to use requests.post to make the API call.
request = requests.post('https://graphql.bitquery.io/',
json={'query': query})
if request.status_code == 200:
const Web3 = require('web3')
const httpProvider = "YOUR_QUIKNODE_RINKEBY_URL"
var web3 = new Web3(new Web3.providers.HttpProvider(httpProvider));
//create account
// console.log(web3.eth.accounts.create(web3.utils.randomHex(32)));
const privateKey = "0x8679f89a15e31cbeb7256f37db1a6df215a103261e7c54dd90f8cba9eeba0c70";
const address = "0x3318B0C23621d70B7F22a694d7D7E78f37208AD2";
web3.eth.accounts.wallet.add({
@buddies2705
buddies2705 / ExampleTokenBurnable.sol
Last active January 5, 2022 17:13
Burnable Token Example
pragma solidity ^0.4.24;
import "openzeppelin-solidity/contracts/token/ERC20/DetailedERC20.sol";
import "openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol";
import "openzeppelin-solidity/contracts/token/ERC20/BurnableToken.sol";
contract ExampleToken is StandardToken, DetailedERC20, BurnableToken{
//We inherited the DetailedERC20
@buddies2705
buddies2705 / NewlyCreatedTokenQuery.ql
Last active December 10, 2021 06:32
GraphQL API to get the newly created Ethereum Tokens
{
ethereum {
smartContractCalls(options: {desc: "block.height", limit: 10}, smartContractMethod: {is: "Contract Creation"}, smartContractType: {is: Token}) {
block {
height
timestamp {
time
}
}
smartContract {
@buddies2705
buddies2705 / graphql_example.py
Last active October 14, 2021 05:45
Using GraphQL with Python
#!/usr/bin/python
# -*- coding: utf-8 -*-
import requests
def run_query(query): # A simple function to use requests.post to make the API call.
headers = {'X-API-KEY': 'YOUR API KEY'}
request = requests.post('https://graphql.bitquery.io/',
json={'query': query}, headers=headers)
if request.status_code == 200:
@buddies2705
buddies2705 / howler.css
Created December 30, 2018 16:21
Radio streaming app
html {
width: 100%;
height: 100%;
overflow: hidden;
padding: 0;
margin: 0;
outline: 0;
}
body {