Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
8069526
feat: merge packages, remove legacy web3-react package
alx-khramov Oct 6, 2026
f34364b
feat: introduce headless API and separate Lido UI skins
alx-khramov Oct 9, 2026
867a947
feat(ledger-connector): use bundler module resolution
alx-khramov Oct 12, 2026
a3631ea
feat(ui): improve wallet connection errors and picker UX
alx-khramov Oct 10, 2026
d055e2e
chore(demo-react): remove holesky
alx-khramov Oct 10, 2026
6c570d5
chore: update eslint to v10
alx-khramov Oct 12, 2026
bcbc5a9
chore: use typescript v7, update tsdown
alx-khramov Oct 12, 2026
07f398b
fix(ui-lido): inherit page theme colors in modal
alx-khramov Oct 12, 2026
9116924
docs(migration): add clarifications
alx-khramov Oct 12, 2026
0a2e404
fix(headless): ignore stale connection rejections
alx-khramov Oct 12, 2026
31210f1
fix(ledger): preserve accounts screen during handoff
alx-khramov Oct 12, 2026
bcae9a6
fix(exports): add default entry points for packages
alx-khramov Oct 12, 2026
ca219a4
chore: standardize type checks
alx-khramov Oct 13, 2026
e00837e
fix(ui-lido-legacy): preserve wallet icons across renders
alx-khramov Oct 13, 2026
e6e78bf
chore(ui-lido): constrain supported UI kit versions
alx-khramov Oct 13, 2026
99a0047
refactor(ui-lido): use skin-owned dialog markup
alx-khramov Oct 13, 2026
c92e338
fix: various minor fixes
alx-khramov Oct 13, 2026
5402c3c
build(ui-lido): watch copied assets
alx-khramov Oct 13, 2026
3a11f99
fix(ledger): enforce configured chain for transactions
alx-khramov Oct 13, 2026
d125dd3
fix(headless): await old wallet disconnect before connecting a new one
alx-khramov Oct 13, 2026
b29d691
fix(wallets-helpers): key connector cache by WalletConnect config
alx-khramov Oct 14, 2026
6bbd3eb
fix(reef-knot): match saved wallet to recent connector
alx-khramov Oct 14, 2026
b1e18de
refactor(connection): clarify modal state ref usage
alx-khramov Oct 14, 2026
84e63a2
refactor(walletconnect): remove URI-based connection flow
alx-khramov Oct 15, 2026
b68d1d4
fix(core-react): disconnect all retained wallets
alx-khramov Oct 15, 2026
953bec5
fix(wallets): wait for EIP-6963 providers on reconnect
alx-khramov Oct 15, 2026
30c6e47
fix(okx): encode the full page URL in deeplinks
alx-khramov Oct 15, 2026
be2422d
fix(ui-lido-legacy): always unmount exited transition overlays
alx-khramov Oct 15, 2026
d36b8ad
test: include tests in TypeScript checks
alx-khramov Oct 15, 2026
b7f7606
chore: update changelogs
alx-khramov Oct 15, 2026
686657f
fix(reef-knot): preserve Ledger account selection
alx-khramov Oct 16, 2026
e72dece
feat(demo-react): add EIP-712 wallet signing test
alx-khramov Oct 16, 2026
1c8da4a
fix(reef-knot): restore wallets from saved wallet IDs
alx-khramov Oct 18, 2026
bdb20cc
fix(reef-knot): skip auto-reconnect during manual connection
alx-khramov Oct 19, 2026
fa67e39
fix(wallets-helpers): resolve late EIP-6963 providers
alx-khramov Oct 19, 2026
0811ae7
chore(playwright-tests): ignore local environment secrets
alx-khramov Oct 22, 2026
9a1d1a6
fix(reef-knot): handle wallet rejection errors safely
alx-khramov Oct 22, 2026
5250557
fix(ui): clarify connection error dismissal
alx-khramov Oct 22, 2026
cd84868
fix(reef-knot): center Ledger views in modal
alx-khramov Oct 23, 2026
ab1b2da
fix(reef-knot): clarify pending wallet requests
alx-khramov Oct 23, 2026
5e8ace4
fix(reef-knot): prevent unsafe wallet errors from reaching users
alx-khramov Oct 29, 2026
42a5e0f
feat(ui-lido): improve wallet picker layout and controls
alx-khramov Nov 3, 2026
b290a70
fix(ui-lido): improve requirements screens and account loading
alx-khramov Nov 3, 2026
046dd67
fix(ui-lido): highlight connecting wallet
alx-khramov Nov 3, 2026
abed09b
style(ui-lido): set description font weight to regular
alx-khramov Nov 5, 2026
2691ada
feat(modal): add back navigation and connected results
alx-khramov Nov 5, 2026
a63ec45
fix(modal): prevent page scrolling on touch devices
alx-khramov Nov 5, 2026
9e05d8c
test(reef-knot): clarify connection promise names
alx-khramov Nov 5, 2026
fe29f7f
fix(headless): update generic connection error message
alx-khramov Nov 5, 2026
2d26ba1
fix(reef-knot): detect closed wallet modals as rejection
alx-khramov Nov 5, 2026
3c67ecc
fix(ui-lido): use latest callback when modal exits
alx-khramov Nov 6, 2026
dc06a72
docs(reef-knot): clarify UI skin package options
alx-khramov Nov 6, 2026
e31b96b
fix(reef-knot): detect pending requests by message text
alx-khramov Nov 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
68 changes: 0 additions & 68 deletions .eslintrc.base.json

