Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
update main readme fix missing yarn changes, and lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronmgdr committed Sep 20, 2024
1 parent a57a508 commit 6e95318
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 118 deletions.
103 changes: 13 additions & 90 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,103 +1,26 @@
# Rainbowkit-celo

This is a plugin to help [rainbowkit](https://www.rainbowkit.com/docs) developers support the CELO protocol faster.
It includes the chain information as well as the main CELO wallets (Valora, Celo Wallet, Celo Terminal...).
# Migrating away from rainbowkit-celo

## Installation
## sunset

```sh
npm install @celo/rainbowkit-celo
```
This Project is sunset.

This package has a few peer dependencies and expect them to be installed too. Follow [their instructions](https://www.rainbowkit.com/docs/installation) if that's not done yet.
Since viem + wagmi + rainbowkit now have first class support for celo we recommend just importing directly from rainbowkit and wagmi.

Here's the exhaustive list:
## chains

```sh
npm install @rainbow-me/rainbowkit @wagmi/chains wagmi viem
```
- import { Alfajores, Celo } from "@celo/rainbowkit-celo/chains"
+ import {celo, celoAlfajores} from "wagmi/chains"
### A note on version compatibility

After version 0.8.0 inclusive, this package has the most significant digit match the version of @rainbow-me/rainbowkit it is compatible with.

IE for `@rainbow-me/[email protected]` use `@celo/[email protected]`

## Usage

```ts
import {
connectorsForWallets,
RainbowKitProvider,
} from "@rainbow-me/rainbowkit";
import {
metaMaskWallet,
omniWallet,
walletConnectWallet,
} from "@rainbow-me/rainbowkit/wallets";
import { configureChains, createClient, WagmiConfig } from "wagmi";
import { jsonRpcProvider } from "wagmi/providers/jsonRpc";

// Import known recommended wallets
import { Valora, CeloWallet, CeloDance } from "@celo/rainbowkit-celo/wallets";

// Import CELO chain information
import { Alfajores, Celo } from "@celo/rainbowkit-celo/chains";

const { chains, provider } = configureChains(
[Alfajores, Celo],
[
jsonRpcProvider({
rpc: (chain) => ({ http: chain.rpcUrls.default.http[0] }),
}),
]
);

// Note for older use with wagmi before 0.9 / rainbowkit before 0.8.1 configure
// const { chains, provider } = configureChains(
// [Alfajores, Celo],
// [jsonRpcProvider({ rpc: (chain) => ({ http: chain.rpcUrls.default }) })]
// );

const connectors = connectorsForWallets([
{
groupName: "Recommended with CELO",
wallets: [
Valora({ chains }),
CeloWallet({ chains }),
CeloDance({ chains }),
metaMaskWallet({ chains }),
omniWallet({ chains }),
walletConnectWallet({ chains }),
],
},
]);

const wagmiClient = createClient({
autoConnect: true,
connectors,
provider,
});

// ... Your exisiting app.
```

## Adding wallets to the config

If the wallet exists in the normal rainbow kit package you can add it to the Supports Celo list at [lists/index.ts](https://github.com/celo-org/rainbowkit-celo/blob/main/packages/rainbowkit-celo/lists/index.ts)

If the wallet needs a new config add a new file in [wallets folder](https://github.com/celo-org/rainbowkit-celo/tree/main/packages/rainbowkit-celo/wallets) with the config needed for you wallet. Then import this to the lists/index.ts file
## wallets

## Example app
* Othello (formerly celo wallet) has dropped support for wallet connect
* Celo Terminal --> use the default Wallet Connect Connector
* Valora --> `import { valoraWallet } from '@rainbow-me/rainbowkit/wallets';`

In `apps/example` there's an example app that showcases the usage of the package.

In order to run it, execute following commands:

```bash
$ yarn build

$ yarn dev
```
## further reading

Then you can access the app by opening your browser and visiting http://localhost:3001/
see celo docs for a pretty decent [rainbkowkit setup](https://docs.celo.org/developer/rainbowkit-celo)
26 changes: 0 additions & 26 deletions apps/example/README.md

This file was deleted.

4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ __metadata:
languageName: node
linkType: hard

"@celo/rainbowkit-celo@npm:^1.2.0, @celo/rainbowkit-celo@workspace:packages/rainbowkit-celo":
"@celo/rainbowkit-celo@npm:^1.2.1, @celo/rainbowkit-celo@workspace:packages/rainbowkit-celo":
version: 0.0.0-use.local
resolution: "@celo/rainbowkit-celo@workspace:packages/rainbowkit-celo"
dependencies:
Expand Down Expand Up @@ -5106,7 +5106,7 @@ __metadata:
dependencies:
"@babel/core": "npm:^7.23.7"
"@celo/abis": "npm:^11.0.0"
"@celo/rainbowkit-celo": "npm:^1.2.0"
"@celo/rainbowkit-celo": "npm:^1.2.1"
"@mdx-js/loader": "npm:^2.1.3"
"@mdx-js/react": "npm:^2.1.3"
"@metamask/providers": "npm:^11.1.2"
Expand Down

0 comments on commit 6e95318

Please sign in to comment.