Skip to content

Commit

Permalink
feat: add kaia wallet (#2148)
Browse files Browse the repository at this point in the history
* feat: add kaia wallet

* chore: changeset

* fix: lint

---------

Co-authored-by: Daniel Sinclair <d@niel.nyc>
  • Loading branch information
0oooooooo0 and DanielSinclair authored Aug 19, 2024
1 parent f65b5c4 commit 9c36bfd
Show file tree
Hide file tree
Showing 7 changed files with 197 additions and 39 deletions.
5 changes: 5 additions & 0 deletions .changeset/poor-lemons-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rainbow-me/rainbowkit": patch
---

Added Kaia Wallet support with `kaiaWallet` wallet connector
10 changes: 6 additions & 4 deletions packages/example/src/wagmi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
gateWallet,
imTokenWallet,
iopayWallet,
kaiaWallet,
kaikasWallet,
krakenWallet,
kresusWallet,
Expand Down Expand Up @@ -182,15 +183,15 @@ export const config = getDefaultConfig({
wallets: [
argentWallet,
bifrostWallet,
binanceWallet,
bitgetWallet,
bitskiWallet,
bitverseWallet,
bloomWallet,
bybitWallet,
binanceWallet,
clvWallet,
compassWallet,
coin98Wallet,
compassWallet,
coreWallet,
dawnWallet,
desigWallet,
Expand All @@ -201,9 +202,10 @@ export const config = getDefaultConfig({
gateWallet,
imTokenWallet,
iopayWallet,
kresusWallet,
krakenWallet,
kaiaWallet,
kaikasWallet,
krakenWallet,
kresusWallet,
ledgerWallet,
magicEdenWallet,
mewWallet,
Expand Down
31 changes: 31 additions & 0 deletions packages/rainbowkit/src/locales/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,37 @@
}
},

"kaia": {
"extension": {
"step1": {
"description": "We recommend pinning Kaia to your taskbar for quicker access to your wallet.",
"title": "Install the Kaia extension"
},
"step2": {
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"title": "Create or Import a Wallet"
},
"step3": {
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
"title": "Refresh your browser"
}
},
"qr_code": {
"step1": {
"title": "Open the Kaia app",
"description": "Put Kaia app on your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap Scanner Icon in top right corner",
"description": "Choose New Connection, then scan the QR code and confirm the prompt to connect."
}
}
},

"kraken": {
"qr_code": {
"step1": {
Expand Down
6 changes: 4 additions & 2 deletions packages/rainbowkit/src/wallets/walletConnectors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { gateWallet } from './gateWallet/gateWallet';
import { imTokenWallet } from './imTokenWallet/imTokenWallet';
import { injectedWallet } from './injectedWallet/injectedWallet';
import { iopayWallet } from './iopayWallet/iopayWallet';
import { kaiaWallet } from './kaiaWallet/kaiaWallet';
import { kaikasWallet } from './kaikasWallet/kaikasWallet';
import { krakenWallet } from './krakenWallet/krakenWallet';
import { kresusWallet } from './kresusWallet/kresusWallet';
Expand Down Expand Up @@ -59,13 +60,13 @@ import { zerionWallet } from './zerionWallet/zerionWallet';
export {
argentWallet,
bifrostWallet,
binanceWallet,
bitgetWallet,
bitskiWallet,
bitverseWallet,
bloomWallet,
bybitWallet,
braveWallet,
binanceWallet,
bybitWallet,
clvWallet,
coin98Wallet,
coinbaseWallet,
Expand All @@ -81,6 +82,7 @@ export {
imTokenWallet,
injectedWallet,
iopayWallet,
kaiaWallet,
kaikasWallet,
krakenWallet,
kresusWallet,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import { DefaultWalletOptions, Wallet } from '../../Wallet';
import {
getInjectedConnector,
hasInjectedProvider,
} from '../../getInjectedConnector';
import { getWalletConnectConnector } from '../../getWalletConnectConnector';

export type KaiaWalletOptions = DefaultWalletOptions;

export const kaiaWallet = ({
projectId,
walletConnectParameters,
}: KaiaWalletOptions): Wallet => {
const isKaiaWalletInjected = hasInjectedProvider({
namespace: 'klaytn',
});

const shouldUseWalletConnect = !isKaiaWalletInjected;

const getUri = (uri: string) => {
return `kaikas://walletconnect?uri=${encodeURIComponent(uri)}`;
};

return {
id: 'kaia',
name: 'Kaia Wallet',
iconUrl: async () => (await import('./kaiaWallet.svg')).default,
installed: isKaiaWalletInjected || undefined,
iconBackground: '#fff',
downloadUrls: {
chrome:
'https://chromewebstore.google.com/detail/kaia-wallet/jblndlipeogpafnldhgmapagcccfchpi',
browserExtension: 'https://app.kaiawallet.io',
qrCode: 'https://app.kaiawallet.io',
ios: 'https://apps.apple.com/us/app/kaia-wallet/id6502896387',
android: 'https://play.google.com/store/apps/details?id=io.klutch.wallet',
mobile: 'https://app.kaiawallet.io',
},
mobile: { getUri: shouldUseWalletConnect ? getUri : undefined },
qrCode: shouldUseWalletConnect
? {
getUri: (uri: string) => uri,
instructions: {
learnMoreUrl: 'https://kaiawallet.io',
steps: [
{
description: 'wallet_connectors.kaia.qr_code.step1.description',
step: 'install',
title: 'wallet_connectors.kaia.qr_code.step1.title',
},
{
description: 'wallet_connectors.kaia.qr_code.step2.description',
step: 'create',
title: 'wallet_connectors.kaia.qr_code.step2.title',
},
{
description: 'wallet_connectors.kaia.qr_code.step3.description',
step: 'refresh',
title: 'wallet_connectors.kaia.qr_code.step3.title',
},
],
},
}
: undefined,
extension: {
instructions: {
learnMoreUrl: 'https://kaiawallet.io',
steps: [
{
description: 'wallet_connectors.kaia.extension.step1.description',
step: 'install',
title: 'wallet_connectors.kaia.extension.step1.title',
},
{
description: 'wallet_connectors.kaia.extension.step2.description',
step: 'create',
title: 'wallet_connectors.kaia.extension.step2.title',
},
{
description: 'wallet_connectors.kaia.extension.step3.description',
step: 'refresh',
title: 'wallet_connectors.kaia.extension.step3.title',
},
],
},
},
createConnector: shouldUseWalletConnect
? getWalletConnectConnector({
projectId,
walletConnectParameters,
})
: getInjectedConnector({
namespace: 'klaytn',
}),
};
};
72 changes: 39 additions & 33 deletions site/data/en-US/docs/custom-wallet-list.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,24 @@ import { safeWallet } from '@rainbow-me/rainbowkit/wallets';

The following wallets are provided via the `wallet` object (in alphabetical order).

#### 1inch Wallet

```tsx
import { oneInchWallet } from '@rainbow-me/rainbowkit/wallets';
```

#### Argent

```tsx
import { argentWallet } from '@rainbow-me/rainbowkit/wallets';
```

#### Binance Web3 Wallet

```tsx
import { binanceWallet } from '@rainbow-me/rainbowkit/wallets';
```

#### Bitget

```tsx
Expand Down Expand Up @@ -134,22 +146,16 @@ import { bitverseWallet } from '@rainbow-me/rainbowkit/wallets';
import { bloomWallet } from '@rainbow-me/rainbowkit/wallets';
```

#### Bybit Wallet

```tsx
import { bybitWallet } from '@rainbow-me/rainbowkit/wallets';
```

#### Brave Wallet

```tsx
import { braveWallet } from '@rainbow-me/rainbowkit/wallets';
```

#### Binance Web3 Wallet
#### Bybit Wallet

```tsx
import { binanceWallet } from '@rainbow-me/rainbowkit/wallets';
import { bybitWallet } from '@rainbow-me/rainbowkit/wallets';
```

#### Coinbase
Expand All @@ -169,16 +175,16 @@ import { coinbaseWallet } from '@rainbow-me/rainbowkit/wallets';
coinbaseWallet.preference = 'smartWalletOnly';
```

#### Compass Wallet
#### Coin98 Wallet

```tsx
import { compassWallet } from '@rainbow-me/rainbowkit/compassWallet';
import { coin98Wallet } from '@rainbow-me/rainbowkit/wallets';
```

#### Coin98 Wallet
#### Compass Wallet

```tsx
import { coin98Wallet } from '@rainbow-me/rainbowkit/wallets';
import { compassWallet } from '@rainbow-me/rainbowkit/compassWallet';
```

#### Core
Expand Down Expand Up @@ -223,12 +229,6 @@ import { frontierWallet } from '@rainbow-me/rainbowkit/wallets';
import { gateWallet } from '@rainbow-me/rainbowkit/wallets';
```

#### Ledger Live

```tsx
import { ledgerWallet } from '@rainbow-me/rainbowkit/wallets';
```

#### imToken

```tsx
Expand All @@ -241,6 +241,18 @@ import { imTokenWallet } from '@rainbow-me/rainbowkit/wallets';
import { iopayWallet } from '@rainbow-me/rainbowkit/wallets';
```

#### Kaia Wallet

```tsx
import { kaiaWallet } from '@rainbow-me/rainbowkit/wallets';
```

#### Kaikas

```tsx
import { kaikasWallet } from '@rainbow-me/rainbowkit/wallets';
```

#### Kraken Wallet

```tsx
Expand All @@ -253,10 +265,10 @@ import { krakenWallet } from '@rainbow-me/rainbowkit/wallets';
import { kresusWallet } from '@rainbow-me/rainbowkit/wallets';
```

#### Kaikas
```tsx
import { kaikasWallet } from '@rainbow-me/rainbowkit/wallets';
#### Ledger Live

```tsx
import { ledgerWallet } from '@rainbow-me/rainbowkit/wallets';
```

#### Magic Eden Wallet
Expand All @@ -265,16 +277,16 @@ import { kaikasWallet } from '@rainbow-me/rainbowkit/wallets';
import { magicEdenWallet } from '@rainbow-me/rainbowkit/wallets';
```

#### MetaMask
#### MEW Wallet

```tsx
import { metaMaskWallet } from '@rainbow-me/rainbowkit/wallets';
import { mewWallet } from '@rainbow-me/rainbowkit/wallets';
```

#### MEW Wallet
#### MetaMask

```tsx
import { mewWallet } from '@rainbow-me/rainbowkit/wallets';
import { metaMaskWallet } from '@rainbow-me/rainbowkit/wallets';
```

#### OKX Wallet
Expand All @@ -289,12 +301,6 @@ import { okxWallet } from '@rainbow-me/rainbowkit/wallets';
import { omniWallet } from '@rainbow-me/rainbowkit/wallets';
```

#### 1inch Wallet

```tsx
import { oneInchWallet } from '@rainbow-me/rainbowkit/wallets';
```

#### OneKey

```tsx
Expand Down Expand Up @@ -468,4 +474,4 @@ const connectors = connectorsForWallets(
],
{ appName: 'RainbowKit App', projectId: 'YOUR_PROJECT_ID' },
);
```
```

0 comments on commit 9c36bfd

Please sign in to comment.