Skip to content

Commit 5df1959

Browse files
committed
Add biconomy example
1 parent 3f45970 commit 5df1959

File tree

3 files changed

+14
-18
lines changed

3 files changed

+14
-18
lines changed

web-modal-sdk/account-abstraction-examples/biconomy-modal-example/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web-modal-sdk/account-abstraction-examples/biconomy-modal-example/src/App.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ import "./App.css";
22

33
import { CHAIN_NAMESPACES, IProvider, WEB3AUTH_NETWORK } from "@web3auth/base";
44
import { EthereumPrivateKeyProvider } from "@web3auth/ethereum-provider";
5-
import { AccountAbstractionProvider, SafeSmartAccount } from "@web3auth/account-abstraction-provider";
5+
import { AccountAbstractionProvider, BiconomySmartAccount } from "@web3auth/account-abstraction-provider";
66
import { Web3Auth, Web3AuthOptions } from "@web3auth/modal";
77
import { useEffect, useState } from "react";
88

9-
109
import RPC from "./ethersRPC";
1110

1211
const clientId = "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ"; // get from https://dashboard.web3auth.io
@@ -30,11 +29,11 @@ const accountAbstractionProvider = new AccountAbstractionProvider({
3029
bundlerConfig: {
3130
url: `https://api.pimlico.io/v2/11155111/rpc?apikey=${pimlicoAPIKey}`,
3231
},
33-
smartAccountInit: new SafeSmartAccount(),
32+
smartAccountInit: new BiconomySmartAccount(),
3433
paymasterConfig: {
3534
url: `https://api.pimlico.io/v2/11155111/rpc?apikey=${pimlicoAPIKey}`,
36-
}
37-
}
35+
},
36+
},
3837
});
3938

4039
const privateKeyProvider = new EthereumPrivateKeyProvider({
@@ -45,8 +44,8 @@ const web3AuthOptions: Web3AuthOptions = {
4544
clientId,
4645
web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET,
4746
privateKeyProvider,
48-
accountAbstractionProvider
49-
}
47+
accountAbstractionProvider,
48+
};
5049

5150
const web3auth = new Web3Auth(web3AuthOptions);
5251

@@ -91,7 +90,6 @@ function App() {
9190
uiConsole("logged out");
9291
};
9392

94-
9593
const getAccounts = async () => {
9694
if (!provider) {
9795
uiConsole("Provider is not initialized yet");
@@ -201,7 +199,7 @@ function App() {
201199
<a target="_blank" href="https://web3auth.io/docs/sdk/pnp/web/modal" rel="noreferrer">
202200
Web3Auth{" "}
203201
</a>
204-
& AA React Quick Start
202+
& Biconomy AA React Example
205203
</h1>
206204

207205
<div className="grid">{loggedIn ? loggedInView : unloggedInView}</div>

web-modal-sdk/account-abstraction-examples/safe-modal-example/src/App.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { AccountAbstractionProvider, SafeSmartAccount } from "@web3auth/account-
66
import { Web3Auth, Web3AuthOptions } from "@web3auth/modal";
77
import { useEffect, useState } from "react";
88

9-
109
import RPC from "./ethersRPC";
1110

1211
const clientId = "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ"; // get from https://dashboard.web3auth.io
@@ -33,8 +32,8 @@ const accountAbstractionProvider = new AccountAbstractionProvider({
3332
smartAccountInit: new SafeSmartAccount(),
3433
paymasterConfig: {
3534
url: `https://api.pimlico.io/v2/11155111/rpc?apikey=${pimlicoAPIKey}`,
36-
}
37-
}
35+
},
36+
},
3837
});
3938

4039
const privateKeyProvider = new EthereumPrivateKeyProvider({
@@ -45,8 +44,8 @@ const web3AuthOptions: Web3AuthOptions = {
4544
clientId,
4645
web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET,
4746
privateKeyProvider,
48-
accountAbstractionProvider
49-
}
47+
accountAbstractionProvider,
48+
};
5049

5150
const web3auth = new Web3Auth(web3AuthOptions);
5251

@@ -91,7 +90,6 @@ function App() {
9190
uiConsole("logged out");
9291
};
9392

94-
9593
const getAccounts = async () => {
9694
if (!provider) {
9795
uiConsole("Provider is not initialized yet");
@@ -201,7 +199,7 @@ function App() {
201199
<a target="_blank" href="https://web3auth.io/docs/sdk/pnp/web/modal" rel="noreferrer">
202200
Web3Auth{" "}
203201
</a>
204-
& AA React Quick Start
202+
& Safe AA React Example
205203
</h1>
206204

207205
<div className="grid">{loggedIn ? loggedInView : unloggedInView}</div>

0 commit comments

Comments
 (0)