@@ -14,8 +14,6 @@ import ConfigureBundler from "@site/src/common/sdk/pnp/web/_bundler-configuratio
1414import ConfigureSponsoredPaymaster from " @site/src/common/sdk/pnp/web/_sponsored-paymaster-configuration.mdx" ;
1515import ConfigureERC20Paymaster from " @site/src/common/sdk/pnp/web/_erc20-paymaster-configuration.mdx" ;
1616
17- import AARNBareSetup from " @site/src/common/sdk/pnp/react-native/_aa-rn-setup.mdx" ;
18- import AARNExpoSetup from " @site/src/common/sdk/pnp/react-native/_aa-rn-expo-setup.mdx" ;
1917import ConfigureSigners from " @site/src/common/sdk/pnp/web/_configure-aa-signers.mdx" ;
2018import SmartAccountAddress from " @site/src/common/sdk/pnp/web/_aa-address.mdx" ;
2119import SmartAccountSendTransaction from " @site/src/common/sdk/pnp/web/_aa-send-transaction.mdx" ;
@@ -74,12 +72,110 @@ token for ERC-20 paymasters, defining gas policies, and more.
7472>
7573<TabItem value = " rn-bare" default >
7674
77- <AARNBareSetup />
75+ ``` ts
76+ import { EthereumPrivateKeyProvider } from " @web3auth/ethereum-provider" ;
77+ // focus-start
78+ import {
79+ AccountAbstractionProvider ,
80+ SafeSmartAccount ,
81+ } from " @web3auth/account-abstraction-provider" ;
82+ // focus-end
83+ import Web3Auth , { WEB3AUTH_NETWORK } from " @web3auth/react-native-sdk" ;
84+ import * as WebBrowser from " @toruslabs/react-native-web-browser" ;
85+ import EncryptedStorage from " react-native-encrypted-storage" ;
86+ import { CHAIN_NAMESPACES } from " @web3auth/base" ;
87+
88+ const chainConfig = {
89+ chainNamespace: CHAIN_NAMESPACES .EIP155 ,
90+ chainId: " 0xaa36a7" ,
91+ rpcTarget: " https://rpc.sepolia.org" ,
92+ displayName: " Ethereum Sepolia Testnet" ,
93+ blockExplorerUrl: " https://sepolia.etherscan.io" ,
94+ ticker: " ETH" ,
95+ tickerName: " Ethereum" ,
96+ logo: " https://cryptologos.cc/logos/ethereum-eth-logo.png" ,
97+ };
98+
99+ // focus-start
100+ const accountAbstractionProvider = new AccountAbstractionProvider ({
101+ config: {
102+ chainConfig ,
103+ bundlerConfig: {
104+ // Get the pimlico API Key from dashboard.pimlico.io
105+ url: ` https://api.pimlico.io/v2/11155111/rpc?apikey=${pimlicoAPIKey } ` ,
106+ },
107+ smartAccountInit: new SafeSmartAccount (),
108+ },
109+ });
110+ // focus-end
111+
112+ const privateKeyProvider = new EthereumPrivateKeyProvider ({
113+ config: { chainConfig },
114+ });
115+
116+ const web3auth = new Web3Auth (WebBrowser , EncryptedStorage , {
117+ clientId ,
118+ redirectUrl ,
119+ network: WEB3AUTH_NETWORK .SAPPHIRE_MAINNET , // or other networks
120+ privateKeyProvider ,
121+ // focus-next-line
122+ accountAbstractionProvider: aaProvider ,
123+ });
124+ ```
78125
79126</TabItem >
80127<TabItem value = " rn-expo" >
81128
82- <AARNExpoSetup />
129+ ``` ts
130+ import { EthereumPrivateKeyProvider } from " @web3auth/ethereum-provider" ;
131+ // focus-start
132+ import {
133+ AccountAbstractionProvider ,
134+ SafeSmartAccount ,
135+ } from " @web3auth/account-abstraction-provider" ;
136+ // focus-end
137+ import Web3Auth , { WEB3AUTH_NETWORK } from " @web3auth/react-native-sdk" ;
138+ import * as WebBrowser from " expo-web-browser" ;
139+ import * as SecureStore from " expo-secure-store" ;
140+ import { CHAIN_NAMESPACES } from " @web3auth/base" ;
141+
142+ const chainConfig = {
143+ chainNamespace: CHAIN_NAMESPACES .EIP155 ,
144+ chainId: " 0xaa36a7" ,
145+ rpcTarget: " https://rpc.sepolia.org" ,
146+ displayName: " Ethereum Sepolia Testnet" ,
147+ blockExplorerUrl: " https://sepolia.etherscan.io" ,
148+ ticker: " ETH" ,
149+ tickerName: " Ethereum" ,
150+ logo: " https://cryptologos.cc/logos/ethereum-eth-logo.png" ,
151+ };
152+
153+ // focus-start
154+ const accountAbstractionProvider = new AccountAbstractionProvider ({
155+ config: {
156+ chainConfig ,
157+ bundlerConfig: {
158+ // Get the pimlico API Key from dashboard.pimlico.io
159+ url: ` https://api.pimlico.io/v2/11155111/rpc?apikey=${pimlicoAPIKey } ` ,
160+ },
161+ smartAccountInit: new SafeSmartAccount (),
162+ },
163+ });
164+ // focus-end
165+
166+ const privateKeyProvider = new EthereumPrivateKeyProvider ({
167+ config: { chainConfig },
168+ });
169+
170+ const web3auth = new Web3Auth (WebBrowser , SecureStore , {
171+ clientId ,
172+ redirectUrl ,
173+ network: WEB3AUTH_NETWORK .SAPPHIRE_MAINNET , // or other networks
174+ privateKeyProvider ,
175+ // focus-next-line
176+ accountAbstractionProvider: aaProvider ,
177+ });
178+ ```
83179
84180</TabItem >
85181</Tabs >
0 commit comments