Skip to content

feat: Kaia wallet integration #2348

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ const injected = injectedModule({
- Lif3Wallet - _Mobile_
- StableWallet - _Mobile_
- Echooo - _Desktop & Mobile_
- Kaia Wallet - _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 @@ -44,7 +44,7 @@
"@web3-onboard/gas": "^2.2.1",
"@web3-onboard/gnosis": "^2.3.1",
"@web3-onboard/infinity-wallet": "^2.1.1",
"@web3-onboard/injected-wallets": "^2.11.3",
"@web3-onboard/injected-wallets": "^2.12.0-alpha.1",
"@web3-onboard/keepkey": "^2.3.8",
"@web3-onboard/keplr": "2.0.0",
"@web3-onboard/keystone": "^2.3.8",
Expand Down
1 change: 1 addition & 0 deletions packages/injected/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ const onboard = Onboard({
- Lif3Wallet - _Mobile_
- Zodiac Pilot - _Desktop_
- Echooo - _Desktop & Mobile_
- Kaia - _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.11.3",
"version": "2.12.0-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 @@ -35,5 +35,6 @@ export const WALLET_NAMES: { [key: string]: string } = {
kayros: 'Kayros',
foxwallet: "FoxWallet",
Lif3Wallet: 'Lif3 Wallet',
Echooo:'Echooo Wallet'
Echooo:'Echooo Wallet',
KaiaWallet: 'Kaia Wallet'
}
11 changes: 11 additions & 0 deletions packages/injected/src/icons/kaiawallet.ts

Large diffs are not rendered by default.

13 changes: 9 additions & 4 deletions packages/injected/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ export enum ProviderIdentityFlag {
ZodiacPilot = 'isZodiacPilot',
StableWallet = 'isStableWallet',
Echooo = 'isEchooo',
Keplr = 'keplr'
Keplr = 'keplr',
KaiaWallet = 'isKaikas'
}

/**
Expand Down Expand Up @@ -103,7 +104,8 @@ export enum ProviderExternalUrl {
Rabby = 'https://rabby.io',
ZodiacPilot = 'https://pilot.gnosisguild.org/',
Echooo = 'https://www.echooo.xyz',
Keplr = 'https://www.keplr.app/download'
Keplr = 'https://www.keplr.app/download',
KaiaWallet = 'https://www.kaiawallet.io'
}

export enum ProviderLabel {
Expand Down Expand Up @@ -167,7 +169,8 @@ export enum ProviderLabel {
ZodiacPilot = 'Zodiac Pilot',
StableWallet = 'StableWallet',
Echooo = 'Echooo',
Keplr = 'Keplr'
Keplr = 'Keplr',
KaiaWallet = 'Kaia Wallet'
}

export interface MeetOneProvider extends ExternalProvider {
Expand Down Expand Up @@ -205,7 +208,8 @@ export enum InjectedNameSpace {
SubWallet = 'SubWallet',
Kayros = 'kayros',
FoxWallet = 'foxwallet',
Echooo = 'echooo'
Echooo = 'echooo',
KaiaWallet = 'klaytn'
}

export interface CustomWindow extends Window {
Expand Down Expand Up @@ -258,6 +262,7 @@ export interface CustomWindow extends Window {
echooo: {
ethereum: InjectedProvider
}
klaytn: InjectedProvider
}

export type InjectedProvider = ExternalProvider &
Expand Down
16 changes: 15 additions & 1 deletion packages/injected/src/wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,19 @@ const keplr: InjectedWalletModule = {
externalUrl: ProviderExternalUrl.Keplr
}

const kaiaWallet: InjectedWalletModule = {
label: ProviderLabel.KaiaWallet,
injectedNamespace: InjectedNameSpace.KaiaWallet,
checkProviderIdentity: ({ provider }) =>
!!provider && !!provider[ProviderIdentityFlag.KaiaWallet],
getIcon: async () => (await import('./icons/kaiawallet.js')).default,
getInterface: async () => ({
provider: createEIP1193Provider(window.klaytn)
}),
platforms: ['all'],
externalUrl: ProviderExternalUrl.KaiaWallet
}

const wallets = [
zeal,
exodus,
Expand Down Expand Up @@ -990,7 +1003,8 @@ const wallets = [
zodiacPilot,
stablewallet,
echooo,
keplr
keplr,
kaiaWallet
]

export default wallets