Skip to content

Commit 10a71ea

Browse files
committed
feat: update sidebar links and restructure payment guides for Web3Mail and Web3Telegram
1 parent e25814b commit 10a71ea

15 files changed

+172
-75
lines changed

.vitepress/sidebar.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,6 @@ export function getSidebar() {
411411
{ text: '🚀 Getting Started', link: '/use-iapp/getting-started' },
412412
{
413413
text: '📖 Guides',
414-
link: '/use-iapp/guides',
415414
items: [
416415
{
417416
text: 'Different ways to execute an iApp',
@@ -423,11 +422,11 @@ export function getSidebar() {
423422
},
424423
{
425424
text: 'Use iApp with Protected Data',
426-
link: '/use-iapp/use-iapp-with-protected-data',
425+
link: '/use-iapp/guides/use-iapp-with-protected-data',
427426
},
428427
{
429428
text: 'Find iApps to Use',
430-
link: '/use-iapp/find-iapps',
429+
link: '/use-iapp/guides/find-iapps',
431430
},
432431
{
433432
text: 'How to pay the executions',
@@ -437,23 +436,22 @@ export function getSidebar() {
437436
},
438437
{
439438
text: '💰 How to Pay',
440-
link: '/use-iapp/payment',
441439
items: [
442440
{
443441
text: 'How to Pay for Web3mail',
444-
link: '/overview/how-to-pay-for-web3mail',
442+
link: '/use-iapp/how-to-pay/how-to-pay-for-web3mail',
445443
},
446444
{
447445
text: 'How to Pay for Web3telegram',
448-
link: '/use-iapp/web3telegram/how-to-pay-for-web3telegram',
446+
link: '/use-iapp/how-to-pay/how-to-pay-for-web3telegram',
449447
},
450448
{
451449
text: 'Pricing Considerations',
452-
link: '/overview/pricing-considerations',
450+
link: '/use-iapp/how-to-pay/pricing-considerations',
453451
},
454452
{
455-
text: 'Voucher Authorization Guide',
456-
link: '/use-iapp/voucher-guide',
453+
text: 'Voucher',
454+
link: '/use-iapp/how-to-pay/voucher',
457455
},
458456
],
459457
},

src/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ features:
4343
details:
4444
Create revenue streams from your data while maintaining full control and
4545
privacy
46-
link: /manage-data/guides/monetize-protected-data
46+
link: /use-iapp/how-to-pay/how-to-pay-for-web3mail
4747
- icon: 🧠
4848
title: Protocols
4949
details:

src/overview/ai-integration.md

Whitespace-only changes.

src/overview/helloWorld/1-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Computing</a></span> technologies.
8484

8585
iExec combines three fundamental elements that work together seamlessly:
8686

87-
#### 1. Protect data with our devtool [DataProtector](../../tools/dataProtector/getting-started)
87+
#### 1. Protect data with our devtool [DataProtector](../../manage-data/dataProtector/getting-started)
8888

8989
- Encrypt your sensitive data and store it securely on Arweave or IPFS
9090
- Only you control who can access it and when

src/overview/how-to-pay-for-web3mail.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/overview/use-case-demo.md

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/use-iapp/guides.md

Whitespace-only changes.
File renamed without changes.
File renamed without changes.
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
# How to pay for Web3mail
2+
3+
[Web3Mail](../tools/web3mail) dev tool offers secure, blockchain-based
4+
communication by encrypting emails and protecting user privacy.
5+
6+
The `sendEmail` function uses confidential computing power to encrypt and send
7+
messages, ensuring secure and decentralized email exchanges.
8+
9+
This guide explains how to pay for Web3Mail's computing power using **vouchers**
10+
and **xRLC**, detailing the steps for each method.
11+
12+
## Using Vouchers for Web3Mail
13+
14+
### Step 1: Obtain a Voucher
15+
16+
- **Acquire Vouchers**: Obtain vouchers through the
17+
[iExec Builder Dashboard](https://builder.iex.ec/). Note that the number of
18+
Web3Mail executions and the expiration time of each voucher is restricted
19+
based on its validity period. Refer to
20+
[pricing documentation](https://www.iex.ec/voucher) for more information.
21+
- **Support**: For specific limitations related to your voucher, please contact
22+
iExec Support.
23+
24+
### Step 2: Use the Builder Dashboard
25+
26+
<a href="https://builder.iex.ec/" target="_blank" rel="noreferrer" style="display: inline-block; margin-top: 20px">
27+
<img src="/assets/builder-dashboard.png" alt="Builder dashboard screenshot">
28+
</a>
29+
30+
The iExec Builder Dashboard is a comprehensive tool for managing vouchers and
31+
resources, providing an intuitive interface for:
32+
33+
- **Claiming Vouchers**: Builders can claim vouchers during the BUILD and EARN
34+
stages.
35+
- **Top-Up Vouchers**: Future updates will allow direct top-ups via the
36+
dashboard. Currently, builders are redirected to Discord.
37+
- **Checking Voucher Balance**: Track your voucher balance and usage history.
38+
39+
🧙🏼 [Go here](https://builder.iex.ec/)
40+
41+
### Step 3: Grant Allowance (If Necessary)
42+
43+
Use `iexec.account.approve(voucherAddress)` to authorize the voucher smart
44+
contract to debit your account if the voucher balance is insufficient. This
45+
ensures that if the voucher alone doesn't cover the execution cost, the
46+
remaining balance is automatically deducted from your account.
47+
48+
For additional information on using xRLC for fallback payment in Web3Mail, refer
49+
to the **Using xRLC with Web3Mail** section.
50+
51+
### Step 4: Execute Web3Mail's sendEmail Function
52+
53+
When using a voucher for payment, set the `useVoucher` parameter to `true`:
54+
55+
```ts twoslash
56+
import { IExecWeb3mail, getWeb3Provider } from '@iexec/web3mail';
57+
58+
const web3Provider = getWeb3Provider('PRIVATE_KEY');
59+
const web3mail = new IExecWeb3mail(web3Provider);
60+
// ---cut---
61+
const sendEmail = await web3mail.sendEmail({
62+
protectedData: '0x123abc...',
63+
emailSubject: 'My email subject',
64+
emailContent: 'My email content',
65+
useVoucher: true, // [!code focus]
66+
});
67+
```
68+
69+
## Using xRlC for Web3Mail
70+
71+
If you choose to use xRLC to cover the computational cost of Web3Mail (or if you
72+
need to cover data access costs such as retrieving the recipient's email
73+
address), follow these steps:
74+
75+
### Install the iExec SDK
76+
77+
To manage RLC tokens, developers must use the iExec SDK, which offers all the
78+
necessary tools for interacting with the iExec platform. This includes
79+
depositing, withdrawing, and checking balances of RLC and xRLC
80+
81+
- In your JS/TS project npm install iexec
82+
- Instantiate the iExec SDK (see the
83+
[doc](https://github.com/iExecBlockchainComputing/iexec-sdk/blob/master/docs/README.md#quick-start))
84+
85+
```javascript
86+
import { IExec } from 'iexec';
87+
// connect injected provider
88+
const iexec = new IExec({ ethProvider: window.ethereum });
89+
```
90+
91+
### Purchase RLC
92+
93+
Obtain RLC tokens from a supported cryptocurrency exchange.
94+
95+
### Convert to xRLC
96+
97+
Use the iExec Bridge to convert your RLC into xRLC for use on iExec's sidechain.
98+
The bridging operation follows the lock & mint / burn & unlock principle. When
99+
sending tokens from Mainnet to Bellecour, the bridge locks the initial amount on
100+
the source chain and mints the equivalent on the destination chain. When going
101+
in the other direction, it burns tokens on the Sidechain and unlocks the same
102+
amount on Mainnet. The bridged asset is called xRLC on Bellecour.
103+
104+
Users can send tokens from the Ethereum Mainnet to the iExec Sidechain or
105+
vice-versa using the Account Manager
106+
([iExec Explorer](https://explorer.iex.ec/bellecour) or
107+
[POA Bridge UI](https://bridge-bellecour.iex.ec/)) available across all iExec
108+
products.
109+
110+
### Deposit xRLC
111+
112+
Deposit the xRLC into your iExec account using the command:
113+
114+
```javascript
115+
iexec.account.deposit(xRLC_amount);
116+
```
117+
118+
This converts xRLC into sRLC, used as proof of funds for task execution.
119+
120+
### Check sRLC Balance
121+
122+
Use the command below to check your balance:
123+
124+
```javascript
125+
iexec.account.show();
126+
```
127+
128+
### Execute sendEmail
129+
130+
Set the `useVoucher` parameter to `false` when using Web3Mail's sendEmail
131+
function to pay with xRLC:
132+
133+
```ts twoslash
134+
import { IExecWeb3mail, getWeb3Provider } from '@iexec/web3mail';
135+
136+
const web3Provider = getWeb3Provider('PRIVATE_KEY');
137+
const web3mail = new IExecWeb3mail(web3Provider);
138+
// ---cut---
139+
const sendEmail = await web3mail.sendEmail({
140+
protectedData: '0x123abc...',
141+
emailSubject: 'My email subject',
142+
emailContent: 'My email content',
143+
useVoucher: false, // [!code focus]
144+
});
145+
```
146+
147+
### Withdraw sRLC (If Desired)
148+
149+
Convert sRLC back to xRLC and withdraw to your wallet using:
150+
151+
```javascript
152+
iexec.account.withdraw(RLC_amount);
153+
```

0 commit comments

Comments
 (0)