Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add roninWallet support * chore: lint * revert: add ronin chain * chore: change mobile getUri * chore: changeset * chore: change position for translation * chore: require projectId in docs * chore: tweak changset * fix: lint --------- Co-authored-by: Daniel Sinclair <d@niel.nyc>
- Loading branch information
1 parent
c16541a
commit 1e7d3f4
Showing
7 changed files
with
151 additions
and
4 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,7 @@ | ||
--- | ||
"@rainbow-me/rainbowkit": patch | ||
"example": patch | ||
"site": patch | ||
--- | ||
|
||
Added Ronin Wallet support with `roninWallet` wallet connector |
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/roninWallet/roninWallet.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
93 changes: 93 additions & 0 deletions
93
packages/rainbowkit/src/wallets/walletConnectors/roninWallet/roninWallet.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,93 @@ | ||
import { DefaultWalletOptions, Wallet } from '../../Wallet'; | ||
import { | ||
getInjectedConnector, | ||
hasInjectedProvider, | ||
} from '../../getInjectedConnector'; | ||
import { getWalletConnectConnector } from '../../getWalletConnectConnector'; | ||
|
||
export type RoninWalletOptions = DefaultWalletOptions; | ||
|
||
export const roninWallet = ({ | ||
projectId, | ||
walletConnectParameters, | ||
}: RoninWalletOptions): Wallet => { | ||
const isRoninInjected = hasInjectedProvider({ | ||
namespace: 'ronin.provider', | ||
}); | ||
|
||
return { | ||
id: 'ronin', | ||
name: 'Ronin Wallet', | ||
iconUrl: async () => (await import('./roninWallet.svg')).default, | ||
iconBackground: '#ffffff', | ||
rdns: 'com.roninchain.wallet', | ||
installed: isRoninInjected || undefined, | ||
downloadUrls: { | ||
android: | ||
'https://play.google.com/store/apps/details?id=com.skymavis.genesis', | ||
ios: 'https://apps.apple.com/us/app/ronin-wallet/id1592675001', | ||
mobile: 'https://wallet.roninchain.com', | ||
chrome: | ||
'https://chrome.google.com/webstore/detail/ronin-wallet/fnjhmkhhmkbjkkabndcnnogagogbneec', | ||
edge: 'https://microsoftedge.microsoft.com/addons/detail/ronin-wallet/kjmoohlgokccodicjjfebfomlbljgfhk', | ||
firefox: 'https://addons.mozilla.org/firefox/addon/ronin-wallet', | ||
browserExtension: 'https://wallet.roninchain.com/', | ||
qrCode: 'https://wallet.roninchain.com/', | ||
}, | ||
mobile: { | ||
getUri: (uri: string) => | ||
`roninwallet://wc?uri=${encodeURIComponent(uri)}`, | ||
}, | ||
qrCode: { | ||
getUri: (uri: string) => uri, | ||
instructions: { | ||
learnMoreUrl: 'https://wallet.roninchain.com/', | ||
steps: [ | ||
{ | ||
description: 'wallet_connectors.ronin.qr_code.step1.description', | ||
step: 'install', | ||
title: 'wallet_connectors.ronin.qr_code.step1.title', | ||
}, | ||
{ | ||
description: 'wallet_connectors.ronin.qr_code.step2.description', | ||
step: 'create', | ||
title: 'wallet_connectors.ronin.qr_code.step2.title', | ||
}, | ||
{ | ||
description: 'wallet_connectors.ronin.qr_code.step3.description', | ||
step: 'scan', | ||
title: 'wallet_connectors.ronin.qr_code.step3.title', | ||
}, | ||
], | ||
}, | ||
}, | ||
extension: { | ||
instructions: { | ||
learnMoreUrl: 'https://wallet.roninchain.com/', | ||
steps: [ | ||
{ | ||
description: 'wallet_connectors.ronin.extension.step1.description', | ||
step: 'install', | ||
title: 'wallet_connectors.ronin.extension.step1.title', | ||
}, | ||
{ | ||
description: 'wallet_connectors.ronin.extension.step2.description', | ||
step: 'create', | ||
title: 'wallet_connectors.ronin.extension.step2.title', | ||
}, | ||
{ | ||
description: 'wallet_connectors.ronin.extension.step3.description', | ||
step: 'refresh', | ||
title: 'wallet_connectors.ronin.extension.step3.title', | ||
}, | ||
], | ||
}, | ||
}, | ||
createConnector: isRoninInjected | ||
? getInjectedConnector({ namespace: 'ronin.provider' }) | ||
: getWalletConnectConnector({ | ||
projectId, | ||
walletConnectParameters, | ||
}), | ||
}; | ||
}; |
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