{"id":20527403,"url":"https://github.com/dteam-top/cfox","last_synced_at":"2025-04-14T04:22:08.715Z","repository":{"id":65150689,"uuid":"582584203","full_name":"DTeam-Top/cfox","owner":"DTeam-Top","description":"CFOX: A shell for eth dapp developers","archived":false,"fork":false,"pushed_at":"2024-10-11T05:12:09.000Z","size":858,"stargazers_count":16,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-10T11:34:57.790Z","etag":null,"topics":["cli","ethereum","shell"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/DTeam-Top.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-27T09:28:07.000Z","updated_at":"2024-10-09T04:05:10.000Z","dependencies_parsed_at":"2024-09-30T21:30:23.155Z","dependency_job_id":"6c362b20-860a-4f3b-abbc-fe36cea09e49","html_url":"https://github.com/DTeam-Top/cfox","commit_stats":{"total_commits":12,"total_committers":4,"mean_commits":3.0,"dds":"0.33333333333333337","last_synced_commit":"a35188d7eaf9480e4c848d00e1debe2142291e94"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DTeam-Top%2Fcfox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DTeam-Top%2Fcfox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DTeam-Top%2Fcfox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DTeam-Top%2Fcfox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DTeam-Top","download_url":"https://codeload.github.com/DTeam-Top/cfox/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248819722,"owners_count":21166531,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cli","ethereum","shell"],"created_at":"2024-11-15T23:18:44.608Z","updated_at":"2025-04-14T04:22:08.684Z","avatar_url":"https://github.com/DTeam-Top.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CFOX: A shell for eth dapp developers\n\n![build](https://github.com/DTeam-Top/cfox/actions/workflows/ci.yml/badge.svg)\n![check-code-coverage](https://img.shields.io/badge/code--coverage-87.92%25-green)\n[![npm](https://img.shields.io/npm/dt/cfox)](https://www.npmjs.com/package/cfox)\n[![npm (scoped)](https://img.shields.io/npm/v/cfox)](https://www.npmjs.com/package/cfox)\n\n```text\n  ______  _______   ______   ___   ___\n /      ||   ____| /  __  \\  \\  \\ /  /\n|  ,----'|  |__   |  |  |  |  \\  V  /\n|  |     |   __|  |  |  |  |   \u003e   \u003c\n|  `----.|  |     |  `--'  |  /  .  \\\n \\______||__|      \\______/  /__/ \\__\\\n                             CFox 0.0.5\n```\n\ncfox is a shell for eth dapp developers and provided, current supported commands includes:\n\n```text\n  Commands:\n\n    help [command...]                  Provides help for a given command.\n    exit                               Exits application.\n    \\e                                 Export all datas in db.\n    \\l [options]                       List all datas in db.\n    \\c [options]                       Change current account or chain.\n    \\a [options]                       Add a chain, account or token to db.\n    \\r [options]                       Remove a chain, account or token from db.\n    qr [account]                       Generate a QR Code for an account, current account will be used when account is missing.\n    balance [options]                  Show a balance.\n    send [options] \u003ctarget\u003e \u003camount\u003e   Send a amount of token to a target account.\n    nft [options] \u003ccontract\u003e           Show all tokens owned by current account in the contract.\n    transfer \u003ccontract\u003e \u003ctarget\u003e \u003cid\u003e  Transfer a nft to a target account.\n    gp                                 Show current gas price, if \"baseFeePerGas\" is not empty, then fast / standard / low are values of \"maxPriorityFeePerGas\". Otherwise, they are normal gas prices before EIP1559.\n    exec \u003ccontract\u003e                    Execute any function in the contract definition.\n    query \u003ccontract\u003e                   Query any event logs caused by the contract.\n    ens \u003cvalue\u003e                        Execute ENS action, the returned value depends on \u003cvalue\u003e: an ens name if it is an address; an address when it is an ens name.\n    wallets [options]                  Generate n wallets derived from a random wallet, following BIP-44\n    upload [options]                   Upload files to IPFS.\n    peek [options]                     Show metadata of a contract or a token.\n    nonce [account]                    Show current nonce details of an account, current account will be used when account is missing.\n    cancel [options]                   Cancel a tx sent by current account by nonce or transaction hash.\n    push \u003ctxHash\u003e                      Speed up a tx.\n    keys [options] [name] [value]      Configure api keys used by cfox, null will be used when no value is provided.\n```\n\n## Installation\n\n`npm install -g cfox`\n\n## Initialization\n\ncfox will ask the user to set the password on its first run:\n\n```text\n  ______  _______   ______   ___   ___\n /      ||   ____| /  __  \\  \\  \\ /  /\n|  ,----'|  |__   |  |  |  |  \\  V  /\n|  |     |   __|  |  |  |  |   \u003e   \u003c\n|  `----.|  |     |  `--'  |  /  .  \\\n \\______||__|      \\______/  /__/ \\__\\\n                             CFox 0.0.5\n\ncfox=#\nThis is your first time to run cfox, please do some configurations first.\nPlease set login password: ***\nPlease confirm the password: ***\ncfox=#\nPlease input password: ***\nLogin successfully!\n```\n\nAfter that, since there are no wallets added the prompt will use `?` for current wallet:\n\n```text\ncfox[?||mainnet]=#\n```\n\nThe prompt format: `cfox[current_wallet || current_network]`, both will be used by the provider or signer running the blockchain related command. You can use `\\c` to change them.\n\nNow, it's time to create a wallet for playing. The simplest way is to run `\\a -a`, which will create an random wallet and set it the current wallet because there is no one.\n\n```text\ncfox[?||mainnet]=# \\a -a\n✔ try to create a new account.\ncfox[0xBED16Cd70529D459f4A1A44D6Fe0c6B41364a00C||mainnet]=#\n```\n\nThe last step of initialization is to set the keys used by cfox. You can find all the external apis supported by running `keys -l`. Currently, the result:\n\n```text\ncfox[0xBED16Cd70529D459f4A1A44D6Fe0c6B41364a00C||mainnet]=#keys -l\n\n| name        | value |\n-----------------------\n| infura      |       |\n| morails     |       |\n| nft.storage |       |\n```\n\n\u003e Tip:\n\u003e\n\u003e You can always find the saved data in the home directory of cfox: \"${USER_HOME}/.cfox\".\n\u003e\n\u003e For example, it is \"~/.cfox\" on linux or macos.\n\n## Commands\n\nEach command has a detailed description and you can always know it by running `help \u003ccommand\u003e` or `\u003ccommand\u003e --help`. For example:\n\n```text\ncfox[0xBED16Cd70529D459f4A1A44D6Fe0c6B41364a00C||mainnet]=# help qr\n\n  Usage: qr [options] [account]\n\n  Generate a QR Code for an account, current account will be used when account is missing.\n\n  Options:\n\n    --help  output usage information\n```\n\nThe commands using the external apis:\n\n- `nft`, it will use morails as a fallback for those contracts not implementing `IERC721Enumerable`.\n- `upload`, it depends on nft.storage api to fulfill uploading datas to IPFS.\n\n\u003e Tips:\n\u003e\n\u003e 1. All command line arguments will be splitted by space.\n\u003e 1. When passing arguments to an event query, missing means null.\n\nExample #1: query all Transfer events in an range.\n\n```text\ncfox[0xBED16Cd70529D459f4A1A44D6Fe0c6B41364a00C||mumbai]=#query 0x0dc5a5d352e55dbb3d27c462de6b506517b86443\nEvent Abi: event Transfer(address indexed from, address indexed to, uint256 value)\nevent args (address,address):\nstart block (top n blocks if it is negative.): 30037846\nend block: 30038856\n✔ try to query event Transfer().\n\n...\n```\n\nExample #2: query all Transfer(,to) events in an range.\n\n```text\ncfox[0xBED16Cd70529D459f4A1A44D6Fe0c6B41364a00C||mumbai]=# query 0x0dc5a5d352e55dbb3d27c462de6b506517b86443\nEvent Abi: event Transfer(address indexed from, address indexed to, uint256 value)\nevent args (address,address):  0x3B057FD4Ba20D2129b1DD5355CEDE95D4E990ab4\nstart block (top n blocks if it is negative.): 30037846\nend block: 30038856\n✔ try to query event Transfer(,0x3B057FD4Ba20D2129b1DD5355CEDE95D4E990ab4).\n\n...\n```\n\nExample #3: query all Transfer(from) events in an range.\n\n```text\ncfox[0xBED16Cd70529D459f4A1A44D6Fe0c6B41364a00C||mumbai]=# query 0x0dc5a5d352e55dbb3d27c462de6b506517b86443\nEvent Abi: event Transfer(address indexed from, address indexed to, uint256 value)\nevent args (address,address): 0x0000000000000000000000000000000000000000\nstart block (top n blocks if it is negative.): 30037846\nend block: 30038856\n✔ try to query event Transfer(0x0000000000000000000000000000000000000000).\n\n...\n```\n\n## Development\n\n1. `git clone` this repository.\n1. `npm i` to install all the dependencies.\n1. `npm start` to start the shell.\n1. `npm test` to test all the testcases.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdteam-top%2Fcfox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdteam-top%2Fcfox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdteam-top%2Fcfox/lists"}