Skip to content

Commit d28a56b

Browse files
committed
refactor: enhance Web3 Messaging guide with code grouping and payment details
1 parent 02813a5 commit d28a56b

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

src/guides/use-iapp/web3-messaging.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ a unique Chat ID.
3939

4040
Protect the email address or Chat ID using DataProtector Core.
4141

42-
### Web3Mail — protect the email address
42+
::: code-group
4343

44-
```ts twoslash
44+
```ts twoslash [Web3Mail]
4545
import { IExecDataProtectorCore, getWeb3Provider } from '@iexec/dataprotector';
4646
const web3Provider = getWeb3Provider('PRIVATE_KEY');
4747
const dataProtectorCore = new IExecDataProtectorCore(web3Provider);
@@ -53,9 +53,7 @@ const protectedData = await dataProtectorCore.protectData({
5353
});
5454
```
5555

56-
### Web3Telegram — protect the Chat ID
57-
58-
```ts twoslash
56+
```ts twoslash [Web3Telegram]
5957
import { IExecDataProtectorCore, getWeb3Provider } from '@iexec/dataprotector';
6058
const web3Provider = getWeb3Provider('PRIVATE_KEY');
6159
const dataProtectorCore = new IExecDataProtectorCore(web3Provider);
@@ -67,6 +65,8 @@ const protectedData = await dataProtectorCore.protectData({
6765
});
6866
```
6967

68+
:::
69+
7070
## 3. Grant Access
7171

7272
Grant permission for a sender and/or an app to contact the user.
@@ -87,9 +87,9 @@ const grantedAccess = await dataProtectorCore.grantAccess({
8787

8888
## 4. Send the Message
8989

90-
### Web3Mail — sendEmail
90+
::: code-group
9191

92-
```ts twoslash
92+
```ts twoslash [Web3Mail]
9393
import { IExecWeb3mail, getWeb3Provider } from '@iexec/web3mail';
9494

9595
const web3Provider = getWeb3Provider('PRIVATE_KEY');
@@ -103,9 +103,7 @@ const sendEmail = await web3mail.sendEmail({
103103
});
104104
```
105105

106-
### Web3Telegram — sendTelegram
107-
108-
```ts twoslash
106+
```ts twoslash [Web3Telegram]
109107
import { IExecWeb3telegram, getWeb3Provider } from '@iexec/web3telegram';
110108

111109
const web3Provider = getWeb3Provider('PRIVATE_KEY');
@@ -115,11 +113,16 @@ const sendTelegram = await web3telegram.sendTelegram({
115113
protectedData: '0x123abc...',
116114
senderName: 'Arthur',
117115
telegramContent: 'My telegram message content',
118-
// useVoucher: true,
119116
});
120117
```
121118

119+
:::
120+
122121
## Payment
123122

124-
See the full payment guide:
125-
[/guides/use-iapp/how-to-pay-executions](/guides/use-iapp/how-to-pay-executions)
123+
Each message sent through Web3Mail or Web3Telegram requires payment in RLC
124+
tokens.
125+
126+
For detailed information about payment methods, pricing, and voucher usage, see
127+
our comprehensive guide:
128+
[How to pay for executions](/guides/use-iapp/how-to-pay-executions)

0 commit comments

Comments
 (0)