From 77ca27e56c625505e43955e9da5067d6f7dcab3e Mon Sep 17 00:00:00 2001 From: AyushBherwani1998 Date: Thu, 17 Oct 2024 14:30:04 +0530 Subject: [PATCH] enable trust smart account --- .../_smart-account-provider-configuration.mdx | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/src/common/sdk/pnp/web/_smart-account-provider-configuration.mdx b/src/common/sdk/pnp/web/_smart-account-provider-configuration.mdx index 9c6bae6ab..8d56c2c3f 100644 --- a/src/common/sdk/pnp/web/_smart-account-provider-configuration.mdx +++ b/src/common/sdk/pnp/web/_smart-account-provider-configuration.mdx @@ -2,7 +2,7 @@ import TabItem from "@theme/TabItem"; import Tabs from "@theme/Tabs"; Web3Auth offers the flexibility to choose your preferred Account Abstraction (AA) provider. -Currently, we support Safe, Kernel, and Biconomy. +Currently, we support Safe, Kernel, Biconomy, and Trust. @@ -113,5 +114,39 @@ const accountAbstractionProvider = new AccountAbstractionProvider({ }); ``` + + + + +```ts +import { + AccountAbstractionProvider, + TrustSmartAccount, +} from "@web3auth/account-abstraction-provider"; + +const chainConfig = { + chainNamespace: CHAIN_NAMESPACES.EIP155, + chainId: "0xaa36a7", + rpcTarget: "https://rpc.ankr.com/eth_sepolia", + displayName: "Ethereum Sepolia Testnet", + blockExplorerUrl: "https://sepolia.etherscan.io", + ticker: "ETH", + tickerName: "Ethereum", + logo: "https://cryptologos.cc/logos/ethereum-eth-logo.png", +}; + +const accountAbstractionProvider = new AccountAbstractionProvider({ + config: { + chainConfig, + bundlerConfig: { + // Get the pimlico API Key from dashboard.pimlico.io + url: `https://api.pimlico.io/v2/11155111/rpc?apikey=${pimlicoAPIKey}`, + }, + // focus-next-line + smartAccountInit: new TrustSmartAccount(), + }, +}); +``` +