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 / graphql_example.js
Last active April 14, 2021 09:00
Using GraphQL by Javascript
const query = `
query{
bitcoin{
blocks{
count
}
}
}
`;
const url = "https://graphql.bitquery.io/";
@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 / 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 / flashloanevent.ql
Created October 2, 2020 12:18
Aave Flashloan events from Bitquery GraphQL APIs
{
ethereum {
smartContractEvents(options: {desc: "block.height", limit: 10},
smartContractEvent: {is: "FlashLoan"},
smartContractAddress:
{is: "0x398eC7346DcD622eDc5ae82352F02bE94C62d119"}) {
block {
height
timestamp {
iso8601
@buddies2705
buddies2705 / pool_token_balance
Created September 14, 2020 15:05
Pool token balance
{
ethereum {
address(address: {is: "0x7bc3a77b1b8daa4bf4b38c710119b932c5b27925"}) {
balances {
currency {
symbol
}
value
}
}
@buddies2705
buddies2705 / uniswap_pool_initial_balance
Created September 14, 2020 15:03
uniswap pool initial balance
{
ethereum {
transfers(options: {asc: "block.timestamp.time", limit: 2}, amount: {gt: 0}, receiver: {is: "0x7bc3a77b1b8daa4bf4b38c710119b932c5b27925"}) {
block {
timestamp {
time(format: "%Y-%m-%d %H:%M:%S")
}
height
}
address: sender {
@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 / newuniswappools
Last active September 14, 2020 14:59
Get Newly Created Uniswap Pools (bitquery.io)
{
ethereum {
arguments(smartContractAddress: {is: "0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f"}, smartContractEvent: {is: "PairCreated"}, options: {desc: "block.height", limit: 3}) {
block {
height
}
argument {
name
}
reference {
@buddies2705
buddies2705 / bitquery-widget-bitcoin-transactions-over-time.html
Created July 29, 2020 12:19
Bitquery Widget Bitcoin Transactions over time widget
<!DOCTYPE html>
<html>
<head>
<title>Bitqyery Widget- Bitcoin Transactions over <time></time></title>
<link rel="stylesheet" media="all" href="https://cdn.jsdelivr.net/gh/bitquery/widgets@v1.3.5/dist/assets/css/widgets.css">
<script src="https://cdn.jsdelivr.net/gh/bitquery/widgets@v1.3.5/dist/widgets.js"></script>
</head>
<body>
@buddies2705
buddies2705 / USDT_Transactions.graphql
Last active July 24, 2020 22:34
GraphQL Query for USDT transaction greater than 2 million
query ($network: EthereumNetwork!, $token: String!, $limit: Int!,
$from: ISO8601DateTime, $till: ISO8601DateTime, $amount: Float!) {
ethereum(network: $network) {
transfers(options: {desc: "block.timestamp.time", limit: $limit},
amount: {gt: $amount}, time: {since: $from, till: $till},
currency: {is: $token}) {
block {
timestamp {
time(format: "%Y-%m-%d %H:%M:%S")
}