@tuwaio/nova-connect 0.9.1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
  ## 🏛️ Core Capabilities
11
11
 
12
12
  - **Provider:** `NovaConnectProvider` renders the connect and connected modals and the error toasts of Satellite Connect, gives its UI state to the components through `useNovaConnect`, and merges the `labels` prop with the English defaults. The modals are rendered only when `appChains` or `solanaRPCUrls` is set; a wallet connects to the first EVM chain or the first Solana cluster of these lists.
13
- - **Components** (`/components`): `ConnectButton` opens the connect modal, or shows the active wallet (avatar, name, balance and chain when `withBalance` and `withChain` are set) and opens the connected modal. The modal screens (wallet list grouped into installed, popular and custom groups, network selection, connecting state, "about wallets", "get a wallet", address impersonation when `withImpersonated` is set, legal disclaimer) and their parts are exported too. Most components take a `customization` prop with class name functions, handlers and replacement components for their parts.
13
+ - **Components** (`/components`): `ConnectButton` opens the connect modal, or shows the active wallet (avatar, name, balance and chain when `withBalance` and `withChain` are set) and opens the connected modal. The modal screens (wallet list grouped into installed, popular and custom groups, network selection, connecting state, "about wallets", "get a wallet", address impersonation when `withImpersonated` is set, legal disclaimer, and the "Remember this wallet" checkbox `RememberWallet`) and their parts are exported too. Most components take a `customization` prop with class name functions, handlers and replacement components for their parts.
14
14
  - **Chains:** EVM and Solana wallets are listed from the Satellite adapters of the store. The chain selector lists `appChains` for EVM wallets and the clusters of `solanaRPCUrls` for Solana wallets, and switches the network through the store. The root entry point imports no EVM or Solana package: importing `/evm` or `/solana` registers the chain helpers of that network and types `appChains` (viem chains) or `solanaRPCUrls` (cluster monikers), so an app installs only the packages of the networks it uses.
