{"id":20002051,"url":"https://github.com/pooltogether/etherplex","last_synced_at":"2026-02-13T08:11:31.459Z","repository":{"id":40719191,"uuid":"260565898","full_name":"pooltogether/etherplex","owner":"pooltogether","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-05T11:13:15.000Z","size":563,"stargazers_count":65,"open_issues_count":19,"forks_count":12,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-04-23T21:42:35.844Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pooltogether.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-01T21:55:16.000Z","updated_at":"2024-04-23T05:25:34.000Z","dependencies_parsed_at":"2023-02-04T02:45:43.744Z","dependency_job_id":null,"html_url":"https://github.com/pooltogether/etherplex","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fetherplex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fetherplex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fetherplex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fetherplex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pooltogether","download_url":"https://codeload.github.com/pooltogether/etherplex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224107282,"owners_count":17256923,"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":[],"created_at":"2024-11-13T05:19:37.041Z","updated_at":"2026-02-13T08:11:31.406Z","avatar_url":"https://github.com/pooltogether.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Etherplex\n\n[Ethers.js](https://github.com/ethers-io/ethers.js) + [Multicall](https://github.com/makerdao/multicall)\n\nBatch multiple Ethereum JSON RPC calls into a single RPC call.\n\nFeatures:\n\n- Uses the Multicall contract when available\n- Falls back to individual RPC requests when not available\n\n# Setup\n\n```bash\n$ yarn add @pooltogether/etherplex\n```\n\n# Usage\n\n1. First create a contract wrapper using the `contract` function\n2. Chain calls on the contract and pass the results into the `batch` function\n\n```javascript\nimport { ethers } from 'ethers'\nimport { batch, contract } from '@pooltogether/etherplex'\n\n// Assuming ERC20Abi is an ABI\n// Assume the DAI_ADDRESS and USDC_ADDRESS constants are Ethereum addresses\n\nlet daiContract = contract('Dai', ERC20Abi, DAI_ADDRESS)\n\n// Alternatively, you can just pass in an ethers.Contract instance\nlet ethersContract = new ethers.Contract(USDC_ADDRESS, ERC20Abi, provider)\nlet usdcContract = contract('Usdc', ethersContract)\n\nlet results = await batch(\n  ethers.getDefaultProvider(),\n  daiContract\n    .balanceOf(address)\n    .totalSupply(),\n  usdcContract\n    .balanceOf(address)\n    .totalSupply()\n)\n/*\nWill yield:\n\n{\n  Dai: {\n    'balanceOf(address)': [BigNumber],\n    balanceOf: [BigNumber],\n  },\n  Usdc: {\n    'balanceOf(address)': [BigNumber],\n    balanceOf: [BigNumber],\n  }\n}\n\n*/\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpooltogether%2Fetherplex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpooltogether%2Fetherplex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpooltogether%2Fetherplex/lists"}