Connect your Aztec app to any Aztec wallet.
// before
import { Wallet } from "@aztec/aztec.js";
const account: Wallet;
const token = await TokenContract.at(address, account);
// after
import { AztecWalletSdk, obsidion } from "@nemi-fi/wallet-sdk";
import { Contract } from "@nemi-fi/wallet-sdk/eip1193";
class Token extends Contract.fromAztec(TokenContract) {}
const sdk = new AztecWalletSdk({
aztecNode: "https://l2.testnet.nemi.fi",
connectors: [obsidion()],
});
await sdk.connect("obsidion");
const account = await sdk.getAccount();
const token = await Token.at(address, account);
import { useAccount } from "@nemi-fi/wallet-sdk/react";
function App() {
const account = useAccount(sdk);
return <div>{account.address.toString()}</div>;
}
import { getDeployedTestAccountsWallets } from "@aztec/accounts/testing";
import { createAztecNodeClient, createPXEClient } from "@aztec/aztec.js";
import { type Account, Eip1193Account } from "@nemi-fi/wallet-sdk/eip1193";
const sandboxUrl = "http://localhost:8080";
const aztecNode = createAztecNodeClient(sandboxUrl);
const pxe = createPXEClient(sandboxUrl);
const [wallet] = await getDeployedTestAccountsWallets(pxe);
const account: Account = Eip1193Account.fromAztec(wallet, aztecNode, pxe);