|
| 1 | +<p align="center"> |
| 2 | + <a href="https://iex.ec/" rel="noopener" target="_blank"><img width="150" src="./logo-iexec.png" alt="iExec logo"/></a> |
| 3 | +</p> |
| 4 | + |
| 5 | +<h1 align="center">Web3Telegram</h1> |
| 6 | + |
| 7 | +**Web3Telegram** offers developers methods to create apps that: |
| 8 | + |
| 9 | +- enable an entity (such as a (d)app provider or an end-user) to message an Ethereum account holder without knowing her/his chatId or telegram username. |
| 10 | +- eliminate the need for end-users to share their chatId or telegram username with multiple third-parties, reducing the risk of data breaches and spam. |
| 11 | + |
| 12 | +Web3Telegram is composed of 2 methods: |
| 13 | + |
| 14 | +- **fetchMyContacts** — that enables an entity to retrieve a list of Ethereum accounts whose owners have authorized the entity to message them |
| 15 | +- **fetchUserContacts** — that enables an entity to retrieve a list of Ethereum accounts whose owners have authorized the provided user to message them |
| 16 | +- **sendTelegram** — that allows an entity to message a user on telegram (previously fetched via the fetchMyContacts method) knowing only her/his Ethereum account. |
| 17 | + |
| 18 | +<div align="center"> |
| 19 | + |
| 20 | +[](https://www.npmjs.com/package/@iexec/web3telegram)[](/LICENSE) |
| 21 | + |
| 22 | +</div> |
| 23 | + |
| 24 | +## Installation |
| 25 | + |
| 26 | +Web3Telegram will be available as an [npm package](https://www.npmjs.com/package/@iexec/web3telegram). |
| 27 | + |
| 28 | +**npm:** |
| 29 | + |
| 30 | +```sh |
| 31 | +npm install @iexec/web3telegram |
| 32 | +``` |
| 33 | + |
| 34 | +**yarn:** |
| 35 | + |
| 36 | +```sh |
| 37 | +yarn add @iexec/web3telegram |
| 38 | +``` |
| 39 | + |
| 40 | +## Get started |
| 41 | + |
| 42 | +### Browser |
| 43 | + |
| 44 | +```ts |
| 45 | +import { IExecWeb3telegram } from '@iexec/web3telegram'; |
| 46 | + |
| 47 | +const web3Provider = window.ethereum; |
| 48 | +const web3telegram = new IExecWeb3telegram(web3Provider); |
| 49 | +``` |
| 50 | + |
| 51 | +### NodeJS |
| 52 | + |
| 53 | +```ts |
| 54 | +import { IExecWeb3telegram, getWeb3Provider } from '@iexec/web3telegram'; |
| 55 | + |
| 56 | +const { PRIVATE_KEY } = process.env; |
| 57 | + |
| 58 | +const web3Provider = getWeb3Provider(PRIVATE_KEY); |
| 59 | +const web3telegram = new IExecWeb3telegram(web3Provider); |
| 60 | +``` |
| 61 | + |
| 62 | +## Documentation |
| 63 | + |
| 64 | +- [Web3telegram documentation](https://tools.docs.iex.ec/tools/web3telegram) |
| 65 | +- [Web3telegram technical design](./technical-design/index.md) |
| 66 | +- [iExec Protocol documentation](https://protocol.docs.iex.ec) |
| 67 | + |
| 68 | +## License |
| 69 | + |
| 70 | +This project is licensed under the terms of the [Apache 2.0](/LICENSE). |
0 commit comments