{"id":18705512,"url":"https://github.com/pfed-prog/evmexplorer-blockscout","last_synced_at":"2025-04-12T10:14:11.648Z","repository":{"id":257823582,"uuid":"871590805","full_name":"Pfed-prog/EVMExplorer-Blockscout","owner":"Pfed-prog","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-07T07:39:16.000Z","size":571,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T10:14:02.735Z","etag":null,"topics":["dspyt","evmexplorer","javascript","npm-package","typescript"],"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/Pfed-prog.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-12T11:44:02.000Z","updated_at":"2025-04-02T16:40:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"aec22bfd-47db-4847-a872-cc3e3c9a0df5","html_url":"https://github.com/Pfed-prog/EVMExplorer-Blockscout","commit_stats":null,"previous_names":["pfed-prog/evmexplorer-blockscout"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pfed-prog%2FEVMExplorer-Blockscout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pfed-prog%2FEVMExplorer-Blockscout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pfed-prog%2FEVMExplorer-Blockscout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pfed-prog%2FEVMExplorer-Blockscout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pfed-prog","download_url":"https://codeload.github.com/Pfed-prog/EVMExplorer-Blockscout/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248550632,"owners_count":21122934,"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":["dspyt","evmexplorer","javascript","npm-package","typescript"],"created_at":"2024-11-07T12:11:07.778Z","updated_at":"2025-04-12T10:14:11.642Z","avatar_url":"https://github.com/Pfed-prog.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EVMExplorer-Blockscout\n\n[EVM Explorer](https://evmexplorer.com) TypeScript Blockscout v2 sdk.\n\n## 📚 Install\n\n```bash\nnpm install @evmexplorer/blockscout\n```\n\nor\n\n```bash\nyarn add @evmexplorer/blockscout\n```\n\n## Using EVMExplorer-Blockscout SDK\n\n### Fetching a Transaction\n\nTo fetch a transaction on Ethereum mainnet as demonstrated on [Ethereum Stack Oveflow answer](https://ethereum.stackexchange.com/a/167002/79075):\n\n```ts\nimport type { TransactionBlockscout } from '@evmexplorer/blockscout';\nimport { fetchTransactionBlockscout } from '@evmexplorer/blockscout';\n\nconst data: TransactionBlockscout = await fetchTransactionBlockscout(\n  '0xdc7ddf3d0e53532eeeda7a7a99c88255ccee5a3b4404441278cbbd79b4c85086',\n);\n\nconsole.log(data);\n```\n\n### Output\n\nThe `fetchTransactionBlockscout` function returns an object with the following properties:\n\n```yaml\n{\n  priority_fee: '70439166556560',\n  tx_burnt_fee: '676806248593230',\n  raw_input: '0xa22cb4650000000000000000000000001e0049783f008a0085193e00003d00cd54003c710000000000000000000000000000000000000000000000000000000000000001',\n  result: 'success',\n  hash: '0xdc7ddf3d0e53532eeeda7a7a99c88255ccee5a3b4404441278cbbd79b4c85086',\n  max_fee_per_gas: '15917702655',\n  revert_reason: null,\n  confirmation_duration: [0, 12000],\n  type: 2,\n  token_transfers_overflow: false,\n  confirmations: 47513,\n  position: 72,\n  max_priority_fee_per_gas: '1267119384',\n  transaction_tag: null,\n  created_contract: null,\n  value: '0',\n  tx_types: ['contract_call'],\n  from:\n    {\n      ens_domain_name: null,\n      hash: '0xA3b711752f08980F4a71777217FA81304aEB8ee7',\n      implementations: [],\n      is_contract: false,\n      is_scam: false,\n      is_verified: false,\n      metadata: null,\n      name: null,\n      private_tags: [],\n      proxy_type: null,\n      public_tags: [],\n      watchlist_names: [],\n    },\n  gas_used: '55590',\n  status: 'ok',\n  to:\n    {\n      ens_domain_name: null,\n      hash: '0x22C1f6050E56d2876009903609a2cC3fEf83B415',\n      implementations: [[Object]],\n      is_contract: true,\n      is_scam: false,\n      is_verified: true,\n      metadata: { tags: [Array] },\n      name: 'AdminUpgradeabilityProxy',\n      private_tags: [],\n      proxy_type: 'eip1967',\n      public_tags: [],\n      watchlist_names: [],\n    },\n  authorization_list: [],\n  method: 'setApprovalForAll',\n  fee: { type: 'actual', value: '747245415149790' },\n  tx_tag: null,\n  actions: [],\n  gas_limit: '73310',\n  gas_price: '13442083381',\n  decoded_input:\n    {\n      method_call: 'setApprovalForAll(address to, bool approved)',\n      method_id: 'a22cb465',\n      parameters: [[Object], [Object]],\n    },\n  has_error_in_internal_txs: false,\n  token_transfers: [],\n  base_fee_per_gas: '12174963997',\n  timestamp: '2024-12-08T17:44:23.000000Z',\n  nonce: 464,\n  block: 21359346,\n  transaction_types: ['contract_call'],\n  exchange_rate: '3859.75',\n  block_number: 21359346,\n  has_error_in_internal_transactions: false,\n}\n```\n\nYou can also go over the transaction visually at [EVM Explorer transaction page](https://evmexplorer.com/transactions/mainnet/0xdc7ddf3d0e53532eeeda7a7a99c88255ccee5a3b4404441278cbbd79b4c85086).\n\n### Fetching Vitalik's Address Tokens\n\nYou can also query the blockchain address token balances as demonstrated on [Stack Overflow](https://stackoverflow.com/a/79314959/13943679). For example, let's query [Vitalik's balances](https://evmexplorer.com/contracts/mainnet/0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045):\n\n```js\nexport type { AddressTokens } from \"@evmexplorer/blockscout\";\nexport { fetchTokensAddress } from \"@evmexplorer/blockscout\";\n\nconst data: AddressTokens = await fetchTokensAddress(\n  '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',\n);\nconsole.log(data.length)\nconsole.log(data[0])\n```\n\n### Address Tokens Output\n\n```yaml\n6081\n{\n  token: {\n    address: '0x28561B8A2360F463011c16b6Cc0B0cbEF8dbBcad',\n    circulating_market_cap: '75858317.61202328',\n    decimals: '9',\n    exchange_rate: '0.00017784',\n    holders: '14334',\n    icon_url: 'https://assets.coingecko.com/coins/images/50348/small/1000000612.jpg?1727248974',\n    name: 'MOO DENG',\n    symbol: 'MOODENG',\n    total_supply: '420690000000000000000',\n    type: 'ERC-20',\n    volume_24h: '10219755.637613483'\n  },\n  token_id: null,\n  token_instance: null,\n  value: '30000105889157756560'\n}\n```\n\nVitalik has 6081 tokens. The first token in the array of all 6081 tokens is [Moo Deng token](https://evmexplorer.com/contracts/mainnet/0x28561B8A2360F463011c16b6Cc0B0cbEF8dbBcad).\n\n## Fetching Latest Block Transactions\n\nYou can also query the latest block transactions with `Ethers` provider as demonstrated on [Stack Overflow](https://stackoverflow.com/a/79361865/13943679).\n\n```js\nimport { fetchBlockTransactionsBlockscout } from '@evmexplorer/blockscout';\nconst block = await provider.getBlock();\nconst data = await fetchBlockTransactionsBlockscout(block);\n```\n\n## More information\n\n[EVM Explorer - Tracking Smart Contract Transaction Data](https://dspyt.com/evmexplorer)\n\n[Blockscout - Ethereum API documentation](https://eth.blockscout.com/api-docs)\n\n[Blockscout - REST API Endpoints](https://docs.blockscout.com/devs/apis/rest)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpfed-prog%2Fevmexplorer-blockscout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpfed-prog%2Fevmexplorer-blockscout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpfed-prog%2Fevmexplorer-blockscout/lists"}