This file was deleted.

1 change: 0 additions & 1 deletion .github/workflows/demo-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ jobs:
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
WALLETCONNECT_PROJECT_ID: ${{ vars.WALLETCONNECT_PROJECT_ID }}
RPC_PROVIDER_URL_1: ${{ vars.RPC_PROVIDER_URL_1 }}
RPC_PROVIDER_URL_17000: ${{ vars.RPC_PROVIDER_URL_17000 }}
RPC_PROVIDER_URL_560048: ${{ vars.RPC_PROVIDER_URL_560048 }}
SUPPORTED_CHAINS: ${{ vars.SUPPORTED_CHAINS }}
DEFAULT_CHAIN: ${{ vars.DEFAULT_CHAIN }}
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Changelog

The actual changelog is located at [`packages/reef-knot/CHANGELOG.md`](packages/reef-knot/CHANGELOG.md).
For the main package, see [`packages/reef-knot/CHANGELOG.md`](packages/reef-knot/CHANGELOG.md).

The UI packages, wallet adapters, Ledger connector and shared helpers have their own `CHANGELOG.md` files.
52 changes: 32 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Web3 Wallets Connection Library
## Documentation

- [How to add a wallet](docs/how-to-add-a-wallet.md)
- [Migration guide](docs/migration-guide.md)
- [Migration guide: 0.x → latest](docs/migration-guide-0.x-to-latest.md)
- [Migration guide: 8.x → 9](docs/migration-guide-8.x-to-9.md)

---

Expand All @@ -20,13 +21,13 @@ Web3 Wallets Connection Library
#### Using NPM

```bash
npm install reef-knot
npm install reef-knot @reef-knot/ui-lido-legacy
```

#### Using Yarn

```bash
yarn add reef-knot
yarn add reef-knot @reef-knot/ui-lido-legacy
```

