Files
2025-01-07 20:44:46 -06:00

55 lines
1.7 KiB
Plaintext

import { Steps } from "nextra/components";
<Steps>
### Installation
Install LuxKit and its peer dependencies ([@wagmi/core](https://wagmi.sh/core/getting-started) and [viem](https://viem.sh/)).
```sh npm2yarn
npm i luxkit @wagmi/core [email protected]
```
### API Keys
1. LuxKit utilises [https://walletconnect.com/]()'s SDK to help with connecting wallets. WalletConnect 2.0 requires a projectId which you can create quickly and easily for free over at [WalletConnect Cloud](https://cloud.walletconnect.com/).
1. [wagmi](https://wagmi.sh/react/api/transports/http#usage) recommends using other provider packages such as [Infura](https://www.infura.io) or [Alchemy](https://www.alchemy.com/) depending on the specific network requirements of your dApp. These providers offer reliable infrastructure and can be chosen based on your specific needs.
### Config
create a config using wagmi's createConfig and create a LuxKit config;
```ts filename="app.ts"
import { createModal, getDefaultConfig } from "luxkit";
import { createConfig, http } from "@wagmi/core";
import { arbitrum, bsc, mainnet, optimism, polygon } from "@wagmi/core/chains";
export const config = createConfig(
getDefaultConfig({
appName: "LuxKit example",
projectId: "58a22d2bc1c793fc31c117ad9ceba8d9",
chains: [mainnet, arbitrum, bsc, optimism, polygon],
transports: {
[mainnet.id]: http(),
[arbitrum.id]: http(),
[bsc.id]: http(),
[optimism.id]: http(),
[polygon.id]: http(),
},
})
);
export const luxkit = createModal({
wagmi: config,
});
luxkit.open();
console.log("current luxkit modal open status:", luxkit.getOpenState());
luxkit.close();
```
###
</Steps>