Skip to content

Commit

Permalink
feat: kresusWallet (#1788)
Browse files Browse the repository at this point in the history
* feat: kresus wallet

* chore: tweak changeset

---------

Co-authored-by: Daniel Sinclair <d@niel.nyc>
  • Loading branch information
magiziz and DanielSinclair committed Feb 22, 2024
1 parent bb56562 commit c16541a
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .changeset/new-cameras-eat.md
@@ -0,0 +1,7 @@
---
"@rainbow-me/rainbowkit": patch
"example": patch
"site": patch
---

Added Kresus support with `kresusWallet` wallet connector
2 changes: 2 additions & 0 deletions packages/example/pages/_app.tsx
Expand Up @@ -33,6 +33,7 @@ import {
frameWallet,
frontierWallet,
imTokenWallet,
kresusWallet,
ledgerWallet,
mewWallet,
oktoWallet,
Expand Down Expand Up @@ -160,6 +161,7 @@ const config = getDefaultConfig({
frameWallet,
frontierWallet,
imTokenWallet,
kresusWallet,
ledgerWallet,
mewWallet,
oktoWallet,
Expand Down
17 changes: 17 additions & 0 deletions packages/rainbowkit/src/locales/en_US.json
Expand Up @@ -502,6 +502,23 @@
}
},

"kresus": {
"qr_code": {
"step1": {
"title": "Open the Kresus Wallet app",
"description": "Add Kresus Wallet to 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 the QR icon and scan",
"description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
}
}
},

"metamask": {
"qr_code": {
"step1": {
Expand Down
2 changes: 2 additions & 0 deletions packages/rainbowkit/src/wallets/walletConnectors/index.ts
Expand Up @@ -16,6 +16,7 @@ import { frameWallet } from './frameWallet/frameWallet';
import { frontierWallet } from './frontierWallet/frontierWallet';
import { imTokenWallet } from './imTokenWallet/imTokenWallet';
import { injectedWallet } from './injectedWallet/injectedWallet';
import { kresusWallet } from './kresusWallet/kresusWallet';
import { ledgerWallet } from './ledgerWallet/ledgerWallet';
import { metaMaskWallet } from './metaMaskWallet/metaMaskWallet';
import { mewWallet } from './mewWallet/mewWallet';
Expand Down Expand Up @@ -61,6 +62,7 @@ export {
frontierWallet,
imTokenWallet,
injectedWallet,
kresusWallet,
ledgerWallet,
metaMaskWallet,
mewWallet,
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,51 @@
import { DefaultWalletOptions, Wallet } from '../../Wallet';
import { getWalletConnectConnector } from '../../getWalletConnectConnector';

export type KresusWalletOptions = DefaultWalletOptions;

export const kresusWallet = ({
projectId,
walletConnectParameters,
}: KresusWalletOptions): Wallet => ({
id: 'kresus-wallet',
name: 'Kresus Wallet',
iconUrl: async () => (await import('./kresusWallet.svg')).default,
iconBackground: '#fff',
downloadUrls: {
android:
'https://play.google.com/store/apps/details?id=com.kresus.superapp',
ios: 'https://apps.apple.com/us/app/kresus-crypto-nft-superapp/id6444355152',
qrCode: 'https://kresusconnect.kresus.com/download',
},
mobile: {
getUri: (uri: string) =>
`com.kresus.superapp://wc?uri=${encodeURIComponent(uri)}`,
},
qrCode: {
getUri: (uri: string) => uri,
instructions: {
learnMoreUrl: 'https://kresus.com/',
steps: [
{
description: 'wallet_connectors.kresus.qr_code.step1.description',
step: 'install',
title: 'wallet_connectors.kresus.qr_code.step1.title',
},
{
description: 'wallet_connectors.kresus.qr_code.step2.description',
step: 'create',
title: 'wallet_connectors.kresus.qr_code.step2.title',
},
{
description: 'wallet_connectors.kresus.qr_code.step3.description',
step: 'scan',
title: 'wallet_connectors.kresus.qr_code.step3.title',
},
],
},
},
createConnector: getWalletConnectConnector({
projectId,
walletConnectParameters,
}),
});
10 changes: 10 additions & 0 deletions site/data/en-US/docs/custom-wallet-list.mdx
Expand Up @@ -254,6 +254,16 @@ imTokenWallet(options: {
});
```

#### Kresus Wallet

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

kresusWallet(options: {
projectId: string;
});
```

#### MetaMask

```tsx
Expand Down

0 comments on commit c16541a

Please sign in to comment.