Skip to content

Commit 4521d59

Browse files
committed
[nextjs-example-dapp] Added AptosConnect plugin
1 parent 14c4c50 commit 4521d59

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

apps/nextjs-example/components/AppContext.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { AptosConnectWalletPlugin } from '@aptos-connect/wallet-adapter-plugin';
12
import { BitgetWallet } from "@bitget-wallet/aptos-wallet-adapter";
23
import { FewchaWallet } from "fewcha-plugin-wallet-adapter";
34
import { MartianWallet } from "@martianwallet/aptos-wallet-adapter";
@@ -17,7 +18,15 @@ const WalletContextProvider: FC<{ children: ReactNode }> = ({ children }) => {
1718
const { autoConnect } = useAutoConnect();
1819
const { setErrorAlertMessage } = useAlert();
1920

21+
const clientSidePlugins = typeof global.window !== 'undefined' ? [
22+
new AptosConnectWalletPlugin({
23+
network: Network.DEVNET,
24+
// frontendBaseURL: 'http://localhost:3000'
25+
}),
26+
] : [];
27+
2028
const wallets = [
29+
...clientSidePlugins,
2130
new IdentityConnectWallet("57fa42a9-29c6-4f1e-939c-4eefa36d9ff5", {
2231
networkName: Network.TESTNET,
2332
}),

apps/nextjs-example/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
"lint": "next lint"
1212
},
1313
"dependencies": {
14+
"@aptos-connect/wallet-api": "^0.0.3",
15+
"@aptos-connect/wallet-adapter-plugin": "^0.0.6",
1416
"@aptos-labs/ts-sdk": "^1.18.1",
1517
"@aptos-labs/wallet-adapter-ant-design": "workspace:*",
1618
"@aptos-labs/wallet-adapter-core": "workspace:*",

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)