15
15
  - **Transactions:** with the `transactionPool` and `pulsarAdapter` of a [Pulsar](https://pulsar.docs.tuwa.io) store, `NovaConnectProvider` shows the transaction history in the connected modal (rendered by `@tuwaio/nova-transactions`, loaded on demand). `ConnectButton` takes its own `transactionPool` prop to show the status of the latest transaction.
16
16
  - **SIWX:** with the `siwx` prop (a verifier, and optionally `getNonce`, `destroyer` and the message fields), the provider renders `NovaSiwxWatcher`, which asks the connected wallet to sign in with [`@tuwaio/siwx-react`](https://siwx.docs.tuwa.io/packages/siwx-react) once per address and disconnects the wallet when the sign-in is rejected or fails. When the wallet is disconnected, it clears the session and calls `destroyer`; after a page load it keeps the session restored by `@tuwaio/siwx-react` until Satellite Connect has finished reconnecting (`isAutoConnectFinished`). `useNovaSiwx` signs in and out on demand. Do not also pass `siwx` to the Satellite watchers: they would disconnect the wallet on an account change instead of asking the new account to sign in.
@@ -122,14 +122,14 @@ A full app with Nova Transactions, SIWX and a Pulsar store synced with a server
122
122
 
123
123
  ## 🗄️ Browser Storage
124
124
 
125
- Nova Connect reads and writes these `localStorage` keys through the helpers of `@tuwaio/orbit-core`:
125
+ Nova Connect reads and writes these keys through the helpers of `@tuwaio/orbit-core` (the recent list in `localStorage` and, for wallets that are not remembered, `sessionStorage`):
126
126
 
127
127
  | Key | Read or written by |
128
128
  | --------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
129
129
  | `orbit-core:recentlyConnectedConnectorsListHelpers` | Read by the connect modal and the connected modal to show recently used wallets; an entry is removed when the user removes the wallet from the recent list of the connected modal |
130
130
  | `satellite-connect:impersonatedAddress` | Written by the impersonation form before it connects the impersonated wallet |
131
131
 
132
- Satellite Connect writes the last connection and the recent wallets (see [`@tuwaio/satellite-core`](https://satellite.docs.tuwa.io/packages/satellite-core)), and `@tuwaio/siwx-react` keeps the SIWX session. Nova Connect saves no other state.
132
+ Satellite Connect writes the last connection and the recent wallets (see [`@tuwaio/satellite-core`](https://satellite.docs.tuwa.io/packages/satellite-core)), and `@tuwaio/siwx-react` keeps the SIWX session. Nova Connect saves no other state. The "Remember this wallet" checkbox of the connect modal sets `rememberWallet` of the Satellite Connect store: ticked, those keys are in `localStorage` until the wallet is disconnected; unticked, in `sessionStorage` until the tab closes. It starts as the `rememberWallet` prop of `SatelliteConnectProvider` (default `true`); hide it with `customization.childComponents.rememberWallet.hidden`.
133
133
 
134
134
  ---
135
135
 
@@ -1,6 +1,6 @@
1
1
  import * as React$1 from 'react';
2
2
  import React__default, { ComponentPropsWithoutRef, ComponentType, ReactNode } from 'react';
3
- import { N as NovaConnectLabels } from './types-CnOiSyvZ.js';
3
+ import { N as NovaConnectLabels } from './types-CgOZEEy1.cjs';
4
4
  import { Variants, Easing } from 'framer-motion';
5
5
  import { OrbitAdapter } from '@tuwaio/orbit-core';
6
6
  import { TransactionPool, Transaction, TxAdapter } from '@tuwaio/pulsar-core';
@@ -915,4 +915,5 @@ interface ConnectedModalTxHistoryProps extends Pick<NovaConnectProviderProps, 't
915
915
  */
916
916
  declare const ConnectedModalTxHistory: React__default.ForwardRefExoticComponent<ConnectedModalTxHistoryProps & React__default.RefAttributes<HTMLDivElement>>;
917
917
 
918
- export { type AllChainConfigs as A, type ButtonTxStatus as B, type ConnectContentType as C, ConnectedModalTxHistory as D, type ConnectedModalTxHistoryErrorContainerProps as E, type ConnectedModalTxHistoryLoadingContainerProps as F, type ConnectedModalTxHistoryNoWalletContainerProps as G, type ConnectedModalTxHistoryProps as H, type InitialChains as I, type ConnectedModalTxHistoryTransactionsHistoryWrapperProps as J, type LocalTransactionsHistoryCustomization as K, type LabelCategory as L, type LocalTxPagination as M, type NovaConnectProviderProps as N, type UseWalletNativeBalanceData as U, type WalletBalance as W, type ConnectedContentType as a, type NovaConnectProviderType as b, type LegalConfig as c, type NativeBalanceResult as d, type NovaConnectAppChains as e, type NovaConnectChainConfigTypes as f, NovaConnectLabelsContext as g, NovaConnectProviderContext as h, NovaConnectProviderError as i, type NovaConnectSolanaRPCUrls as j, NovaSiwxWatcher as k, type NovaSiwxWatcherProps as l, type UseWalletNativeBalanceState as m, createLabelsSubset as n, getLabelWithFallback as o, hasLabel as p, isDefaultLabels as q, useLabelsByCategory as r, useNovaConnect as s, useNovaConnectLabel as t, useHasNovaConnectContext as u, useNovaConnectLabels as v, useNovaConnectLabelsSubset as w, useNovaConnectOptional as x, useWalletNativeBalance as y, type ConnectedModalTxHistoryCustomization as z };
918
+ export { ConnectedModalTxHistory as D, NovaConnectLabelsContext as g, NovaConnectProviderContext as h, NovaConnectProviderError as i, NovaSiwxWatcher as k, createLabelsSubset as n, getLabelWithFallback as o, hasLabel as p, isDefaultLabels as q, useLabelsByCategory as r, useNovaConnect as s, useNovaConnectLabel as t, useHasNovaConnectContext as u, useNovaConnectLabels as v, useNovaConnectLabelsSubset as w, useNovaConnectOptional as x, useWalletNativeBalance as y };
919
+ export type { AllChainConfigs as A, ButtonTxStatus as B, ConnectContentType as C, ConnectedModalTxHistoryErrorContainerProps as E, ConnectedModalTxHistoryLoadingContainerProps as F, ConnectedModalTxHistoryNoWalletContainerProps as G, ConnectedModalTxHistoryProps as H, InitialChains as I, ConnectedModalTxHistoryTransactionsHistoryWrapperProps as J, LocalTransactionsHistoryCustomization as K, LabelCategory as L, LocalTxPagination as M, NovaConnectProviderProps as N, UseWalletNativeBalanceData as U, WalletBalance as W, ConnectedContentType as a, NovaConnectProviderType as b, LegalConfig as c, NativeBalanceResult as d, NovaConnectAppChains as e, NovaConnectChainConfigTypes as f, NovaConnectSolanaRPCUrls as j, NovaSiwxWatcherProps as l, UseWalletNativeBalanceState as m, ConnectedModalTxHistoryCustomization as z };
@@ -1,6 +1,6 @@
1
1
  import * as React$1 from 'react';
2
2
  import React__default, { ComponentPropsWithoutRef, ComponentType, ReactNode } from 'react';
3
- import { N as NovaConnectLabels } from './types-CnOiSyvZ.cjs';
3
+ import { N as NovaConnectLabels } from './types-CgOZEEy1.js';
4
4
  import { Variants, Easing } from 'framer-motion';
5
5
  import { OrbitAdapter } from '@tuwaio/orbit-core';
6
6
  import { TransactionPool, Transaction, TxAdapter } from '@tuwaio/pulsar-core';
@@ -915,4 +915,5 @@ interface ConnectedModalTxHistoryProps extends Pick<NovaConnectProviderProps, 't
915
915
  */
916
916
  declare const ConnectedModalTxHistory: React__default.ForwardRefExoticComponent<ConnectedModalTxHistoryProps & React__default.RefAttributes<HTMLDivElement>>;
917
917
 
918
- export { type AllChainConfigs as A, type ButtonTxStatus as B, type ConnectContentType as C, ConnectedModalTxHistory as D, type ConnectedModalTxHistoryErrorContainerProps as E, type ConnectedModalTxHistoryLoadingContainerProps as F, type ConnectedModalTxHistoryNoWalletContainerProps as G, type ConnectedModalTxHistoryProps as H, type InitialChains as I, type ConnectedModalTxHistoryTransactionsHistoryWrapperProps as J, type LocalTransactionsHistoryCustomization as K, type LabelCategory as L, type LocalTxPagination as M, type NovaConnectProviderProps as N, type UseWalletNativeBalanceData as U, type WalletBalance as W, type ConnectedContentType as a, type NovaConnectProviderType as b, type LegalConfig as c, type NativeBalanceResult as d, type NovaConnectAppChains as e, type NovaConnectChainConfigTypes as f, NovaConnectLabelsContext as g, NovaConnectProviderContext as h, NovaConnectProviderError as i, type NovaConnectSolanaRPCUrls as j, NovaSiwxWatcher as k, type NovaSiwxWatcherProps as l, type UseWalletNativeBalanceState as m, createLabelsSubset as n, getLabelWithFallback as o, hasLabel as p, isDefaultLabels as q, useLabelsByCategory as r, useNovaConnect as s, useNovaConnectLabel as t, useHasNovaConnectContext as u, useNovaConnectLabels as v, useNovaConnectLabelsSubset as w, useNovaConnectOptional as x, useWalletNativeBalance as y, type ConnectedModalTxHistoryCustomization as z };
918
+ export { ConnectedModalTxHistory as D, NovaConnectLabelsContext as g, NovaConnectProviderContext as h, NovaConnectProviderError as i, NovaSiwxWatcher as k, createLabelsSubset as n, getLabelWithFallback as o, hasLabel as p, isDefaultLabels as q, useLabelsByCategory as r, useNovaConnect as s, useNovaConnectLabel as t, useHasNovaConnectContext as u, useNovaConnectLabels as v, useNovaConnectLabelsSubset as w, useNovaConnectOptional as x, useWalletNativeBalance as y };
919
+ export type { AllChainConfigs as A, ButtonTxStatus as B, ConnectContentType as C, ConnectedModalTxHistoryErrorContainerProps as E, ConnectedModalTxHistoryLoadingContainerProps as F, ConnectedModalTxHistoryNoWalletContainerProps as G, ConnectedModalTxHistoryProps as H, InitialChains as I, ConnectedModalTxHistoryTransactionsHistoryWrapperProps as J, LocalTransactionsHistoryCustomization as K, LabelCategory as L, LocalTxPagination as M, NovaConnectProviderProps as N, UseWalletNativeBalanceData as U, WalletBalance as W, ConnectedContentType as a, NovaConnectProviderType as b, LegalConfig as c, NativeBalanceResult as d, NovaConnectAppChains as e, NovaConnectChainConfigTypes as f, NovaConnectSolanaRPCUrls as j, NovaSiwxWatcherProps as l, UseWalletNativeBalanceState as m, ConnectedModalTxHistoryCustomization as z };