onLifecycle
callback, renames the analytics event types, removes the /reown and /safe
subpath entry points, and drops connectButtonLabel. <DepositModal> and
<WithdrawModal> share the same callback shape, but their lifecycle payloads
are not identical — see Asymmetries below.
Callback collapse — onLifecycle
Both modals replace their individual callbacks with oneonLifecycle that
receives a discriminated event. Switch on event.type; the payload fields keep
the same names as before.
DepositModal
Asymmetries
The two unions look alike but differ — don’t assume one helper typechecks against both.Analytics type rename
TheonEvent prop name is unchanged on both modals, but its parameter type was
renamed. The payload shape is unchanged.
Removed
-
connectButtonLabel— gone from both modals. The connect-step copy is controlled internally; delete any consumer-side label, there is no replacement. -
/reownand/safesubpath imports — they re-exported nothing that isn’t already on the root entry point.The./deposit,./withdraw,./constants, and./styles.csssubpaths remain for tree-shaking.
Additive — no action required
New in v0.3.0; existing code keeps working:appBalanceUsd?: numberon<DepositModal>— renders a “Balance after deposit” row (appBalanceUsd + amount) instead of fetching a portfolio balance.dappImports?: DappImportsConfigon<DepositModal>— pull balances from third-party apps. See import from other apps.defaultAmount: "max"— defaults the input to the user’s full source-token balance.- Solana destinations —
targetChain: Chain | number | "solana",targetToken: Address | string,recipient: Address | string. - New root exports —
DepositLifecycleEvent,WithdrawLifecycleEvent,DappImportsConfig,OutputTokenRule, plus the renamed analytics types.
Unchanged
onError, onReady, onRequestConnect, the onEvent prop name,
dappWalletClient / dappPublicClient / reownAppId, <WithdrawModal>’s
onSignTransaction, and the @rhinestone/deposit-modal/styles.css export all
keep their names and signatures.