{"id":20987154,"url":"https://github.com/haxpor/inoutflow","last_synced_at":"2026-01-24T10:36:07.073Z","repository":{"id":57676680,"uuid":"463293591","full_name":"haxpor/inoutflow","owner":"haxpor","description":"A command line program to compute and print out in/out flow of native tokens of EVM-based chain for wallet/contract address","archived":false,"fork":false,"pushed_at":"2022-05-05T12:13:38.000Z","size":89,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-09T15:23:51.957Z","etag":null,"topics":["balance","blockchain","cli","crypto","in-out-flow","native-token","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/inoutflow","language":"Rust","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/haxpor.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":"2022-02-24T20:35:36.000Z","updated_at":"2024-05-16T09:09:30.000Z","dependencies_parsed_at":"2022-09-10T15:00:29.901Z","dependency_job_id":null,"html_url":"https://github.com/haxpor/inoutflow","commit_stats":null,"previous_names":["haxpor/inoutflow-bsc"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/haxpor/inoutflow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haxpor%2Finoutflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haxpor%2Finoutflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haxpor%2Finoutflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haxpor%2Finoutflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haxpor","download_url":"https://codeload.github.com/haxpor/inoutflow/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haxpor%2Finoutflow/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28725374,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T10:24:43.181Z","status":"ssl_error","status_checked_at":"2026-01-24T10:24:36.112Z","response_time":89,"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":["balance","blockchain","cli","crypto","in-out-flow","native-token","rust"],"created_at":"2024-11-19T06:16:10.399Z","updated_at":"2026-01-24T10:36:07.060Z","avatar_url":"https://github.com/haxpor.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# inoutflow\nA command line program to compute and print out in/out flow of native tokens of EVM-based chains (BSC, Ethereum, and Polygon) of the wallet/contract address\n\n# How it works\n\nIt will involve utilizing 3 related APIs of provided by upstream API platforms (bscscan.com, etherscan.io, or polygonscan.com)\n\n1. Get list of normal transactions\n2. Get list of internal transactions\n3. Get address's balance\n\nin order to have an understanding of native token (BNB, ETH, or MATIC) and balance respectively for\neach type of transaction as well as final balance for entire address.\n\n# Technical Tips\n\nWe can manually compute balance of target address ourselves without requesting\nto balance API by sum in/out flow of native tokens from normal, and internal transactions,\nand subtract by fees from normal transactions.\n\nWe have no need to try to get fees from internal transactions because internal\ntransaction is part of normal transaction, and its `gasPrice` and `gasUsed` fields\nare not available as part of API returned. So only fees from normal transactions\nare enough.\n\nIn short,\n\n```\nAddress balance = in/out of native-token flow of normal txs + in/out of native-token flow of internal txs + fees of normal txs\n```\n\n**NOTE**: We have no need to involve ERC-20/BEP-20, and ERC-721/BEP-721 transactions here because\nthey are also as part of normal transaction as they shared the same transaction hash.\nIt just happens that for this type of transaction, it sends `0` native tokens but other tokens.\nSo normal transactions' fees cover everything we need.\n\n# Setup\n\n1. Register an account on [bscscan.com](https://bscscan.com), [etherscan.io](https://etherscan.io/), and [polygonscan.com](https://polygonscan.com/).\n2. Create a new API key for all of API platforms in step 1.\n3. Define the following environment variables\n    * `INOUTFLOW_BSCSCAN_APIKEY` - for working with Binance Smart Chain (BSC)\n    * `INOUTFLOW_ETHERSCAN_APIKEY` - for working with Ethereum\n    * `INOUTFLOW_POLYGONSCAN_APIKEY` - for working with Polygon\n4. You might need to source it e.g. `source ~/.bash_aliases`.\n\n# Usage\n\n```\ninoutflow --chain \u003cCHAIN\u003e \u003cADDRESS\u003e\n```\n\nwhere `--chain` (or `-c`)'s possible values are `bsc`, `ethereum`, or `polygon`.\nSo the input address will be based on such specified chain.\n\nSample output\n\n1. Wallet address on BSC\n\n```bash\n$ inoutflow 0x5a52e96bacdabb82fd05763e25335261b270efcb --chain bsc\nFound 194 txs!\n- BNB outflow: 500000.0001 BNBs\n- BNB inflow: 507000.07693536405 BNBs\n- Net in/out balance: 7000.076835364045 BNBs\n\nFound 25 internal txs!\n- BNB outflow: 0 BNBs\n- BNB inflow: 0.000000339984886578 BNBs\n- Net in/out balance: 0.000000339984886578 BNBs\n\nTotal balance: 7000.052775939041 BNBs\n```\n\n2. Wallet address on Ethereum\n\n```bash\n$ inoutflow 0x49a2dcc237a65cc1f412ed47e0594602f6141936 --chain ethereum\nFound 3930 txs!\n- ETH outflow: 253655.5178577849 ETHs\n- ETH inflow: 51001.49522086296 ETHs\n- Net in/out balance: -202654.02263692193 ETHs\n\nFound 482 internal txs!\n- ETH outflow: 0 ETHs\n- ETH inflow: 203349.21092720772 ETHs\n- Net in/out balance: 203349.21092720772 ETHs\n\nTotal balance: 643.5772304060517 ETHs\n```\n\n3. Wallet address on Polygon\n\n```bash\n$ inoutflow 0xf89d7b9c864f589bbf53a82105107622b35eaa40 --chain polygon\nFound 161 txs!\n- MATIC outflow: 3258607.025878074 MATICs\n- MATIC inflow: 0.001 MATICs\n- Net in/out balance: -3258607.024878074 MATICs\n\nFound 38 internal txs!\n- MATIC outflow: 0 MATICs\n- MATIC inflow: 4004106.7107583876 MATICs\n- Net in/out balance: 4004106.7107583876 MATICs\n\nTotal balance: 745498.6568908329 MATICs\n```\n\n# License\nMIT, Wasin Thonkaew\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaxpor%2Finoutflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaxpor%2Finoutflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaxpor%2Finoutflow/lists"}