mirror of
https://github.com/luxfi/kit.git
synced 2026-10-30 16:22:01 +00:00
51 lines
1.4 KiB
Plaintext
51 lines
1.4 KiB
Plaintext
## Migrate
|
|
|
|
### 0.1.0 Breaking changes
|
|
|
|
The [wagmi](https://wagmi.sh/core/getting-started) and [viem](https://viem.sh) peer dependencies have reached 2.x.x with breaking changes.
|
|
|
|
#### 1. Upgrade LuxKit, `@wagmi/core`, and `viem` to their latest versions
|
|
|
|
```sh npm2yarn
|
|
npm i luxkit @wagmi/core [email protected] @wagmi/connectors
|
|
```
|
|
|
|
#### 2. Upgrade your LuxKit and Wagmi configurations
|
|
|
|
```js
|
|
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();
|
|
```
|
|
|
|
#### 3. `wagmi` migrate
|
|
|
|
- [`@wagmi/core` v2 Migration Guide](https://wagmi.sh/core/guides/migrate-from-v1-to-v2)
|
|
- [`wagmi` Migration Guide](https://wagmi.sh/react/guides/migrate-from-v1-to-v2)
|
|
- [`viem` Migration Guide](https://viem.sh/docs/migration-guide.html#_2-x-x-breaking-changes)
|