-
Notifications
You must be signed in to change notification settings - Fork 624
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: gateWallet * update: gateWallet * chore: optimize svg with svgo * chore: alphabetize custom wallet list and remove translations * revert: add translations for all languages apart from en_US * revert: remove site/data/*/** docs * chore: changeset * update: remove translations and optimize svg logo * fix: gatewallet svg --------- Co-authored-by: Magomed Khamidov <53529533+KosmosKey@users.noreply.github.com> Co-authored-by: Daniel Sinclair <d@niel.nyc>
- Loading branch information
1 parent
5c60239
commit 6c240ba
Showing
6 changed files
with
117 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,7 @@ | ||
--- | ||
"@rainbow-me/rainbowkit": patch | ||
"example": patch | ||
"site": patch | ||
--- | ||
|
||
Added Gate Wallet support with `gateWallet` 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
1 change: 1 addition & 0 deletions
1
packages/rainbowkit/src/wallets/walletConnectors/gateWallet/gateWallet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
99 changes: 99 additions & 0 deletions
99
packages/rainbowkit/src/wallets/walletConnectors/gateWallet/gateWallet.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,99 @@ | ||
import { isAndroid } from '../../../utils/isMobile'; | ||
import { DefaultWalletOptions, Wallet } from '../../Wallet'; | ||
import { | ||
getInjectedConnector, | ||
hasInjectedProvider, | ||
} from '../../getInjectedConnector'; | ||
import { getWalletConnectConnector } from '../../getWalletConnectConnector'; | ||
|
||
export type GateWalletOptions = DefaultWalletOptions; | ||
|
||
export const gateWallet = ({ | ||
projectId, | ||
walletConnectParameters, | ||
}: GateWalletOptions): Wallet => { | ||
const isGateInjected = hasInjectedProvider({ namespace: 'gatewallet' }); | ||
const shouldUseWalletConnect = !isGateInjected; | ||
|
||
return { | ||
id: 'gate', | ||
name: 'Gate Wallet', | ||
rdns: 'io.gate.wallet', | ||
iconUrl: async () => (await import('./gateWallet.svg')).default, | ||
iconAccent: '#fff', | ||
iconBackground: '#fff', | ||
downloadUrls: { | ||
android: | ||
'https://play.google.com/store/apps/details?id=com.gateio.gateio', | ||
ios: 'https://apps.apple.com/us/app/gate-io-buy-bitcoin-crypto/id1294998195', | ||
mobile: 'https://www.gate.io/mobileapp', | ||
qrCode: 'https://www.gate.io/web3', | ||
chrome: | ||
'https://chromewebstore.google.com/detail/gate-wallet/cpmkedoipcpimgecpmgpldfpohjplkpp', | ||
browserExtension: 'https://www.gate.io/web3', | ||
}, | ||
mobile: { | ||
getUri: shouldUseWalletConnect | ||
? (uri: string) => { | ||
return isAndroid() | ||
? uri | ||
: `gtweb3wallet://wc?uri=${encodeURIComponent(uri)}`; | ||
} | ||
: undefined, | ||
}, | ||
qrCode: shouldUseWalletConnect | ||
? { | ||
getUri: (uri: string) => uri, | ||
instructions: { | ||
learnMoreUrl: 'https://www.gate.io/learn', | ||
steps: [ | ||
{ | ||
description: 'wallet_connectors.gate.qr_code.step1.description', | ||
step: 'install', | ||
title: 'wallet_connectors.gate.qr_code.step1.title', | ||
}, | ||
{ | ||
description: 'wallet_connectors.gate.qr_code.step2.description', | ||
step: 'create', | ||
title: 'wallet_connectors.gate.qr_code.step2.title', | ||
}, | ||
{ | ||
description: 'wallet_connectors.gate.qr_code.step3.description', | ||
step: 'scan', | ||
title: 'wallet_connectors.gate.qr_code.step3.title', | ||
}, | ||
], | ||
}, | ||
} | ||
: undefined, | ||
extension: { | ||
instructions: { | ||
learnMoreUrl: 'https://www.gate.io/learn', | ||
steps: [ | ||
{ | ||
description: 'wallet_connectors.gate.extension.step1.description', | ||
step: 'install', | ||
title: 'wallet_connectors.gate.extension.step1.title', | ||
}, | ||
{ | ||
description: 'wallet_connectors.gate.extension.step2.description', | ||
step: 'create', | ||
title: 'wallet_connectors.gate.extension.step2.title', | ||
}, | ||
{ | ||
description: 'wallet_connectors.gate.extension.step3.description', | ||
step: 'refresh', | ||
title: 'wallet_connectors.gate.extension.step3.title', | ||
}, | ||
], | ||
}, | ||
}, | ||
|
||
createConnector: shouldUseWalletConnect | ||
? getWalletConnectConnector({ | ||
projectId, | ||
walletConnectParameters, | ||
}) | ||
: getInjectedConnector({ namespace: 'gatewallet' }), | ||
}; | ||
}; |
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