Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
b5bcbb9
update README and fix GitHub Actions
wbh1328551759 Jul 23, 2025
51c7cfd
Chore/UI work (#24)
wbh1328551759 Jul 29, 2025
6a3f9f3
fix bug in walletconnect
wbh1328551759 Jul 30, 2025
cf27120
Chore/UI work (#25)
wbh1328551759 Aug 4, 2025
d5c4b46
Chore/ci cd readme (#27)
wbh1328551759 Aug 5, 2025
2b90656
Feat/mobile UI (#28)
wbh1328551759 Aug 5, 2025
caacd7f
Merge branch 'main' into develop
wbh1328551759 Aug 5, 2025
8fdd357
fix(ui): fix view switching logic in ConnectModal component (#30)
wbh1328551759 Aug 5, 2025
a43a43c
Fix/connect modal (#32)
wbh1328551759 Aug 5, 2025
1db349f
Merge branch 'main' into develop
wbh1328551759 Aug 5, 2025
947048f
fix(with-vite): fix undifined of Notification
wbh1328551759 Aug 5, 2025
6ec04b0
fix(with-vite): Fix the reference of the Notification object to ensur…
wbh1328551759 Aug 5, 2025
8ece1d9
Merge branch 'main' into develop
wbh1328551759 Aug 5, 2025
4d34260
fix(ui): fix connect in mobile
wbh1328551759 Aug 6, 2025
2f3ed41
Fix/create api (#39)
wbh1328551759 Aug 7, 2025
b9263f3
Fix/create api (#40)
wbh1328551759 Aug 7, 2025
e629d5d
Fix/create api (#42)
wbh1328551759 Aug 8, 2025
d37fc86
Chore/ci cd readme (#43)
wbh1328551759 Aug 8, 2025
6169574
fix: merge
wbh1328551759 Aug 8, 2025
3afea0c
Merge branch 'main' of github-wbh:Luno-lab/LunoKit into develop
wbh1328551759 Aug 8, 2025
26732ca
Fix/create api (#56)
wbh1328551759 Aug 8, 2025
edb1780
Merge branch 'develop' of github-wbh:Luno-lab/LunoKit into develop
wbh1328551759 Aug 10, 2025
02d0fe1
Merge branch 'main' of github-wbh:Luno-lab/LunoKit into develop
wbh1328551759 Aug 10, 2025
4e91fde
feat(example): Add environment variable example file and update conne…
wbh1328551759 Aug 11, 2025
4630f7d
Chore/UI work (#63)
wbh1328551759 Aug 11, 2025
16346bd
fix(chore): Update signMessage method to support optional chainId par…
wbh1328551759 Aug 11, 2025
28c7f8e
Fix/UI bug (#66)
wbh1328551759 Aug 12, 2025
5bca6c1
fix: resolve conflicts
wbh1328551759 Aug 12, 2025
1c324bb
Chore/UI work (#70)
wbh1328551759 Aug 13, 2025
36d9e9d
Merge branch 'main' of github-wbh:Luno-lab/LunoKit into develop
wbh1328551759 Aug 13, 2025
d55baa0
feat(ui): update ui of ChainIcon (#71)
wbh1328551759 Aug 13, 2025
8503b74
Fix/css scope (#72)
wbh1328551759 Aug 13, 2025
92bba64
Merge branch 'main' of github-wbh:Luno-lab/LunoKit into develop
wbh1328551759 Aug 13, 2025
fe2ef05
fix(with-vite): remove useless code (#75)
wbh1328551759 Aug 13, 2025
52fb1ce
docs:update README
Gintma Aug 13, 2025
9692e36
Merge branch 'main' of github-wbh:Luno-lab/LunoKit into develop
wbh1328551759 Aug 15, 2025
321281a
Chore/readme ci (#80)
wbh1328551759 Aug 19, 2025
d0f43fc
Chore/readme ci (#82)
wbh1328551759 Aug 19, 2025
4191fe0
Merge branch 'main' into develop
wbh1328551759 Aug 19, 2025
523dc34
Feat/chain search (#85)
wbh1328551759 Aug 25, 2025
6c5736f
Feat/add connectors (#86)
wbh1328551759 Aug 30, 2025
44b2243
Feat/add connectors (#87)
wbh1328551759 Sep 4, 2025
2b9ad0e
Feat/add connectors (#89)
wbh1328551759 Sep 5, 2025
dd8318c
Merge branch 'main' into develop
wbh1328551759 Sep 5, 2025
5b7798e
Chore/UI work (#91)
Gintma Sep 11, 2025
812a798
Merge branch 'main' of github-wbh:Luno-lab/LunoKit into develop
wbh1328551759 Sep 15, 2025
0f28f4f
Fix/readme (#94)
wbh1328551759 Sep 15, 2025
4ce8373
Merge branch 'develop' of github-wbh:Luno-lab/LunoKit into develop
wbh1328551759 Sep 15, 2025
a65f9d6
Feat/with papi (#97)
wbh1328551759 Sep 29, 2025
286999c
Merge branch 'develop' of github-wbh:Luno-lab/LunoKit into develop
wbh1328551759 Sep 29, 2025
e13f91d
fix: resolve conflicts
wbh1328551759 Oct 11, 2025
1941b99
Feat/assets list (#112)
wbh1328551759 Nov 5, 2025
fb4ae11
Feat/assets list (#113)
wbh1328551759 Nov 5, 2025
d7cd46e
Merge branch 'main' of github-wbh:Luno-lab/LunoKit into develop
wbh1328551759 Nov 5, 2025
2d137b0
chore: fix biome files includes
wbh1328551759 Nov 5, 2025
4b0be4a
Feat/assets list (#117)
wbh1328551759 Nov 5, 2025
b9bfae6
Merge branch 'main' of github-wbh:Luno-lab/LunoKit into develop
wbh1328551759 Nov 6, 2025
f56b734
Fix/account changed (#122)
wbh1328551759 Nov 6, 2025
2428326
Merge branch 'develop' of github-wbh:Luno-lab/LunoKit into develop
wbh1328551759 Nov 6, 2025
59fd929
Merge branch 'main' of github-wbh:Luno-lab/LunoKit into develop
wbh1328551759 Nov 6, 2025
4c08d44
Merge branch 'main' of github-wbh:Luno-lab/LunoKit into develop
wbh1328551759 Nov 12, 2025
05d5755
Merge branch 'main' of github-wbh:Luno-lab/LunoKit into develop
wbh1328551759 Nov 17, 2025
c2b2107
Merge branch 'main' of github-wbh:Luno-lab/LunoKit into develop
wbh1328551759 Nov 18, 2025
fb21b25
Feat/app info (#131)
wbh1328551759 Dec 15, 2025
3322872
Release/v0.0.11 (#132)
wbh1328551759 Dec 15, 2025
93f9aef
chore(release): version packages (#133)
github-actions[bot] Dec 15, 2025
dd06b36
Merge branch 'main' of github-wbh:Luno-lab/LunoKit into develop
wbh1328551759 Dec 15, 2025
2d8c1a5
Merge branch 'main' of github-wbh:Luno-lab/LunoKit into develop
wbh1328551759 Dec 15, 2025
09c31e5
Merge branch 'main' of github-wbh:Luno-lab/LunoKit into develop
wbh1328551759 Jan 7, 2026
139bfcb
Merge branch 'main' of github-wbh:Luno-lab/LunoKit into develop
wbh1328551759 Jan 21, 2026
3e15640
fix: resolve conflicts
wbh1328551759 Jan 21, 2026
beff7e4
fix(core): handle EVM addresses and out-of-range SS58 formats (#144)
wbh1328551759 Jan 21, 2026
4fdc374
Merge branch 'main' of github-wbh:Luno-lab/LunoKit into develop
wbh1328551759 Feb 4, 2026
388ad50
feat: Add the function of customizing wallet grouping
wbh1328551759 Feb 5, 2026
678ed12
chore: fix lint
wbh1328551759 Feb 5, 2026
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
2 changes: 1 addition & 1 deletion .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"mode": "pre",
"mode": "exit",
"tag": "beta",
"initialVersions": {
"with-cra": "0.1.0",
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ dist-ssr

PROJECT_CONTEXT.md
/.cursor
/.claude

/scripts/*

.envrc

.biome/
/CLAUDE.md
18 changes: 17 additions & 1 deletion packages/core/src/config/createConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type {
Chain,
Config,
Connector,
ConnectorGroup,
CreateConfigParameters,
RawStorage,
Transport,
Expand Down Expand Up @@ -36,11 +37,15 @@ function generateTransportsFromChains(chains: readonly Chain[]): Record<string,
return transports;
}

function isConnectorGroupArray(input: Connector[] | ConnectorGroup[]): input is ConnectorGroup[] {
return input.length > 0 && 'groupName' in input[0] && 'wallets' in input[0];
}

export function createConfig(parameters: CreateConfigParameters): Config {
const {
appName = 'My Luno App',
chains = [],
connectors,
connectors: connectorsInput,
transports = {},
storage = defaultLunoStorage,
autoConnect = true,
Expand All @@ -52,6 +57,14 @@ export function createConfig(parameters: CreateConfigParameters): Config {
subscan,
} = parameters;

const connectorGroups = isConnectorGroupArray(connectorsInput)
? connectorsInput.filter((g) => g.wallets.length > 0)
: undefined;

const connectors = isConnectorGroupArray(connectorsInput)
? connectorsInput.flatMap((g) => g.wallets)
: connectorsInput;

if (!connectors || connectors.length === 0) {
throw new Error('No connectors provided. Wallet connection features will be unavailable.');
}
Expand Down Expand Up @@ -82,6 +95,9 @@ export function createConfig(parameters: CreateConfigParameters): Config {
appName,
chains: Object.freeze([...chains]) as readonly Chain[],
connectors: Object.freeze([...connectors]) as readonly Connector[],
connectorGroups: connectorGroups
? (Object.freeze([...connectorGroups]) as readonly ConnectorGroup[])
: undefined,
transports: Object.freeze({ ...finalTransports }) as Readonly<Record<string, Transport>>,
storage,
autoConnect,
Expand Down
5 changes: 3 additions & 2 deletions packages/core/src/types/config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ApiOptions } from 'dedot';
import type { AnyShape } from 'dedot/shape';
import type { Chain } from './chain';
import type { Connector } from './connector';
import type { Connector, ConnectorGroup } from './connector';

export interface RawStorage {
getItem(key: string): string | null | Promise<string | null>;
Expand All @@ -26,7 +26,7 @@ type LunoApiOptions = Partial<Omit<ApiOptions, 'provider' | 'signer'>> & {
export interface CreateConfigParameters extends LunoApiOptions {
appName?: Optional<string>;
chains?: Optional<readonly Chain[]>;
connectors: Connector[];
connectors: Connector[] | ConnectorGroup[];
transports?: Optional<Record<string, Transport>>;

storage?: Optional<LunoStorage>;
Expand All @@ -42,6 +42,7 @@ export interface Config extends LunoApiOptions {
readonly appName: string;
readonly chains: readonly Chain[];
readonly connectors: readonly Connector[];
readonly connectorGroups?: readonly ConnectorGroup[];
readonly transports: Readonly<Record<string, Transport>>;
readonly storage: LunoStorage;
readonly autoConnect: boolean;
Expand Down
5 changes: 5 additions & 0 deletions packages/core/src/types/connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,8 @@ export interface WalletConnectConnectorOptions {
links?: Optional<ConnectorLinks>;
supportedChains?: Optional<HexString[]>;
}

export interface ConnectorGroup {
groupName: string;
wallets: Connector[];
}
59 changes: 42 additions & 17 deletions packages/ui/src/components/ConnectModal/ConnectOptions.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { useConnectors } from '@luno-kit/react';
import { useConfig, useConnectors } from '@luno-kit/react';
import type { Connector } from '@luno-kit/react/types';
import { isMobileDevice } from '@luno-kit/react/utils';
import React, { useMemo } from 'react';
import { cs } from '../../utils';

interface Props {
onConnect: (connector: Connector) => Promise<void>;
showInstalledGroup: boolean;
}

const popularConnectorIds = [
Expand All @@ -19,33 +20,57 @@ const popularConnectorIds = [

const moreConnectorIds = ['ledger', 'polkagate', 'fearless-wallet', 'mimir', 'enkrypt', 'OneKey'];

export const ConnectOptions = React.memo(({ onConnect }: Props) => {
export const ConnectOptions = React.memo(({ onConnect, showInstalledGroup }: Props) => {
const connectors = useConnectors();
const config = useConfig();

const installedConnectors = connectors.filter((c) => c.isInstalled());
const popularConnectors = connectors.filter(
(c) => popularConnectorIds.includes(c.id) && !c.isInstalled()
(c: Connector) => popularConnectorIds.includes(c.id) && !c.isInstalled()
);
const moreConnectors = connectors.filter(
(c) => moreConnectorIds.includes(c.id) && !c.isInstalled()
(c: Connector) => !popularConnectorIds.includes(c.id) && !c.isInstalled()
);

const connectorGroup: { title: string; group: Connector[] }[] = useMemo(() => {
if (!config?.connectorGroups) {
return [
{ title: 'Installed', group: installedConnectors },
{ title: 'Popular', group: popularConnectors },
{ title: 'More', group: moreConnectors },
];
}

const hasUserDefinedInstalled = config.connectorGroups.some((g) => g.groupName === 'Installed');

if (hasUserDefinedInstalled || !showInstalledGroup) {
return config.connectorGroups
.filter((g) => g.wallets.length > 0)
.map((g) => ({ title: g.groupName, group: g.wallets }))
.sort((a, b) => (a.title === 'Installed' ? -1 : b.title === 'Installed' ? 1 : 0));
}

const allWallets = config.connectorGroups.flatMap((g) => g.wallets);
const installed = allWallets.filter((c) => c.isInstalled());

const customGroups = config.connectorGroups
.map((g) => ({
title: g.groupName,
group: g.wallets.filter((c) => !c.isInstalled()),
}))
.filter((g) => g.group.length > 0);

return [
{
title: 'Installed',
group: installedConnectors,
},
{
title: 'Popular',
group: popularConnectors,
},
{
title: 'More',
group: moreConnectors,
},
...(installed.length > 0 ? [{ title: 'Installed', group: installed }] : []),
...customGroups,
];
}, [installedConnectors, popularConnectors, moreConnectors]);
}, [
installedConnectors,
popularConnectors,
moreConnectors,
config?.connectorGroups,
showInstalledGroup,
]);

if (isMobileDevice()) {
const filteredConnectors = connectors
Expand Down
7 changes: 6 additions & 1 deletion packages/ui/src/components/ConnectModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ export interface ConnectModalProps {
size?: Optional<ModalSize>;
appInfo?: Optional<Partial<AppInfo>>;
container?: Optional<ModalContainer>;
showInstalledGroup?: Optional<boolean>;
}

export const ConnectModal: React.FC<ConnectModalProps> = ({
appInfo,
container,
showInstalledGroup = true,
size = 'wide',
}) => {
const { isOpen, close } = useConnectModal();
Expand Down Expand Up @@ -86,7 +88,9 @@ export const ConnectModal: React.FC<ConnectModalProps> = ({

const viewComponents = useMemo(() => {
return {
[ConnectModalView.connectOptions]: <ConnectOptions onConnect={handleConnect} />,
[ConnectModalView.connectOptions]: (
<ConnectOptions onConnect={handleConnect} showInstalledGroup={showInstalledGroup} />
),
[ConnectModalView.walletView]: (
<WalletView
connectState={{ isConnecting, isError: connectError, error: connectErrorMsg }}
Expand All @@ -107,6 +111,7 @@ export const ConnectModal: React.FC<ConnectModalProps> = ({
connectError,
connectErrorMsg,
appInfo,
showInstalledGroup,
]);

useEffect(() => {
Expand Down
11 changes: 10 additions & 1 deletion packages/ui/src/providers/LunoKitProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export interface LunoKitProviderProps {
config: LunoCoreConfig & {
modalSize?: Optional<ModalSize>;
modalContainer?: Optional<ModalContainer>;
showInstalledGroup?: boolean;
};
theme?: Optional<PartialLunokitTheme | LunokitThemeOverrides>;
appInfo?: Optional<Partial<AppInfo>>;
Expand All @@ -52,6 +53,7 @@ export const LunoKitProvider: React.FC<LunoKitProviderProps> = ({
appInfo={appInfo}
modalSize={config.modalSize}
modalContainer={config.modalContainer}
showInstalledGroup={config.showInstalledGroup}
/>
</ModalProvider>
</ThemeProvider>
Expand All @@ -63,16 +65,23 @@ interface RenderModalsProps {
modalSize?: Optional<ModalSize>;
appInfo?: Optional<Partial<AppInfo>>;
modalContainer?: Optional<ModalContainer>;
showInstalledGroup?: Optional<boolean>;
}

const RenderModals: React.FC<RenderModalsProps> = ({
modalSize,
appInfo,
modalContainer,
showInstalledGroup,
}: RenderModalsProps) => {
return (
<>
<ConnectModal size={modalSize} appInfo={appInfo} container={modalContainer} />
<ConnectModal
showInstalledGroup={showInstalledGroup}
size={modalSize}
appInfo={appInfo}
container={modalContainer}
/>
<AccountDetailsModal container={modalContainer} />
<ChainModal container={modalContainer} />
</>
Expand Down