Skip to content

Add Lif3 Wallet Support #2058

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ const injected = injectedModule({
- Coin98 Wallet - _Desktop & Mobile_
- SubWallet - _Desktop & Mobile_
- Kayros - _Desktop_
- Lif3Wallet - _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 @@ -42,7 +42,7 @@
"@web3-onboard/gas": "^2.1.7",
"@web3-onboard/gnosis": "^2.2.1",
"@web3-onboard/infinity-wallet": "^2.0.3",
"@web3-onboard/injected-wallets": "^2.10.11",
"@web3-onboard/injected-wallets": "^2.10.12-alpha.1",
"@web3-onboard/keepkey": "^2.3.7",
"@web3-onboard/keystone": "^2.3.7",
"@web3-onboard/ledger": "^2.6.0-alpha.1",
Expand Down
1 change: 1 addition & 0 deletions packages/injected/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ console.log(connectedWallets)
- Coin98 Wallet - _Desktop & Mobile_
- SubWallet - _Desktop & Mobile_
- Kayros - _Desktop_
- Lif3Wallet - _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.10.11",
"version": "2.10.12-alpha.1",
"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
3 changes: 2 additions & 1 deletion packages/injected/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ export const WALLET_NAMES: { [key: string]: string } = {
coin98wallet: 'Coin98 Wallet',
SubWallet: 'SubWallet',
kayros: 'Kayros',
foxwallet: "FoxWallet"
foxwallet: "FoxWallet",
Lif3Wallet: 'Lif3 Wallet'
}
38 changes: 38 additions & 0 deletions packages/injected/src/icons/lif3wallet.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
export default `<svg width="112" height="112" viewBox="0 0 112 112" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_10010_9926)">
<mask id="mask0_10010_9926" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="112" height="112">
<path d="M112 0H0V112H112V0Z" fill="white"/>
</mask>
<g mask="url(#mask0_10010_9926)">
<path d="M112 0H0V112H112V0Z" fill="url(#paint0_radial_10010_9926)"/>
<path d="M56 112C86.9279 112 112 86.9279 112 56C112 25.0721 86.9279 0 56 0C25.0721 0 0 25.0721 0 56C0 86.9279 25.0721 112 56 112Z" fill="url(#paint1_radial_10010_9926)"/>
<g filter="url(#filter0_d_10010_9926)">
<path d="M52.357 29.2868C51.7731 29.8736 51.3443 30.5873 51.0975 31.3635L35.2766 73.5044H28.8955V79.9679H40.9805L45.6375 67.115L47.8537 60.6537L55.9104 37.7743L70.7687 79.9679H83.1011V73.5044H76.6951L60.8755 31.3621C60.6287 30.5866 60.2 29.8732 59.6162 29.2868C58.6537 28.3193 57.348 27.7759 55.9867 27.7759C54.6253 27.7759 53.3198 28.3193 52.357 29.2868Z" fill="white"/>
</g>
</g>
</g>
<defs>
<filter id="filter0_d_10010_9926" x="24.8955" y="27.7759" width="62.2051" height="60.1919" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="4"/>
<feGaussianBlur stdDeviation="2"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_10010_9926"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_10010_9926" result="shape"/>
</filter>
<radialGradient id="paint0_radial_10010_9926" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="rotate(45) scale(158.392 106.499)">
<stop stop-color="#79A5C6"/>
<stop offset="0.616783" stop-color="#2A4874"/>
</radialGradient>
<radialGradient id="paint1_radial_10010_9926" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="rotate(45) scale(158.392 106.499)">
<stop stop-color="#79A5C6"/>
<stop offset="0.616783" stop-color="#2A4874"/>
</radialGradient>
<clipPath id="clip0_10010_9926">
<rect width="112" height="112" rx="15" fill="white"/>
</clipPath>
</defs>
</svg>
`
9 changes: 6 additions & 3 deletions packages/injected/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ export enum ProviderIdentityFlag {
Coin98Wallet = 'isCoin98',
SubWallet = 'isSubWallet',
Kayros = 'isKayros',
FoxWallet = 'isFoxWallet'
FoxWallet = 'isFoxWallet',
Lif3Wallet = 'isLif3Wallet',
}

/**
Expand All @@ -93,7 +94,8 @@ export enum ProviderExternalUrl {
SubWallet = 'https://www.subwallet.app/',
Kayros = 'https://www.kayros.games/wallet/',
XDEFI = 'https://xdefi.io/',
FoxWallet = 'https://foxwallet.com/download'
FoxWallet = 'https://foxwallet.com/download',
Lif3Wallet = 'https://lif3.com'
}

export enum ProviderLabel {
Expand Down Expand Up @@ -152,7 +154,8 @@ export enum ProviderLabel {
Coin98Wallet = 'Coin98 Wallet',
SubWallet = 'SubWallet',
Kayros = 'Kayros',
FoxWallet = 'FoxWallet'
FoxWallet = 'FoxWallet',
Lif3Wallet = 'Lif3 Wallet',
}

export interface MeetOneProvider extends ExternalProvider {
Expand Down
18 changes: 17 additions & 1 deletion packages/injected/src/wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,21 @@ const foxwallet: InjectedWalletModule = {
platforms: ['mobile']
}

const Lif3Wallet: InjectedWalletModule = {
label: ProviderLabel.Lif3Wallet,
injectedNamespace: InjectedNameSpace.Ethereum,
checkProviderIdentity: ({ provider }) =>
!!provider && !!provider[ProviderIdentityFlag.Lif3Wallet],
getIcon: async () => (await import('./icons/lif3wallet.js')).default,
getInterface: async () => ({
provider: createEIP1193Provider(window.ethereum, {
wallet_switchEthereumChain: UNSUPPORTED_METHOD,
eth_selectAccounts: UNSUPPORTED_METHOD
})
}),
platforms: ['mobile']
}

const wallets = [
zeal,
exodus,
Expand Down Expand Up @@ -925,7 +940,8 @@ const wallets = [
coin98wallet,
subwallet,
kayros,
foxwallet
foxwallet,
Lif3Wallet
]

export default wallets