Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Gaurav buddies2705

🏠
Working from home
  • Bangalore
View GitHub Profile
@buddies2705
buddies2705 / pool_details
Last active May 21, 2022
Uniswap pool initial balance
View pool_details
{
ethereum {
address(address: {is: "0x930ed81ad809603baf727117385d01f04354612e"}) {
annotation
address
smartContract {
contractType
currency {
symbol
name
@buddies2705
buddies2705 / graphql_example.rb
Created Oct 15, 2020
Using GraphQL with Ruby
View graphql_example.rb
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 Apr 3, 2022
OHLC data for currency pair on DEX
View DEX_OHLC.ql
{
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 Oct 30, 2020
week start from Thursday
View data.py
# 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:
View compoundFinance.js
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 Jan 5, 2022
Burnable Token Example
View ExampleTokenBurnable.sol
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 Dec 10, 2021
GraphQL API to get the newly created Ethereum Tokens
View NewlyCreatedTokenQuery.ql
{
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 Oct 14, 2021
Using GraphQL with Python
View graphql_example.py
#!/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:
View bitflyer-fetch-ohlcv-to-csv.py
# -*- coding: utf-8 -*-
import os
import sys
import csv
import pandas as pd
import datetime
# -----------------------------------------------------------------------------
@buddies2705
buddies2705 / howler.css
Created Dec 30, 2018
Radio streaming app
View howler.css
html {
width: 100%;
height: 100%;
overflow: hidden;
padding: 0;
margin: 0;
outline: 0;
}
body {