Untitled
unknown
python
2 years ago
787 B
11
Indexable
from python_graphql_client import GraphqlClient
import asyncio
ws = GraphqlClient(endpoint="wss://streaming.bitquery.io/graphql")
query = """
subscription MyQueryWithVariables($network: evm_network!, $limit: Int!, $symbols: [String!]!) {
EVM(network: $network) {
Transfers(
limit: {count: $limit}
orderBy: {descending: Block_Number}
where: {Transfer: {Currency: {Symbol: {in: $symbols}}}}
) {
Block {
Number
Hash
}
Transfer {
Currency {
Symbol
Name
}
Amount
}
}
}
}
"""
variables = {
"network": "eth",
"limit": 2,
"symbols": ["ETH", "USDT"]
}
asyncio.run(ws.subscribe(query=query, variables=variables, handle=print))
Editor is loading...
Leave a Comment