Skip to content
3 changes: 3 additions & 0 deletions docs/src/routes/docs/[...4]wallets/injected.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,9 @@ const injected = injectedModule({
- Binance - _Desktop_
- Coinbase - _Desktop & Mobile_
- Phantom - _Desktop & Mobile_
- SafePal - _Desktop & Mobile_
- Zerion - _Desktop & Mobile_
- OKX Wallet - _Desktop_
- Tally - _Desktop_
- Trust - _Mobile_
- Opera - _Desktop & Mobile_
Expand Down Expand Up @@ -307,6 +309,7 @@ const injected = injectedModule({
- Zeal - _Desktop_
- Exodus - _Desktop & Mobile_
- Frontier - _Desktop & Mobile_
- Rainbow - _Desktop & Mobile_

## Build Environments

Expand Down
2 changes: 1 addition & 1 deletion packages/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@web3-onboard/keepkey": "^2.3.3",
"@web3-onboard/keystone": "^2.3.3",
"@web3-onboard/ledger": "^2.4.2",
"@web3-onboard/injected-wallets": "^2.6.2-alpha.2",
"@web3-onboard/injected-wallets": "^2.6.2-alpha.3",
"@web3-onboard/magic": "^2.1.3",
"@web3-onboard/phantom": "^2.0.0-alpha.1",
"@web3-onboard/portis": "^2.1.3",
Expand Down
3 changes: 3 additions & 0 deletions packages/injected/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ console.log(connectedWallets)
- Binance - _Desktop_
- Coinbase - _Desktop & Mobile_
- Phantom - _Desktop & Mobile_
- SafePal - _Desktop & Mobile_
- Zerion - _Desktop & Mobile_
- OKX Wallet - _Desktop_
- Tally - _Desktop_
- Trust - _Mobile_
- Opera - _Desktop & Mobile_
Expand Down Expand Up @@ -75,6 +77,7 @@ console.log(connectedWallets)
- Zeal - _Desktop_
- Exodus - _Desktop & Mobile_
- Frontier - _Desktop & Mobile_
- Rainbow - _Desktop & Mobile_

## Filtering Wallets

Expand Down
2 changes: 1 addition & 1 deletion packages/injected/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/injected-wallets",
"version": "2.6.2-alpha.2",
"version": "2.6.2-alpha.3",
"description": "Injected wallet module for connecting browser extension and mobile wallets to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
"keywords": [
"Ethereum",
Expand Down
4 changes: 2 additions & 2 deletions packages/injected/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export const isWalletAvailable = (
return true
}

// For multiple injected providers, check providers array
// example coinbase inj wallet pushes over-ridden wallets
// For multiple injected providers, check providers array
// example coinbase inj wallet pushes over-ridden wallets
// into a providers array at window.ethereum
return !!provider.providers?.some(provider =>
checkProviderIdentity({ provider, device })
Expand Down
5 changes: 5 additions & 0 deletions packages/injected/src/icons/okxwallet.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default `<svg width="100%" height="100%" viewBox="0 0 1000 1000" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="1000" height="1000" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M393.949 218.518H231.049C224.129 218.518 218.519 224.128 218.519 231.048V393.948C218.519 400.869 224.129 406.479 231.049 406.479H393.949C400.87 406.479 406.48 400.869 406.48 393.948V231.048C406.48 224.128 400.87 218.518 393.949 218.518ZM581.992 406.479H419.092C412.172 406.479 406.561 412.09 406.561 419.01V581.91C406.561 588.831 412.172 594.441 419.092 594.441H581.992C588.913 594.441 594.523 588.831 594.523 581.91V419.01C594.523 412.09 588.913 406.479 581.992 406.479ZM606.974 218.518H769.874C776.794 218.518 782.405 224.128 782.405 231.048V393.948C782.405 400.869 776.794 406.479 769.874 406.479H606.974C600.053 406.479 594.443 400.869 594.443 393.948V231.048C594.443 224.128 600.053 218.518 606.974 218.518ZM393.95 594.442H231.049C224.129 594.442 218.519 600.052 218.519 606.973V769.873C218.519 776.793 224.129 782.404 231.049 782.404H393.95C400.87 782.404 406.48 776.793 406.48 769.873V606.973C406.48 600.052 400.87 594.442 393.95 594.442ZM606.974 594.442H769.874C776.794 594.442 782.405 600.052 782.405 606.973V769.873C782.405 776.793 776.794 782.404 769.874 782.404H606.974C600.053 782.404 594.443 776.793 594.443 769.873V606.973C594.443 600.052 600.053 594.442 606.974 594.442Z" fill="white"/>
</svg>
`
4 changes: 4 additions & 0 deletions packages/injected/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export enum ProviderIdentityFlag {
Bitski = 'isBitski',
Enkrypt = 'isEnkrypt',
Phantom = 'isPhantom',
OKXWallet = 'isOkxWallet',
Zeal = 'isZeal',
Zerion = 'isZerion',
Rainbow = 'isRainbow',
Expand Down Expand Up @@ -99,6 +100,7 @@ export enum ProviderLabel {
Enkrypt = 'Enkrypt',
Zeal = 'Zeal',
Phantom = 'Phantom',
OKXWallet = 'OKX Wallet',
Zerion = 'Zerion',
Rainbow = 'Rainbow',
SafePal = 'SafePal'
Expand Down Expand Up @@ -128,6 +130,7 @@ export enum InjectedNameSpace {
Enkrypt = 'enkrypt',
Zeal = 'zeal',
Phantom = 'phantom',
OKXWallet = 'okxwallet',
Trust = 'trustwallet',
Frontier = 'frontier'
}
Expand Down Expand Up @@ -161,6 +164,7 @@ export interface CustomWindow extends Window {
phantom: {
ethereum: InjectedProvider
}
okxwallet: InjectedProvider
trustwallet: InjectedProvider
}

Expand Down
15 changes: 14 additions & 1 deletion packages/injected/src/wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ const phantom: InjectedWalletModule = {
}),
platforms: ['all']
}

const safepal: InjectedWalletModule = {
label: ProviderLabel.SafePal,
injectedNamespace: InjectedNameSpace.Ethereum,
Expand All @@ -691,6 +691,18 @@ const rainbow: InjectedWalletModule = {
platforms: ['all']
}

const okxwallet: InjectedWalletModule = {
label: ProviderLabel.OKXWallet,
injectedNamespace: InjectedNameSpace.OKXWallet,
checkProviderIdentity: ({ provider }) =>
!!provider && !!provider[ProviderIdentityFlag.OKXWallet],
getIcon: async () => (await import('./icons/okxwallet.js')).default,
getInterface: async () => ({
provider: createEIP1193Provider(window.okxwallet)
}),
platforms: ['desktop']
}

const wallets = [
zeal,
exodus,
Expand Down Expand Up @@ -730,6 +742,7 @@ const wallets = [
bitski,
enkrypt,
phantom,
okxwallet,
zerion,
rainbow,
safepal
Expand Down