{"id":19571568,"url":"https://github.com/block-core/blockcore-provider","last_synced_at":"2025-04-27T03:32:27.170Z","repository":{"id":40271208,"uuid":"392423229","full_name":"block-core/blockcore-provider","owner":"block-core","description":"Web Provider for Blockcore.","archived":false,"fork":false,"pushed_at":"2022-12-04T02:41:30.000Z","size":481,"stargazers_count":5,"open_issues_count":3,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-29T10:04:18.813Z","etag":null,"topics":["web3","web5"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@blockcore/provider","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/block-core.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}},"created_at":"2021-08-03T18:54:25.000Z","updated_at":"2024-04-23T12:02:43.000Z","dependencies_parsed_at":"2023-01-22T20:30:18.930Z","dependency_job_id":null,"html_url":"https://github.com/block-core/blockcore-provider","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/block-core%2Fblockcore-provider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/block-core%2Fblockcore-provider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/block-core%2Fblockcore-provider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/block-core%2Fblockcore-provider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/block-core","download_url":"https://codeload.github.com/block-core/blockcore-provider/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223733470,"owners_count":17193800,"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":["web3","web5"],"created_at":"2024-11-11T06:19:18.917Z","updated_at":"2024-11-11T06:19:19.972Z","avatar_url":"https://github.com/block-core.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://avatars3.githubusercontent.com/u/53176002?s=200\u0026v=4\" height=\"100\" alt=\"Blockcore\" /\u003e\n  \u003c/p\u003e\n  \u003ch3 align=\"center\"\u003e\n    Blockcore Web Provider\n  \u003c/h3\u003e\n  \u003cp align=\"center\"\u003e\n    Multi-Chain Web Provider for Blockcore\n  \u003c/p\u003e\n  \u003cp align=\"center\"\u003e\n      \u003ca href=\"https://github.com/block-core/blockcore-provider/actions/workflows/build.yml\"\u003e\u003cimg src=\"https://github.com/block-core/blockcore-provider/actions/workflows/build.yml/badge.svg\" /\u003e\u003c/a\u003e \u003ca href=\"https://github.com/block-core/blockcore-provider/actions/workflows/release.yml\"\u003e\u003cimg src=\"https://github.com/block-core/blockcore-provider/actions/workflows/release.yml/badge.svg\" /\u003e\u003c/a\u003e\n  \u003c/p\u003e\n  \u003cp align=\"center\"\u003e\u003cem\u003eWork-in-Progress - use with caution!\u003c/em\u003e\u003c/p\u003e\n\u003c/p\u003e\n\n# Blockcore Web Provider\n\nWeb (Web3/Web5) Provider for Blockcore.\n\nThe provider is how apps talks to the blockchains and wallet (extension). Providers take JSON-RPC requests and return the response. This is normally done by submitting the request to an HTTP or IPC socket based server.\n\nThe provider also allows connection to be made between web site / web app and the Blockcore Wallet (browser extension).\n\n## Setup\n\nInstall:\n\n```sh\nnpm install @blockcore/provider\n```\n\n**Warning:** This package is native [ESM](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) and does not provide a CommonJS export. If your project uses CommonJS, you'll have to [convert to ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) or use the [dynamic `import()`](https://v8.dev/features/dynamic-import) function.\n\n## Usage\n\n```ts\nimport { WebProvider } from \"@blockcore/provider\";\n\n// This will perform DNS lookup and indexer queries to check online statuses:\nconst webProvider = await WebProvider.Create();\nwebProvider.setNetwork('CITY');\n\nconst block = await provider.indexer.getBlockByIndex('1');\nconsole.log('Block:', block);\n\n// Without any key, user can pick any account they want:\nconst signing1 = await provider.request({ method: \"signMessage\", params: [{ key: \"CdnpNqSeqaXBMVnY1e13Ksijgr6FyWPM9J\", message: 'Hello World!' }] });\nconsole.log('Signing1:', signing1);\n\n// The key can be provided if user previously performed a signing request and the web app persisted the selected key.\nconst signing2 = await provider.request({ method: \"signMessage\", params: [{ message: 'Hello World!' }] });\nconsole.log('Signing2:', signing2);\n\nconst supply: any = await webProvider.indexer.getCirculatingSupply();\nconsole.log('Supply:', supply);\n```\n\nScreen recording demonstrating the use of the Blockcore Web Provider:\n\n![](doc/blockcore-provider.gif)\n\n ## TODO\n\n The interaction with the wallet is currently done through the generic `request` API, this provider will add typed methods for all the supported features within the wallet provider (in-page provider loaded by the wallet extension).\n\n## Development\n\n### Build\n\nSimply run `npm run build` to build the library. Also run `npm run lint` to verify the code syntax.\n\n### Testing\n\nThe library is using `ava` for tests. Please refer to the documentation on how to write tests:\n\n[https://github.com/avajs/ava/blob/main/docs/01-writing-tests.md](https://github.com/avajs/ava/blob/main/docs/01-writing-tests.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblock-core%2Fblockcore-provider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblock-core%2Fblockcore-provider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblock-core%2Fblockcore-provider/lists"}