-
Notifications
You must be signed in to change notification settings - Fork 685
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: okto wallet support * fix: update helper description & svg image * fix: okto wallet svg file * fix: docs * chore: amend icon * chore: changeset * chore: name consistency * fix: merge conflict * fix: remove ios link * Revert "fix: remove ios link" This reverts commit 49ec0c6. * fix: lint * fix: okto i18n * fix: i18n strings --------- Co-authored-by: Asad Ahmed <[email protected]> Co-authored-by: Daniel Sinclair <[email protected]>
- Loading branch information
1 parent
e41103f
commit 4b7a44c
Showing
7 changed files
with
144 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
'@rainbow-me/rainbowkit': patch | ||
--- | ||
|
||
Okto Support | ||
|
||
**Example usage** | ||
|
||
```ts | ||
import { | ||
getDefaultWallets, | ||
connectorsForWallets, | ||
} from '@rainbow-me/rainbowkit'; | ||
import { oktoWallet } from '@rainbow-me/rainbowkit/wallets'; | ||
const { wallets } = getDefaultWallets({ appName, projectId, chains }); | ||
const connectors = connectorsForWallets([ | ||
...wallets, | ||
{ | ||
groupName: 'Other', | ||
wallets: [oktoWallet({ projectId, chains })], | ||
}, | ||
]); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/rainbowkit/src/wallets/walletConnectors/oktoWallet/oktoWallet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
88 changes: 88 additions & 0 deletions
88
packages/rainbowkit/src/wallets/walletConnectors/oktoWallet/oktoWallet.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/* eslint-disable sort-keys-fix/sort-keys-fix */ | ||
import { Chain } from '../../../components/RainbowKitProvider/RainbowKitChainContext'; | ||
import { getWalletConnectUri } from '../../../utils/getWalletConnectUri'; | ||
import { isAndroid } from '../../../utils/isMobile'; | ||
import { Wallet } from '../../Wallet'; | ||
import { getWalletConnectConnector } from '../../getWalletConnectConnector'; | ||
import type { | ||
WalletConnectConnectorOptions, | ||
WalletConnectLegacyConnectorOptions, | ||
} from '../../getWalletConnectConnector'; | ||
|
||
export interface OktoWalletLegacyOptions { | ||
projectId?: string; | ||
chains: Chain[]; | ||
walletConnectVersion: '1'; | ||
walletConnectOptions?: WalletConnectLegacyConnectorOptions; | ||
} | ||
|
||
export interface OktoWalletOptions { | ||
projectId: string; | ||
chains: Chain[]; | ||
walletConnectVersion?: '2'; | ||
walletConnectOptions?: WalletConnectConnectorOptions; | ||
} | ||
|
||
export const oktoWallet = ({ | ||
chains, | ||
projectId, | ||
walletConnectOptions, | ||
walletConnectVersion = '2', | ||
}: OktoWalletLegacyOptions | OktoWalletOptions): Wallet => ({ | ||
id: 'Okto', | ||
name: 'Okto', | ||
iconUrl: async () => (await import('./oktoWallet.svg')).default, | ||
iconBackground: '#fff', | ||
downloadUrls: { | ||
android: | ||
'https://play.google.com/store/apps/details?id=im.okto.contractwalletclient', | ||
ios: 'https://apps.apple.com/in/app/okto-wallet/id6450688229', | ||
mobile: 'https://okto.tech/', | ||
qrCode: 'https://okto.tech/', | ||
}, | ||
createConnector: () => { | ||
const connector = getWalletConnectConnector({ | ||
projectId, | ||
chains, | ||
version: walletConnectVersion, | ||
options: walletConnectOptions, | ||
}); | ||
|
||
return { | ||
connector, | ||
mobile: { | ||
getUri: async () => { | ||
const uri = await getWalletConnectUri( | ||
connector, | ||
walletConnectVersion, | ||
); | ||
return isAndroid() ? uri : `okto://wc?uri=${encodeURIComponent(uri)}`; | ||
}, | ||
}, | ||
qrCode: { | ||
getUri: async () => | ||
getWalletConnectUri(connector, walletConnectVersion), | ||
instructions: { | ||
learnMoreUrl: 'https://okto.tech/', | ||
steps: [ | ||
{ | ||
description: 'wallet_connectors.okto.qr_code.step1.description', | ||
step: 'install', | ||
title: 'wallet_connectors.okto.qr_code.step1.title', | ||
}, | ||
{ | ||
description: 'wallet_connectors.okto.qr_code.step2.description', | ||
step: 'create', | ||
title: 'wallet_connectors.okto.qr_code.step2.title', | ||
}, | ||
{ | ||
description: 'wallet_connectors.okto.qr_code.step3.description', | ||
step: 'scan', | ||
title: 'wallet_connectors.okto.qr_code.step3.title', | ||
}, | ||
], | ||
}, | ||
}, | ||
}; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4b7a44c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
rainbowkit-site – ./
v2-rainbowkit.vercel.app
rainbowkit.vercel.app
v1-rainbowkit.vercel.app
rainbowkit-site-rainbowdotme.vercel.app
rainbowkit.com
rainbowkit-site-git-main-rainbowdotme.vercel.app
www.rainbowkit.com
4b7a44c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
rainbowkit-example – ./
rainbowkit-example.vercel.app
rainbowkit-example-git-main-rainbowdotme.vercel.app
rainbowkit-example-rainbowdotme.vercel.app