{"id":28414410,"url":"https://github.com/blockchain-etl/ethers.js-bigquery","last_synced_at":"2026-02-27T10:45:11.408Z","repository":{"id":44003909,"uuid":"238004901","full_name":"blockchain-etl/ethers.js-bigquery","owner":"blockchain-etl","description":"ethers.js library, compiled for use in Google BigQuery","archived":false,"fork":false,"pushed_at":"2023-03-02T14:46:49.000Z","size":1129,"stargazers_count":40,"open_issues_count":10,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-25T06:41:39.159Z","etag":null,"topics":["blockchain-analytics","crypto","cryptocurrency","data-analytics","data-engineering","data-science","ethereum","ethers-bigquery","gcp","google-biguquery","google-cloud","google-cloud-platform","on-chain-analysis","web3"],"latest_commit_sha":null,"homepage":"https://medium.com/@medvedev1088/how-to-package-a-javascript-library-for-use-in-bigquery-2bf91061f66f","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blockchain-etl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-03T16:03:52.000Z","updated_at":"2024-05-09T04:26:14.000Z","dependencies_parsed_at":"2023-02-07T10:01:00.464Z","dependency_job_id":null,"html_url":"https://github.com/blockchain-etl/ethers.js-bigquery","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/blockchain-etl/ethers.js-bigquery","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockchain-etl%2Fethers.js-bigquery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockchain-etl%2Fethers.js-bigquery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockchain-etl%2Fethers.js-bigquery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockchain-etl%2Fethers.js-bigquery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blockchain-etl","download_url":"https://codeload.github.com/blockchain-etl/ethers.js-bigquery/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockchain-etl%2Fethers.js-bigquery/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29892055,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T09:48:51.284Z","status":"ssl_error","status_checked_at":"2026-02-27T09:48:43.992Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain-analytics","crypto","cryptocurrency","data-analytics","data-engineering","data-science","ethereum","ethers-bigquery","gcp","google-biguquery","google-cloud","google-cloud-platform","on-chain-analysis","web3"],"created_at":"2025-06-03T08:15:16.450Z","updated_at":"2026-02-27T10:45:11.400Z","avatar_url":"https://github.com/blockchain-etl.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ethers.js-bigquery\n\nThis module repackages [ethers.js](https://github.com/ethers-io/ethers.js/) for use in BigQuery, to decode Ethereum event logs and transaction inputs.\n\nhttps://medium.com/swlh/how-to-package-a-javascript-library-for-use-in-bigquery-2bf91061f66f\n\nExample usage:\n\n```\nCREATE TEMP FUNCTION\n  DECODE_ERC721_TRANSFER(data STRING, topics ARRAY\u003cSTRING\u003e)\n  RETURNS STRUCT\u003c`from` STRING, `to` STRING, tokenId STRING\u003e\n  LANGUAGE js AS \"\"\"\n    var CRYPTOKITTY_TRANSFER = {\n      \"anonymous\": false,\n      \"inputs\": [\n        {\n          \"indexed\": false,\n          \"name\": \"from\",\n          \"type\": \"address\"\n        },\n        {\n          \"indexed\": false,\n          \"name\": \"to\",\n          \"type\": \"address\"\n        },\n        {\n          \"indexed\": false,\n          \"name\": \"tokenId\",\n          \"type\": \"uint256\"\n        }\n      ],\n      \"name\": \"Transfer\",\n      \"type\": \"event\"\n    };\n\n    var interface_instance = new ethers.utils.Interface([CRYPTOKITTY_TRANSFER]);\n    var parsedLog = interface_instance.parseLog({topics: topics, data: data});\n\n    return parsedLog.values;\n\"\"\"\nOPTIONS\n  ( library=\"gs://blockchain-etl-bigquery/ethers.js\" );\nSELECT\n  DECODE_ERC721_TRANSFER(data, topics) AS transfer\nFROM\n  `bigquery-public-data.crypto_ethereum.logs`\nWHERE\n  topics[SAFE_OFFSET(0)] = \"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\" -- topic for Transfer(address,address,uint256) event\n  AND address = \"0x06012c8cf97bead5deae237070f9587f8e7a266d\"\nLIMIT 100;\n```\n\nThe above query returns decoded CryptoKitty transfer events. You can run it by pasting into the BigQuery console SQL\neditor https://console.cloud.google.com/bigquery. \n\n```\nCREATE TEMP FUNCTION\n  DECODE_CREATE_SALE_AUCTION(data STRING)\n  RETURNS ARRAY\u003cSTRING\u003e\n  LANGUAGE js AS \"\"\"\n    var CRYPTOKITTY_CREATE_SALE_AUCTION = {\n      \"constant\": false,\n      \"inputs\": [\n        {\n          \"name\": \"_kittyId\",\n          \"type\": \"uint256\"\n        },\n        {\n          \"name\": \"_startingPrice\",\n          \"type\": \"uint256\"\n        },\n        {\n          \"name\": \"_endingPrice\",\n          \"type\": \"uint256\"\n        },\n        {\n          \"name\": \"_duration\",\n          \"type\": \"uint256\"\n        }\n      ],\n      \"name\": \"createSaleAuction\",\n      \"outputs\": [],\n      \"payable\": false,\n      \"stateMutability\": \"nonpayable\",\n      \"type\": \"function\"\n    };\n\n    var interface_instance = new ethers.utils.Interface([CRYPTOKITTY_CREATE_SALE_AUCTION]);\n    \n    // You might need to wrap with try-catch here as transaction input is user provided data and might not follow abi. \n    var parsedTransaction = interface_instance.parseTransaction({data: data});\n\n    return parsedTransaction.args;\n\"\"\"\nOPTIONS\n  ( library=\"gs://blockchain-etl-bigquery/ethers.js\" );\nSELECT\n  `hash`, DECODE_CREATE_SALE_AUCTION(input) AS decoded_input\nFROM\n  `bigquery-public-data.crypto_ethereum.transactions`\nWHERE\n  STARTS_WITH(input, \"0x3d7d3f5a\") -- 4byte sighash for createSaleAuction(uint256,uint256,uint256,uint256) method\n  AND to_address = \"0x06012c8cf97bead5deae237070f9587f8e7a266d\"\nLIMIT 100;\n```\n\nThe above query returns decoded createSaleAuction() transactions inputs.\n\nTo include internal transactions use `bigquery-public-data.crypto_ethereum.traces` instead of \n`bigquery-public-data.crypto_ethereum.transactions`.\n\n## Credits\n- https://github.com/Arachnid/ethjs-abi-bigquery","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblockchain-etl%2Fethers.js-bigquery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblockchain-etl%2Fethers.js-bigquery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblockchain-etl%2Fethers.js-bigquery/lists"}