blockchain-etl/ethers.js-bigquery
blockchain-etl/ethers.js-bigquery has 39 GitHub stars and 9 forks. Star changes are not measured yet. Last checked 2026-11-10 04:23 UTC. Last push 2023-03-02.
ethers.js library, compiled for use in Google BigQuery
측정된 스타 증가
- in 24h
- 업데이트 지연
- in 7 days
- 업데이트 지연
- in 15 days
- 업데이트 지연
- in 1 month
- 업데이트 지연
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Originalethers.js-bigquery
This module repackages ethers.js for use in BigQuery, to decode Ethereum event logs and transaction inputs.
https://medium.com/swlh/how-to-package-a-javascript-library-for-use-in-bigquery-2bf91061f66f
Example usage:
CREATE TEMP FUNCTION
DECODE_ERC721_TRANSFER(data STRING, topics ARRAY<STRING>)
RETURNS STRUCT<`from` STRING, `to` STRING, tokenId STRING>
LANGUAGE js AS """
var CRYPTOKITTY_TRANSFER = {
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "from",
"type": "address"
},
{
"indexed": false,
"name": "to",
"type": "address"
},
{
"indexed": false,
"name": "tokenId",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
};
var interface_instance = new ethers.utils.Interface([CRYPTOKITTY_TRANSFER]);
var parsedLog = interface_instance.parseLog({topics: topics, data: data});
return parsedLog.values;
"""
OPTIONS
( library="gs://blockchain-etl-bigquery/ethers.js" );
SELECT
DECODE_ERC721_TRANSFER(data, topics) AS transfer
FROM
`bigquery-public-data.crypto_ethereum.logs`
WHERE
topics[SAFE_OFFSET(0)] = "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" -- topic for Transfer(address,address,uint256) event
AND address = "0x06012c8cf97bead5deae237070f9587f8e7a266d"
LIMIT 100;
The above query returns decoded CryptoKitty transfer events. You can run it by pasting into the BigQuery console SQL editor https://console.cloud.google.com/bigquery.
CREATE TEMP FUNCTION
DECODE_CREATE_SALE_AUCTION(data STRING)
RETURNS ARRAY<STRING>
LANGUAGE js AS """
var CRYPTOKITTY_CREATE_SALE_AUCTION = {
"constant": false,
"inputs": [
{
"name": "_kittyId",
"type": "uint256"
},
{
"name": "_startingPrice",
"type": "uint256"
},
{
"name": "_endingPrice",
"type": "uint256"
},
{
"name": "_duration",
"type": "uint256"
}
],
"name": "createSaleAuction",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
};
var interface_instance = new ethers.utils.Interface([CRYPTOKITTY_CREATE_SALE_AUCTION]);
// You might need to wrap with try-catch here as transaction input is user provided data and might not follow abi.
var parsedTransaction = interface_instance.parseTransaction({data: data});
return parsedTransaction.args;
"""
OPTIONS
( library="gs://blockchain-etl-bigquery/ethers.js" );
SELECT
`hash`, DECODE_CREATE_SALE_AUCTION(input) AS decoded_input
FROM
`bigquery-public-data.crypto_ethereum.transactions`
WHERE
STARTS_WITH(input, "0x3d7d3f5a") -- 4byte sighash for createSaleAuction(uint256,uint256,uint256,uint256) method
AND to_address = "0x06012c8cf97bead5deae237070f9587f8e7a266d"
LIMIT 100;
The above query returns decoded createSaleAuction() transactions inputs.
To include internal transactions use bigquery-public-data.crypto_ethereum.traces instead of
bigquery-public-data.crypto_ethereum.transactions.
Credits
관련 프로젝트 살펴보기
Asabeneh/30-Days-Of-Python
30 Days of Python 프로그래밍 챌린지는 Python 프로그래밍 언어를 30일 동안 배우기 위한 단계별 가이드입니다. 이 챌린지는 100일 이상 걸릴 수 있습니다. 자신의 속도에 맞춰 진행하세요. 다음 동영상도 도움이 될 수 있습니다: https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw
78,560 스타grafana/grafana
개방적이고 조합 가능한 옵저버빌리티 및 데이터 시각화 플랫폼입니다. Prometheus, Loki, Elasticsearch, InfluxDB, Postgres 등 여러 소스의 메트릭, 로그, 트레이스를 시각화합니다.
77,830 스타redis/redis
실시간 데이터 기반 애플리케이션을 구축하는 개발자에게 Redis는 가장 선호되고, 가장 빠르며, 기능이 가장 풍부한 캐시, 데이터 구조 서버이자 문서 및 벡터 쿼리 엔진입니다.
77,395 스타apache/superset
Apache Superset는 데이터 시각화 및 데이터 탐색 플랫폼입니다.
75,473 스타