Structure of the repository
What are the elements and how do they work together?
Last updated
What are the elements and how do they work together?
Last updated
This documentation outlines the structure of a Next.js dApp repository that integrates AA SDK With SL MPC Signer . The goal is to demonstrate how to set up and organize a repository that can flexibly support any AA-SDK with an MPC-based wallet dApp.
mpc/
keygen/: Contains logic for key generation.
pair/: Contains logic for pairing keys.
sign/: Contains logic for signing operations.
aaSDK/
requestSender/: Handles request sending logic.
mintingService.ts: Implements wallet minting functionality using the AA-SDK.
transactionService.ts: Implements transaction-sending functionality using the AA-SDK.
app/
components/
NextJs component.
silentWallet.ts: Implements the custom signer logic integrating MPC
package.json: Lists dependencies and scripts for the project.
: Readme
The silentWallet.ts
file defines the SilentWallet
class, which extends ethers.Signer
. This class is responsible for handling signing operations using MPC key shares.
Located in aaSDK/mintingService.ts
, this service uses the AA-SDK to create a smart account client. It integrates the SilentWallet
to manage key shards and provider initialization.
Located in aaSDK/transactionService.ts
, this service facilitates transaction sending via the AA-SDK. It also integrates the SilentWallet
for signing transactions.
The Next.js frontend directly calls the services defined in mintingService.ts
and transactionService.ts
. This integration allows the frontend to handle wallet minting and transaction sending seamlessly.
Navigate to the aaSDK
folder in the project repository. Inside this folder are two services that need to be updated:
mintingService.ts
transactionService.ts
Replace specific imports with any SDK imports in mintingService.ts
and transactionService.ts
.
Update the mintWallet
and sendTransaction
function accordingly.