Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/nexus/nexus-examples/_meta.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export default {
"nexus-initialization-basic": "Barebones initialization inside Next JS",
"nexus-initialization-advanced": " Initialize Nexus SDK using RainbowKit",
"nexus-rainbowkit-extension": "Add RainbowKit to Your Nexus SDK Project",
// "nexus-porto-extension": "Add Porto Wallet to Your Nexus SDK Project",
// "nexus-bridge": "Bridge tokens using the Nexus SDK",
}
}
21 changes: 0 additions & 21 deletions app/nexus/nexus-examples/nexus-initialization-advanced/page.mdx

This file was deleted.

14 changes: 10 additions & 4 deletions app/nexus/nexus-examples/nexus-initialization-basic/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,13 @@ export default function ConnectButton({ className }: { className?: string }) {

#### init-button.tsx

This component will be used to initialize the SDK using `nexus-core`.
This component will be used to initialize the SDK using `nexus-core`.
<Callout type="info">
This tutorial only covers the **default injected provider** (`window.ethereum`). If you are planning to use other wallets that utilize **Wagmi such as RainbowKit, Privy etc.**, check out our other articles that cover how to get a Web3 Provider from that wallet to initialize the SDK.

- [RainbowKit](http://docs.availproject.org/nexus/nexus-examples/nexus-rainbowkit-extension)

</Callout>

```tsx filename="src/components/init-button.tsx"
'use client';
Expand All @@ -220,6 +226,7 @@ export default function InitButton({
const eth = (window as any)?.ethereum;
try {
// We're calling our wrapper function from the lib/nexus.ts file here.
// Essentially calls "sdk.initialize(provider)" - SDK method.
await initializeWithProvider(eth);
onReady?.();
alert('Nexus initialized');
Expand Down Expand Up @@ -333,12 +340,11 @@ We're rendering it out on the screen raw to keep the tutorial simple, but you ca
4. All in all, clicking through the buttons will allow you to initialize the SDK, fetch balances for a user, and de-initialize the SDK.


## Think About What You Just Did Here!!!
## Think About What You Just Did Here!

In just a few lines of code, you leveraged the power of the Nexus SDK to fetch a list of tokens that the user holds across several different chains.
You can now move around those tokens as you please, the possibilities are endless!

You might want to bridge one of the tokens across chains, or maybe you want to swap all existing tokens of your user spread across
different chains into `ETH` on `Arbitrum`.
You might want to bridge one of the tokens across chains, or maybe you want to swap all existing tokens of your user spread across different chains into `ETH` on `Arbitrum`.

Once you have a wallet connected and the SDK initialized, you can do all of this and more!
Loading