Skip to content

swiftprotocol/iexec-code-review-31-07-2025

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

iExec Code Review

July 31, 2025 | 31 Juillet 2025

As both Swift Protocol and DexPal repositories are currently closed-source, we have decided to provide relevant snippets of code within this repository to faciliate review by the iExec team.

Swift Protocol

API

Enables secure Telegram notifications through iExec's decentralized infrastructure.

  1. Validates input (user_id, subject, message);
  2. Verifies GDPR consent for the user;
  3. Retrieves protected Telegram chat ID using DataProtector;
  4. Sends notification via Web3telegram with voucher;
  5. Returns notification ID and task ID for tracking.

SDK

Retrieves protected Telegram data for authenticated users in client-side applications.

  1. Validates DataProtector client initialization;
  2. Gets current user's wallet address;
  3. Queries protected data with telegram_chatId schema;
  4. Returns latest protected data entry with address, owner, and timestamp;
  5. Throws error if no protected data found.

Note: Only available in client-side mode with web3Provider initialization.

Protects Telegram chat ID data for authenticated users in client-side applications.

  1. Validates DataProtector client initialization;
  2. Gets current user's wallet address;
  3. Removes existing protected data if found;
  4. Protects new Telegram chat ID data;
  5. Grants access to web3telegram app for sending messages;
  6. Returns protected data entry with address, owner, and timestamp.

Note: Only available in client-side mode with web3Provider initialization.

Sends a Telegram notification to the authenticated user.

  1. Validates input (userAddress, subject, message);
  2. Sends notification via Web3telegram with voucher;
  3. Returns notification ID and task ID for tracking.

DexPal

Information below from pull request.

New Hooks

Chain management for iExec Sidechain (id 134):

  • Detects current chain and provides switchToIExecChain() function;
  • Returns chain status and switching state.

WAGMI -> Web3Provider wrapper for use with Swift-iExec SDK:

  • Only provides web3Provider when on iExec Sidechain;
  • Converts Wagmi wallet client to EIP-1193 compatible provider.

New Components

Wrapper component integrating SwiftProvider with WAGMI using useIExecWeb3Provider().

Three-step modal allowing users to set up Telegram notifications via iExec Web3Telegram:

  1. Begin conversation with iExec Telegram bot;
  2. Retrieve chat ID from conversation;
  3. Provide chat ID in modal form.

Reusable GDPR consent modal for informing users of data usage and of their rights. Could be reused by DexPal for further Swift Protocol integration or for reinforcement of GDPR compliance vis-a-vis users.

Modified Pages

/my-profile

Added:

  • Notification registration state loading;
  • GDPR consent state loading;
  • Registration handler;
  • Consent revocation handler.

New Environment Variables

  • SWIFT_IEXEC_APP_ID (currently extraneous): Application identifier generated at time of provisioning. Unique to DexPal.
  • SWIFT_IEXEC_API_KEY: Application API key generated at time of provisioning. Unique to DexPal.
  • NEXT_PUBLIC_SWIFT_IEXEC_API_URL: Swift Protocol-iExec API URL.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published