{"id":13630025,"url":"https://github.com/attestate/eth-fun","last_synced_at":"2025-04-30T14:33:17.601Z","repository":{"id":41051660,"uuid":"368526876","full_name":"attestate/eth-fun","owner":"attestate","description":"A functional and state-less library for the Ethereum JSON-RPC.","archived":false,"fork":false,"pushed_at":"2024-05-27T14:11:25.000Z","size":17136,"stargazers_count":25,"open_issues_count":12,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-08T21:38:21.175Z","etag":null,"topics":["ethereum","functional","solidity","stateless","web3"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/attestate.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2021-05-18T12:45:46.000Z","updated_at":"2024-05-27T14:11:28.000Z","dependencies_parsed_at":"2024-06-19T03:04:09.343Z","dependency_job_id":"b76c0852-7744-4186-a554-413a6de27145","html_url":"https://github.com/attestate/eth-fun","commit_stats":null,"previous_names":["rugpullindex/eth-fun"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/attestate%2Feth-fun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/attestate%2Feth-fun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/attestate%2Feth-fun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/attestate%2Feth-fun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/attestate","download_url":"https://codeload.github.com/attestate/eth-fun/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224170599,"owners_count":17267590,"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":["ethereum","functional","solidity","stateless","web3"],"created_at":"2024-08-01T22:01:27.588Z","updated_at":"2024-11-12T04:15:19.232Z","avatar_url":"https://github.com/attestate.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# eth-fun\n\n[![Node.js CI](https://github.com/attestate/eth-fun/actions/workflows/node.js.yml/badge.svg)](https://github.com/attestate/eth-fun/actions/workflows/node.js.yml)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"/assets/eth-fun-logo-light.svg#gh-light-mode-only\" /\u003e\n  \u003cimg src=\"/assets/eth-fun-logo-dark.svg#gh-dark-mode-only\" /\u003e\n\u003c/p\u003e\n\n### A collection of independent utility functions for Ethereum. Build with functional approach in mind.\n\n#### [API Documentation](/API.md) | [Changelog](/CHANGELOG.md) | [Contributing](readme.md/#Contributing)\n\n## Why Use eth-fun?\n\nYou should use eth-fun when you want to have _fun_. We try to build our\ncode according to the properties below.\n\n- **Functional** in nature\n- **Modular** and as **loosely** coupled as possible.\n- **Stateless**; such that we come as close as possible towards atomic,\n  safely-failable (and catchable) actions.\n- Built with a modern front end's needs in mind. Ideally, the whole lib is\n  **tree-shakeable** and produces the **smallest footprint** possible when being sent\n  to a client's browser.\n\neth-fun is an attempt at developing Ethereum in a one-way-dataflow fashion\n(similar to react.js). Today, eth-fun can't sign payloads. It works best in on-chain\ndata extractors like https://rugpullindex.com and https://neume.network. eth-fun is a\n**work-in-progress**.\n\n## Installation\n\n```bash\n$ npm i eth-fun\n```\n\n## Example\n\n#### Get the latest block number and fetch information about it\n\n```js\nimport { blockNumber, getBlockByNumber } from \"eth-fun\";\n\n// URL of an Ethereum node\nconst options = {\n  url: \"https://cloudflare-eth.com\",\n};\n\n(async () =\u003e {\n  const currentNumber = await blockNumber(options); // latest block\n  const includeTxBodies = false;\n  const block = await getBlockByNumber(options, currentNumber, includeTxBodies);\n  console.log(block); // information about the block\n})();\n```\n\nSimilar to the above used functions i.e. `blockNumber` and `getBlockByNumber`\neth-fun implements more utility functions to talk with an Ethereum node using\n[JSON RPC](https://ethereum.org/en/developers/docs/apis/json-rpc/).\n\n## API\n\nVisit [API documentation](/API.md) for a complete list of functions and their examples.\n\n- [`options object`](/API.md#options-object)\n- [`await getBlockByNumber(options, blockNumber, includeTxBodiesw)`](/API.md#await-getblockbynumberoptions-blocknumber-includetxbodies)\n- [`await getTransactionReceipt(options, txId)`](/API.md#await-gettransactionreceiptoptions-txid)\n- [`toHex(number)`](/API.md#tohexnumber)\n- [`fromHex(number)`](/API.md#fromhexnumber)\n- [`encodeFunctionSignature(selector)`](/API.md#web3-eth-abi-functions)\n- [`encodeEventSignature(selector)`](/API.md#web3-eth-abi-functions)\n- [`encodeParameters(typesArray, parameters)`](/API.md#web3-eth-abi-functions)\n- [`encodeFunctionCall(jsonInterface, parameters)`](/API.md#web3-eth-abi-functions)\n- [`decodeLog(inputs, data, topics)`](/API.md#web3-eth-abi-functions)\n- [`decodeParameters(typesArray, parameters)`](/API.md#decodeparameters)\n- [`async call(options, from, to, data, blockNumber)`](/API.md#async-calloptions-from-to-data-blocknumber)\n- [`errors object`](/API.md#errors-object)\n- [`nodes object`](/API.md#nodes-object)\n- [`async blockNumber(options)`](/API.md#async-blocknumberoptions)\n- [`async getStorageAt(options, addr, index, blockNumber)`](/API.md#async-getstorageatoptions-addr-index-blocknumber)\n- [`getStorageLocation(contract, label)`](/API.md#getstoragelocationcontract-label)\n- [`allFunctions(compiledCode)`](/API.md#allfunctionscompiledcode)\n- [`async getLogs(options, {fromBlock, toBlock, address, topics, limit })`](/API.md#async-getlogsoptions-fromblock-toblock-address-topics-limit-)\n\n## Examples\n\n- [limit-requests](/examples/limit-requests) - An example to demonstrate concurrency so that the RPC endpoint doesn't get choked\n\n## Changelog\n\nVisit [CHANGELOG.md](/CHANGELOG.md)\n\n## Tests\n\nYou can run the library's tests with `npm run test`, however, do make sure that\nyou're on node v14 as this is what the esmock setup sadly still depends on.\nOtherwise, for anything but testing, we're using this library in production\nwith node v18.\n\n## Contributing\n\nWe love contributions from the community. Find a [good first issue](https://github.com/attestate/eth-fun/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22).\n\nWant to suggest a feature or even better raise a PR for it? Head over to the [issues](https://github.com/attestate/eth-fun/issues).\n\n## References\n\n- [Ethereum JSON-RPC Specification](https://ethereum.github.io/execution-apis/api-documentation/)\n\n## License\n\nSee LICENSE file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fattestate%2Feth-fun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fattestate%2Feth-fun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fattestate%2Feth-fun/lists"}