### Wagmi and Viem
Expand All @@ -42,12 +43,13 @@ For an example of Reef Knot setup and configuration, check out [this demo app](h
To set up Reef Knot, you’ll need the following imports:

```typescript
import { ReefKnotProvider, getDefaultConfig } from 'reef-knot/core-react';
import {
ReefKnotWalletsModal,
ReefKnotProvider,
WalletsListEthereum,
getDefaultConfig,
getDefaultWalletsModalConfig,
} from 'reef-knot/connect-wallet-modal';
import { WalletsListEthereum } from 'reef-knot/wallets';
} from 'reef-knot';
import { ReefKnotWalletsModal } from '@reef-knot/ui-lido-legacy';
```

### Setting Up Providers
Expand Down Expand Up @@ -81,7 +83,7 @@ The `getDefaultWalletsModalConfig` function provides default configuration optio
- The wallets to display or pin
- Links to the terms of service and privacy policy

For more details, refer to the `connect-wallet-modal` package's [README](packages/connect-wallet-modal/README.md)
Providers, headless hooks, configuration types and the default wallet list are exported from `reef-knot`. UI components are exported from `@reef-knot/ui-lido-legacy` or `@reef-knot/ui-lido`. See [headless UI and migration](docs/headless-ui.md).

### WalletsListEthereum

Expand All @@ -105,29 +107,29 @@ The `walletsShown` prop is an array of wallet IDs. Simply remove the desired wal

#### Dark Theme

To enable a dark theme for the Wallet Connection Modal, use the `darkThemeEnabled` prop on the `<ReefKnotWalletsModal>` component.
The legacy UI skin accepts `darkThemeEnabled`. The Lido App UI skin accepts `theme="light"` or `theme="dark"`.

### Triggering the Wallet Connection Modal
### Starting the Wallet Connection Flow

To open the Wallet Connection Modal, use the `useConnect` hook provided by Reef Knot.
To start eager connection or open the wallet picker, use the `useConnectionFlow` hook provided by Reef Knot.

#### Import the Hook

```typescript
import { useConnect } from 'reef-knot/core-react';
import { useConnectionFlow } from 'reef-knot';
```

#### Use the Hook

Call the `useConnect` hook to get the `connect` callback:
Call the `useConnectionFlow` hook to get the `startConnection` callback:

```typescript
const { connect } = useConnect();
const { startConnection } = useConnectionFlow();
```

#### How `connect` Works
#### How `startConnection` Works

The `connect` callback determines the current environment (e.g., desktop browser, mobile wallet app, iframe) and behaves accordingly:
The `startConnection` callback determines the current environment (e.g., desktop browser, mobile wallet app, iframe) and behaves accordingly:

- If the dApp is opened inside a wallet's dApp browser, it attempts an automatic connection with this specific wallet.
- Otherwise, it opens the Wallet Connection Modal for manual wallet selection.
Expand Down Expand Up @@ -169,16 +171,26 @@ It is a known issue, and we are working on removing the need for such wrapping.

### Initial setup

Install the dependencies, build everything:
Use Node.js 24.11 or later within the 24.x line (or Node.js 26+) and the pinned Yarn 4.17.1 through Corepack. Install the dependencies and build everything:

```bash
yarn install --immutable && yarn build
```
yarn install & yarn build
```

### TypeScript and bundling

Packages and the separate `playwright-tests/` project use the native TypeScript 7.0.2 compiler (`tsc`). The `@typescript/native` dependency aliases the stable `typescript` package. The `typescript` dependency aliases `@typescript/typescript6`, preserving the TypeScript 6 JS Compiler API for ESLint and Next.js and providing `tsc6` without a binary-name collision.

The Next.js 12 demo uses `tsc6` for its CLI check and TypeScript 6 for `next build`. Its `ignoreDeprecations: "6.0"` is local: Next.js 12 requires legacy module resolution, and the demo still uses `baseUrl` imports. Packages use `bundler` resolution; Playwright uses `NodeNext` with its existing CommonJS package scope. `types: ["*"]` preserves the global types loaded before TypeScript 6 changed the default.

tsdown 0.23.1 builds ES2020 ESM with external dependencies and unbundled output. Its built-in `tsgo` generator emits declarations and declaration maps through native TypeScript 7. The compiler path is resolved explicitly from `@typescript/native` because `typescript` supplies the TS 6 API. Declaration-generation failures fail the build; `yarn typecheck` remains the type-error gate. Legacy UI checks map `@lidofinance/lido-ui` to its existing declarations because that dependency's exports omit its types. tslib remains at 2.8.1.

Validation covered a clean build of all 18 packages, package type/lint/test gates, UI/configuration type checks, the Next.js demo build, watch rebuilding, and Playwright type/lint/test discovery (28 tests; no transactions executed). All 18 declaration entrypoints compile with TypeScript 5.9.3 using both `node10` and `bundler` resolution; the latter needs the same legacy Lido UI type mapping. Declaration maps, default exports, SVG output and UI CSS/assets were checked. The built-in generator preserves public entrypoint exports and default exports. Re-export-only declaration files do not require maps; concrete declarations retain source maps. OKX uses an explicit `rootDir: "src"` to preserve its declaration entrypoint. This development-tool upgrade does not raise the consumer TypeScript minimum (5.9.3).

### Commands

- `yarn dev` runs the `dev` script for all apps and packages.
Usually apps are launched using `next dev` and packages are built using rollup with `--watch` flag, which rebuilds the bundle when its source files change on disk.
Usually apps are launched using `next dev` and packages are built using tsdown with `--watch`, which rebuilds the bundle when its source files change on disk.
- `yarn build` - Build all apps and packages.
- `yarn build-apps` - Build apps only.
- `yarn build-packages` - Build packages only.
Expand Down
3 changes: 1 addition & 2 deletions apps/demo-react/.env.example
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Public rpc urls
RPC_PROVIDER_URL_1=https://rpc.ankr.com/eth
RPC_PROVIDER_URL_17000=https://1rpc.io/holesky
RPC_PROVIDER_URL_560048=

# supported networks for connecting wallet
SUPPORTED_CHAINS=1,17000,560048
SUPPORTED_CHAINS=1,560048

# this chain uses when a wallet is not connected
DEFAULT_CHAIN=560048
Expand Down
17 changes: 0 additions & 17 deletions apps/demo-react/.eslintignore

This file was deleted.

24 changes: 0 additions & 24 deletions apps/demo-react/.eslintrc.cjs

This file was deleted.

7 changes: 6 additions & 1 deletion apps/demo-react/components/action-item/action-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ export const ActionItem: FC<PropsWithChildren<ActionItemProps>> = (props) => {

return (
<WrapperStyle>
<ActionStyle title={title} walletAction action={action} data-testid={title+'Block'}>
<ActionStyle
title={title}
walletAction
action={action}
data-testid={title + 'Block'}
>
{children}
</ActionStyle>
</WrapperStyle>
Expand Down
21 changes: 13 additions & 8 deletions apps/demo-react/components/action/action.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { Button } from '@lidofinance/lido-ui';
import { PropsWithChildren, useReducer } from 'react';
import { type SDKError } from '@lidofinance/lido-ethereum-sdk';

import { useWeb3 } from 'reef-knot/web3-react';
import { useConnection } from 'wagmi';
import { useSupportedChains } from 'hooks/useSupportedChains';
import { Accordion } from 'components';
import {
ActionBlock,
Expand Down Expand Up @@ -101,7 +102,8 @@ const defaultRenderError = (error: SDKError) => {
const defaultRenderResult = <TResult,>(result: TResult) => {
const stringfyed = JSON.stringify(
result,
(_, value) => (typeof value === 'bigint' ? value.toString() : value),
(_, value: unknown) =>
typeof value === 'bigint' ? value.toString() : value,
2,
);

Expand All @@ -114,7 +116,7 @@ const defaultRenderResult = <TResult,>(result: TResult) => {
theme="pop"
name={null}
displayDataTypes={false}
src={JSON.parse(stringfyed)}
src={JSON.parse(stringfyed) as object}
collapseStringsAfterLength={30}
/>
</Accordion>
Expand All @@ -130,7 +132,9 @@ export const Action = <TResult,>({
children,
...rest
}: ActionProps<TResult>) => {
const { active } = useWeb3();
const { isConnected } = useConnection();
const { isUnsupported } = useSupportedChains();
const active = isConnected && !isUnsupported;
const [{ result, error, loading }, dispatch] = useReducer(
reducer<TResult>,
{
Expand All @@ -144,10 +148,9 @@ export const Action = <TResult,>({
const startLoading = async () => {
try {
dispatch({ type: 'loading' });
const result = await action();
const actionResult = await action();

dispatch({ type: 'success', result });
// eslint-disable-next-line @typescript-eslint/no-shadow
dispatch({ type: 'success', result: actionResult });
} catch (error) {
console.error(error);
dispatch({ type: 'error', error: error as SDKError });
Expand All @@ -162,7 +165,9 @@ export const Action = <TResult,>({
<Button
disabled={walletAction && !active}
loading={loading}
onClick={startLoading}
onClick={() => {
void startLoading();
}}
fullwidth
>
{title}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ import React from 'react';
export class ErrorBoundary extends React.Component<{
children: React.ReactNode;
}> {
constructor(props: any) {
super(props);
}

componentDidCatch(error: any, info: any) {
componentDidCatch(error: Error, info: React.ErrorInfo) {
console.error(
'ErrorBoundary catched an error:',
error,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ export const HeaderWalletInfoButton = () => {
const { setIsWalletInfoIsOpen } = useClientConfig();

return (
<HeaderControlButton onClick={() => setIsWalletInfoIsOpen(true)} data-testid='walletInfoBtn'>
<HeaderControlButton
onClick={() => setIsWalletInfoIsOpen(true)}
data-testid="walletInfoBtn"
>
<GearIcon />
</HeaderControlButton>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ButtonProps } from '@lidofinance/lido-ui';

import { useModal } from 'hooks/useModal';
import { MODAL } from 'providers';
import { useWeb3 } from 'reef-knot/web3-react';
import { useConnection } from 'wagmi';
import AddressBadge from 'components/layout/header/walletButton/addressBadge';

import {
Expand All @@ -14,7 +14,7 @@ import {
const WalletButton: FC<ButtonProps> = (props) => {
const { onClick, ...rest } = props;
const { openModal } = useModal(MODAL.wallet);
const { account } = useWeb3();
const { address } = useConnection();

return (
<WalletButtonStyle
Expand All @@ -26,7 +26,7 @@ const WalletButton: FC<ButtonProps> = (props) => {
{...rest}
>
<WalletButtonWrapperStyle>
<AddressBadge address={account} />
<AddressBadge address={address} />
</WalletButtonWrapperStyle>
</WalletButtonStyle>
);
Expand Down
Loading
Loading