@naculus/connect-appkit-react 0.3.0 → 0.5.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/dist/index.d.cts CHANGED
@@ -1,12 +1,12 @@
1
1
  import * as _naculus_connect_core from '@naculus/connect-core';
2
- import { UniversalWalletSession, SentDelegation, DelegationStatus, ExecutionPlan, AtomicityRequirement, BatchCall, SessionKeyManagerConfig, SessionKeyInfo, SessionKeyScope, SessionKeyTransaction, TokenConfig, NameResolverConfig, NameResult, InAppChannel, NotificationItem, NotificationSettings, PassphraseRequest, PassphraseGate, AddressResult, ExecutionStrategy, CallsStatus, Address as Address$1, Hex, Call, SendUserOpOptions, UserOperationResponse, UserOperationReceipt, ActiveSessionBundle, ChainSession, SmartAccountInfo, SolanaBalance, SolanaConfirmationStatus, SessionManager, TokenListSource, TokenListEntry, TokenSearchResult } from '@naculus/connect-core';
2
+ import { UniversalWalletSession, SessionStorage, SentDelegation, SolanaSessionKeyInfo, SolanaSessionKeyScope, DelegationStatus, ExecutionPlan, AtomicityRequirement, BatchCall, SessionKeyManagerConfig, SessionKeyInfo, SessionKeyScope, SessionKeyTransaction, TokenConfig, NameResolverConfig, NameResult, InAppChannel, NotificationItem, NotificationSettings, PassphraseRequest, PassphraseGate, AddressResult, ExecutionStrategy, CallsStatus, Address as Address$1, Hex, Call, SendUserOpOptions, UserOperationResponse, UserOperationReceipt, ActiveSessionBundle, ChainSession, SmartAccountInfo, SolanaBalance, SolanaConfirmationStatus, SessionManager, TokenListSource, TokenListEntry, TokenSearchResult } from '@naculus/connect-core';
3
3
  export { LAMPORTS_PER_SOL, PassphraseCancelledError, PassphraseGate, PassphraseIntent, PassphraseRequest, SolanaBalance, SolanaConfirmationStatus, SolanaRpcError, formatSol, getLatestBlockhash, getSignatureStatus, getSolanaBalance, parseSol } from '@naculus/connect-core';
4
4
  import { PocketConfig, WalletAccount, WalletNamespace, WalletData, StorageSecurityReport } from '@naculus/connector-embedded';
5
5
  export { StorageSecurityFinding, StorageSecurityReport, WalletAccount, WalletData, WalletNamespace } from '@naculus/connector-embedded';
6
6
  import * as _naculus_connect_appkit_core from '@naculus/connect-appkit-core';
7
- import { CompareCostsInput, CostComparison, CompareCosts, ExecuteRouteError, ExecuteRouteOptions, ExecutableQuote, ExecuteRouteResult, ExecuteRoute, RouteQuote, RouteQuoteOptions, RouteQuoteInput, GetRouteQuotes, Web3State, WalletChain, ChainCapabilities, AtomicSupport, ChainInfo, PolicyExecutionAdapter, DelegationPolicyPreview, PolicyExecutionSubmission, NotificationSettingsStorage, SolanaRoles, SolanaRolesAbsence, SolanaIdentity, SolanaSigner, SolanaPayer, AddressValidationLevel } from '@naculus/connect-appkit-core';
7
+ import { CompareCostsInput, CostComparison, CompareCosts, ExecuteRouteError, ExecuteRouteOptions, ExecutableQuote, ExecuteRouteResult, ExecuteRoute, RouteQuote, RouteQuoteOptions, RouteQuoteInput, GetRouteQuotes, Web3State, WalletChain, ChainCapabilities, AtomicSupport, ChainInfo, PaymentFetch, PaymentRecord, SolanaSessionKeyFlowDeps, PolicyExecutionAdapter, DelegationTypedData, DelegationPolicyPreview, PolicyExecutionSubmission, NotificationSettingsStorage, SolanaRoles, SolanaRolesAbsence, SolanaIdentity, SolanaSigner, SolanaPayer, AddressValidationLevel } from '@naculus/connect-appkit-core';
8
8
  export { AddressValidationLevel, AtomicSupport, ChainCapabilities, ChainInfo, ConnectionStatus, CostComparison, CostComparisonOperation, CostComparisonOptions, DelegationPolicyPreview, ExecuteRouteResult, PolicyExecutionAdapter, PolicyExecutionCheck, PolicyExecutionRoute, PolicyExecutionSubmission, PreparedPolicyExecution, SolanaIdentity, SolanaPayer, SolanaRoles, SolanaRolesAbsence, SolanaSigner, SolanaWalletFeatures, WalletChain, Web3State, buildDelegationPolicyMessage } from '@naculus/connect-appkit-core';
9
- import { Web3Client } from './client.cjs';
9
+ import { NativeWalletConnectOptions, InjectedProviderRegistration, Web3Client } from './client.cjs';
10
10
  export { ClientConfig, clearClient, createClient, getClient } from './client.cjs';
11
11
  import { Address, PublicClient, WalletClient } from 'viem';
12
12
  import { SimulationResult } from '@naculus/wallet-engine';
@@ -193,6 +193,17 @@ interface Web3ConnectConfig {
193
193
  * When omitted, existing backward-compatible plaintext storage is used.
194
194
  */
195
195
  encryptionKey?: string;
196
+ /**
197
+ * Where the connected session persists. Defaults to localStorage; React
198
+ * Native supplies an AsyncStorage-backed one (`@naculus/connect-native`).
199
+ */
200
+ sessionStorage?: SessionStorage;
201
+ /** See `ClientConfig.walletConnect`. */
202
+ walletConnect?: NativeWalletConnectOptions;
203
+ /** See `ClientConfig.solanaWallets`. */
204
+ solanaWallets?: readonly unknown[];
205
+ /** See `ClientConfig.injectedProviders`. */
206
+ injectedProviders?: readonly InjectedProviderRegistration[];
196
207
  }
197
208
  interface Web3Actions {
198
209
  startPairing: () => Promise<string>;
@@ -342,6 +353,53 @@ interface UseDelegateReturn {
342
353
  */
343
354
  declare function useDelegate(options: UseDelegateOptions): UseDelegateReturn;
344
355
 
356
+ interface UsePaymentFetchReturn {
357
+ /** Fetch through the paying fetch; resolves to its full result. */
358
+ payFetch: PaymentFetch;
359
+ /** True while any request is in flight. */
360
+ isPending: boolean;
361
+ /**
362
+ * The most recently completed payment. Every paid request is recorded, in
363
+ * completion order, until `reset()`.
364
+ */
365
+ lastPayment: PaymentRecord | null;
366
+ error: Error | null;
367
+ reset: () => void;
368
+ }
369
+ /**
370
+ * State around a caller-owned paying fetch — `createX402Fetch`
371
+ * (`@naculus/payments-x402`) or `createMppFetch` (`@naculus/payments-mpp`),
372
+ * built with the session key and limits the app chooses. What may be paid is
373
+ * decided there and by the session key's policy, not here.
374
+ */
375
+ declare function usePaymentFetch(pay: PaymentFetch): UsePaymentFetchReturn;
376
+
377
+ interface UseSolanaSessionKeyReturn {
378
+ /** The connected owner's keys, newest first. */
379
+ keys: SolanaSessionKeyInfo[];
380
+ /** Create a key; the owner's wallet approves it once. */
381
+ create: (scope: SolanaSessionKeyScope) => Promise<{
382
+ key: SolanaSessionKeyInfo;
383
+ signature: string;
384
+ }>;
385
+ /** Stop a key; the owner's wallet signs the on-chain Revoke. */
386
+ revoke: (id: string) => Promise<{
387
+ signature: string;
388
+ }>;
389
+ refresh: () => Promise<void>;
390
+ isPending: boolean;
391
+ error: Error | null;
392
+ }
393
+ /**
394
+ * Solana session keys that pay x402 / MPP without a prompt (pass
395
+ * `{ sessionKey: { manager, id }, rpc }` to the paying fetch). The app owns
396
+ * the `SolanaSessionKeyManager` and the RPC; `owner` is the connected
397
+ * wallet's Solana signer role. Keep `manager`, `rpc` and `owner` stable
398
+ * (module scope or `useMemo`): a new object each render rebuilds the flow
399
+ * and refetches the keys every render.
400
+ */
401
+ declare function useSolanaSessionKey(deps: SolanaSessionKeyFlowDeps | null): UseSolanaSessionKeyReturn;
402
+
345
403
  interface UseDelegationReturn extends DelegationStatus {
346
404
  isFetching: boolean;
347
405
  error: Error | null;
@@ -436,6 +494,14 @@ interface UseDelegationPolicyOptions {
436
494
  origin?: string;
437
495
  /** Concrete AA-module or EIP-7702 executor for promptless submissions. */
438
496
  adapter?: PolicyExecutionAdapter;
497
+ /**
498
+ * For `eip7702` policies: the wallet's EIP-712 signer. `message.salt` is a
499
+ * decimal string (JSON-safe, as `eth_signTypedData_v4` takes it); for viem's
500
+ * `signTypedData`, pass `{ ...t, message: { ...t.message, salt: BigInt(t.message.salt) } }`.
501
+ */
502
+ signTypedData?: (typedData: DelegationTypedData) => Promise<string>;
503
+ /** For `eip7702` policies: the connected EVM chain number. */
504
+ chainId?: number | null;
439
505
  }
440
506
  interface UseDelegationPolicyReturn {
441
507
  policies: SessionKeyInfo[];
@@ -2047,4 +2113,4 @@ declare const AppkitToggleGroup: StencilReactComponent<AppkitToggleGroup$1, Appk
2047
2113
  type AppkitTooltipEvents = NonNullable<unknown>;
2048
2114
  declare const AppkitTooltip: StencilReactComponent<AppkitTooltip$1, AppkitTooltipEvents, Components.AppkitTooltip>;
2049
2115
 
2050
- export { type AddressValidationResult, AppkitAccordion, type AppkitAccordionEvents, AppkitAccountButton, type AppkitAccountButtonEvents, AppkitAlertDialog, type AppkitAlertDialogEvents, AppkitAvatar, type AppkitAvatarEvents, AppkitBadge, type AppkitBadgeEvents, AppkitButton, type AppkitButtonEvents, AppkitCard, AppkitCardContent, type AppkitCardContentEvents, AppkitCardDescription, type AppkitCardDescriptionEvents, type AppkitCardEvents, AppkitCardFooter, type AppkitCardFooterEvents, AppkitCardHeader, type AppkitCardHeaderEvents, AppkitCardTitle, type AppkitCardTitleEvents, AppkitCheckbox, type AppkitCheckboxEvents, AppkitCollapsible, type AppkitCollapsibleEvents, AppkitConnectButton, type AppkitConnectButtonEvents, AppkitDialog, type AppkitDialogEvents, AppkitDropdownMenu, type AppkitDropdownMenuEvents, AppkitInput, type AppkitInputEvents, AppkitPopover, type AppkitPopoverEvents, AppkitProgress, type AppkitProgressEvents, AppkitScrollArea, type AppkitScrollAreaEvents, AppkitSelect, type AppkitSelectEvents, AppkitSeparator, type AppkitSeparatorEvents, AppkitSkeleton, type AppkitSkeletonEvents, AppkitSwitch, type AppkitSwitchEvents, AppkitTabs, type AppkitTabsEvents, AppkitToggleGroup, type AppkitToggleGroupEvents, AppkitTooltip, type AppkitTooltipEvents, DEFAULT_EVM_CHAINS, type EmbeddedWalletAccountView, type EmbeddedWalletView, type EvmTransaction, type ExecuteError, type ExecuteOptions, type ExecutionPreview, type ExecutionRoute, type Locale, type Quote, type QuoteOptions, type SIWxConfig, type SendCallsStatus, type TokenBalanceResult, type TokenInfo, TokenSelector, type TokenSelectorProps, TxMonitorContext, type TxMonitorLike, type TxStatus, type TxStatusEntry, type UseCapabilitiesReturn, type UseCompareCostsInput, type UseCompareCostsReturn, type UseCreateSessionKeyReturn, type UseDelegateOptions, type UseDelegateReturn, type UseDelegationPolicyOptions, type UseDelegationPolicyReturn, type UseDelegationReturn, type UseERC20AllowanceOptions, type UseERC20AllowanceReturn, type UseERC20ApproveOptions, type UseERC20ApproveReturn, type UseERC20TransferOptions, type UseERC20TransferReturn, type UseERC20TransferSimulationOptions, type UseERC20TransferSimulationReturn, type UseEmbeddedWalletReturn, type UseExecuteCallsOptions, type UseExecuteCallsReturn, type UseExecuteRouteReturn, type UseLastTxResult, type UseLookupAddressOptions, type UseLookupAddressResult, type UsePassphraseGateReturn, type UseResolveNameOptions, type UseResolveNameResult, type UseRevokeSessionReturn, type UseRouteQuoteInput, type UseRouteQuoteReturn, type UseSIWxLoginOptions, type UseSIWxLoginReturn, type UseSIWxSessionOptions, type UseSIWxSessionReturn, type UseSendUserOperationOptions, type UseSendUserOperationReturn, type UseSendWithSessionReturn, type UseSessionKeysReturn, type UseSessionReturn, type UseSignInWithEthereumOptions, type UseSignInWithEthereumReturn, type UseSignInWithXOptions, type UseSignInWithXReturn, type UseSimulateTransferOptions, type UseSimulateTransferReturn, type UseSiwxAuthSessionOptions, type UseSiwxAuthSessionReturn, type UseSmartAccountOptions, type UseSmartAccountReturn, type UseSolanaAccountReturn, type UseSolanaBalanceOptions, type UseSolanaBalanceReturn, type UseSolanaRolesReturn, type UseSolanaTransactionReturn, type UseSwitchChainReturn, type UseTokenBalanceOptions, type UseTokenListOptions, type UseTokenListReturn, type UseTokenSearchReturn, type UseTransactionSimulationReturn, type UseTxHistoryResult, type UseTxMonitorResult, type UseUserOpStatusOptions, type UseUserOpStatusReturn, type UseValidateDestinationOptions, type UseValidateDestinationReturn, type UseWalletReturn, type UseWeb3ErrorHandlerReturn, type UserFriendlyError, type UserOpStatus, WALLET_ERROR_DESCRIPTIONS, WALLET_ERROR_TITLES, type Web3Actions, Web3Client, type Web3ConnectConfig, Web3ConnectProvider, type Web3ConnectProviderProps, Web3Context, getChainById, getDefaultChains, getLocale, getUserFriendlyError, isRetryableError, resetSessionKeyManager, setLocale, t, useAccount, useBalance, useCapabilities, useChain, useCompareCosts, useConnect, useCreateSessionKey, useDelegate, useDelegation, useDelegationPolicy, useDisconnect, useERC20Allowance, useERC20Approve, useERC20Transfer, useERC20TransferSimulation, useEmbeddedWallet, useExecuteCalls, useExecuteRoute, useLastTx, useLookupAddress, useNotification, usePassphraseGate, useResolveName, useRevokeSession, useRouteQuote, useSIWxLogin, useSIWxSession, useSendCalls, useSendTransaction, useSendUserOperation, useSendWithSession, useSession, useSessionKeys, useSignInWithEthereum, useSignInWithX, useSignMessage, useSimulateTransfer, useSiwxAuthSession, useSmartAccount, useSolanaAccount, useSolanaBalance, useSolanaRoles, useSolanaTransaction, useSwitchChain, useTokenBalance, useTokenList, useTokenSearch, useTransactionSimulation, useTxHistory, useTxMonitor, useUserOpStatus, useValidateDestination, useViemClient, useWallet, useWeb3, useWeb3ErrorHandler, validateDestination };
2116
+ export { type AddressValidationResult, AppkitAccordion, type AppkitAccordionEvents, AppkitAccountButton, type AppkitAccountButtonEvents, AppkitAlertDialog, type AppkitAlertDialogEvents, AppkitAvatar, type AppkitAvatarEvents, AppkitBadge, type AppkitBadgeEvents, AppkitButton, type AppkitButtonEvents, AppkitCard, AppkitCardContent, type AppkitCardContentEvents, AppkitCardDescription, type AppkitCardDescriptionEvents, type AppkitCardEvents, AppkitCardFooter, type AppkitCardFooterEvents, AppkitCardHeader, type AppkitCardHeaderEvents, AppkitCardTitle, type AppkitCardTitleEvents, AppkitCheckbox, type AppkitCheckboxEvents, AppkitCollapsible, type AppkitCollapsibleEvents, AppkitConnectButton, type AppkitConnectButtonEvents, AppkitDialog, type AppkitDialogEvents, AppkitDropdownMenu, type AppkitDropdownMenuEvents, AppkitInput, type AppkitInputEvents, AppkitPopover, type AppkitPopoverEvents, AppkitProgress, type AppkitProgressEvents, AppkitScrollArea, type AppkitScrollAreaEvents, AppkitSelect, type AppkitSelectEvents, AppkitSeparator, type AppkitSeparatorEvents, AppkitSkeleton, type AppkitSkeletonEvents, AppkitSwitch, type AppkitSwitchEvents, AppkitTabs, type AppkitTabsEvents, AppkitToggleGroup, type AppkitToggleGroupEvents, AppkitTooltip, type AppkitTooltipEvents, DEFAULT_EVM_CHAINS, type EmbeddedWalletAccountView, type EmbeddedWalletView, type EvmTransaction, type ExecuteError, type ExecuteOptions, type ExecutionPreview, type ExecutionRoute, InjectedProviderRegistration, type Locale, NativeWalletConnectOptions, type Quote, type QuoteOptions, type SIWxConfig, type SendCallsStatus, type TokenBalanceResult, type TokenInfo, TokenSelector, type TokenSelectorProps, TxMonitorContext, type TxMonitorLike, type TxStatus, type TxStatusEntry, type UseCapabilitiesReturn, type UseCompareCostsInput, type UseCompareCostsReturn, type UseCreateSessionKeyReturn, type UseDelegateOptions, type UseDelegateReturn, type UseDelegationPolicyOptions, type UseDelegationPolicyReturn, type UseDelegationReturn, type UseERC20AllowanceOptions, type UseERC20AllowanceReturn, type UseERC20ApproveOptions, type UseERC20ApproveReturn, type UseERC20TransferOptions, type UseERC20TransferReturn, type UseERC20TransferSimulationOptions, type UseERC20TransferSimulationReturn, type UseEmbeddedWalletReturn, type UseExecuteCallsOptions, type UseExecuteCallsReturn, type UseExecuteRouteReturn, type UseLastTxResult, type UseLookupAddressOptions, type UseLookupAddressResult, type UsePassphraseGateReturn, type UsePaymentFetchReturn, type UseResolveNameOptions, type UseResolveNameResult, type UseRevokeSessionReturn, type UseRouteQuoteInput, type UseRouteQuoteReturn, type UseSIWxLoginOptions, type UseSIWxLoginReturn, type UseSIWxSessionOptions, type UseSIWxSessionReturn, type UseSendUserOperationOptions, type UseSendUserOperationReturn, type UseSendWithSessionReturn, type UseSessionKeysReturn, type UseSessionReturn, type UseSignInWithEthereumOptions, type UseSignInWithEthereumReturn, type UseSignInWithXOptions, type UseSignInWithXReturn, type UseSimulateTransferOptions, type UseSimulateTransferReturn, type UseSiwxAuthSessionOptions, type UseSiwxAuthSessionReturn, type UseSmartAccountOptions, type UseSmartAccountReturn, type UseSolanaAccountReturn, type UseSolanaBalanceOptions, type UseSolanaBalanceReturn, type UseSolanaRolesReturn, type UseSolanaSessionKeyReturn, type UseSolanaTransactionReturn, type UseSwitchChainReturn, type UseTokenBalanceOptions, type UseTokenListOptions, type UseTokenListReturn, type UseTokenSearchReturn, type UseTransactionSimulationReturn, type UseTxHistoryResult, type UseTxMonitorResult, type UseUserOpStatusOptions, type UseUserOpStatusReturn, type UseValidateDestinationOptions, type UseValidateDestinationReturn, type UseWalletReturn, type UseWeb3ErrorHandlerReturn, type UserFriendlyError, type UserOpStatus, WALLET_ERROR_DESCRIPTIONS, WALLET_ERROR_TITLES, type Web3Actions, Web3Client, type Web3ConnectConfig, Web3ConnectProvider, type Web3ConnectProviderProps, Web3Context, getChainById, getDefaultChains, getLocale, getUserFriendlyError, isRetryableError, resetSessionKeyManager, setLocale, t, useAccount, useBalance, useCapabilities, useChain, useCompareCosts, useConnect, useCreateSessionKey, useDelegate, useDelegation, useDelegationPolicy, useDisconnect, useERC20Allowance, useERC20Approve, useERC20Transfer, useERC20TransferSimulation, useEmbeddedWallet, useExecuteCalls, useExecuteRoute, useLastTx, useLookupAddress, useNotification, usePassphraseGate, usePaymentFetch, useResolveName, useRevokeSession, useRouteQuote, useSIWxLogin, useSIWxSession, useSendCalls, useSendTransaction, useSendUserOperation, useSendWithSession, useSession, useSessionKeys, useSignInWithEthereum, useSignInWithX, useSignMessage, useSimulateTransfer, useSiwxAuthSession, useSmartAccount, useSolanaAccount, useSolanaBalance, useSolanaRoles, useSolanaSessionKey, useSolanaTransaction, useSwitchChain, useTokenBalance, useTokenList, useTokenSearch, useTransactionSimulation, useTxHistory, useTxMonitor, useUserOpStatus, useValidateDestination, useViemClient, useWallet, useWeb3, useWeb3ErrorHandler, validateDestination };
package/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import * as _naculus_connect_core from '@naculus/connect-core';
2
- import { UniversalWalletSession, SentDelegation, DelegationStatus, ExecutionPlan, AtomicityRequirement, BatchCall, SessionKeyManagerConfig, SessionKeyInfo, SessionKeyScope, SessionKeyTransaction, TokenConfig, NameResolverConfig, NameResult, InAppChannel, NotificationItem, NotificationSettings, PassphraseRequest, PassphraseGate, AddressResult, ExecutionStrategy, CallsStatus, Address as Address$1, Hex, Call, SendUserOpOptions, UserOperationResponse, UserOperationReceipt, ActiveSessionBundle, ChainSession, SmartAccountInfo, SolanaBalance, SolanaConfirmationStatus, SessionManager, TokenListSource, TokenListEntry, TokenSearchResult } from '@naculus/connect-core';
2
+ import { UniversalWalletSession, SessionStorage, SentDelegation, SolanaSessionKeyInfo, SolanaSessionKeyScope, DelegationStatus, ExecutionPlan, AtomicityRequirement, BatchCall, SessionKeyManagerConfig, SessionKeyInfo, SessionKeyScope, SessionKeyTransaction, TokenConfig, NameResolverConfig, NameResult, InAppChannel, NotificationItem, NotificationSettings, PassphraseRequest, PassphraseGate, AddressResult, ExecutionStrategy, CallsStatus, Address as Address$1, Hex, Call, SendUserOpOptions, UserOperationResponse, UserOperationReceipt, ActiveSessionBundle, ChainSession, SmartAccountInfo, SolanaBalance, SolanaConfirmationStatus, SessionManager, TokenListSource, TokenListEntry, TokenSearchResult } from '@naculus/connect-core';
3
3
  export { LAMPORTS_PER_SOL, PassphraseCancelledError, PassphraseGate, PassphraseIntent, PassphraseRequest, SolanaBalance, SolanaConfirmationStatus, SolanaRpcError, formatSol, getLatestBlockhash, getSignatureStatus, getSolanaBalance, parseSol } from '@naculus/connect-core';
4
4
  import { PocketConfig, WalletAccount, WalletNamespace, WalletData, StorageSecurityReport } from '@naculus/connector-embedded';
5
5
  export { StorageSecurityFinding, StorageSecurityReport, WalletAccount, WalletData, WalletNamespace } from '@naculus/connector-embedded';
6
6
  import * as _naculus_connect_appkit_core from '@naculus/connect-appkit-core';
7
- import { CompareCostsInput, CostComparison, CompareCosts, ExecuteRouteError, ExecuteRouteOptions, ExecutableQuote, ExecuteRouteResult, ExecuteRoute, RouteQuote, RouteQuoteOptions, RouteQuoteInput, GetRouteQuotes, Web3State, WalletChain, ChainCapabilities, AtomicSupport, ChainInfo, PolicyExecutionAdapter, DelegationPolicyPreview, PolicyExecutionSubmission, NotificationSettingsStorage, SolanaRoles, SolanaRolesAbsence, SolanaIdentity, SolanaSigner, SolanaPayer, AddressValidationLevel } from '@naculus/connect-appkit-core';
7
+ import { CompareCostsInput, CostComparison, CompareCosts, ExecuteRouteError, ExecuteRouteOptions, ExecutableQuote, ExecuteRouteResult, ExecuteRoute, RouteQuote, RouteQuoteOptions, RouteQuoteInput, GetRouteQuotes, Web3State, WalletChain, ChainCapabilities, AtomicSupport, ChainInfo, PaymentFetch, PaymentRecord, SolanaSessionKeyFlowDeps, PolicyExecutionAdapter, DelegationTypedData, DelegationPolicyPreview, PolicyExecutionSubmission, NotificationSettingsStorage, SolanaRoles, SolanaRolesAbsence, SolanaIdentity, SolanaSigner, SolanaPayer, AddressValidationLevel } from '@naculus/connect-appkit-core';
8
8
  export { AddressValidationLevel, AtomicSupport, ChainCapabilities, ChainInfo, ConnectionStatus, CostComparison, CostComparisonOperation, CostComparisonOptions, DelegationPolicyPreview, ExecuteRouteResult, PolicyExecutionAdapter, PolicyExecutionCheck, PolicyExecutionRoute, PolicyExecutionSubmission, PreparedPolicyExecution, SolanaIdentity, SolanaPayer, SolanaRoles, SolanaRolesAbsence, SolanaSigner, SolanaWalletFeatures, WalletChain, Web3State, buildDelegationPolicyMessage } from '@naculus/connect-appkit-core';
9
- import { Web3Client } from './client.js';
9
+ import { NativeWalletConnectOptions, InjectedProviderRegistration, Web3Client } from './client.js';
10
10
  export { ClientConfig, clearClient, createClient, getClient } from './client.js';
11
11
  import { Address, PublicClient, WalletClient } from 'viem';
12
12
  import { SimulationResult } from '@naculus/wallet-engine';
@@ -193,6 +193,17 @@ interface Web3ConnectConfig {
193
193
  * When omitted, existing backward-compatible plaintext storage is used.
194
194
  */
195
195
  encryptionKey?: string;
196
+ /**
197
+ * Where the connected session persists. Defaults to localStorage; React
198
+ * Native supplies an AsyncStorage-backed one (`@naculus/connect-native`).
199
+ */
200
+ sessionStorage?: SessionStorage;
201
+ /** See `ClientConfig.walletConnect`. */
202
+ walletConnect?: NativeWalletConnectOptions;
203
+ /** See `ClientConfig.solanaWallets`. */
204
+ solanaWallets?: readonly unknown[];
205
+ /** See `ClientConfig.injectedProviders`. */
206
+ injectedProviders?: readonly InjectedProviderRegistration[];
196
207
  }
197
208
  interface Web3Actions {
198
209
  startPairing: () => Promise<string>;
@@ -342,6 +353,53 @@ interface UseDelegateReturn {
342
353
  */
343
354
  declare function useDelegate(options: UseDelegateOptions): UseDelegateReturn;
344
355
 
356
+ interface UsePaymentFetchReturn {
357
+ /** Fetch through the paying fetch; resolves to its full result. */
358
+ payFetch: PaymentFetch;
359
+ /** True while any request is in flight. */
360
+ isPending: boolean;
361
+ /**
362
+ * The most recently completed payment. Every paid request is recorded, in
363
+ * completion order, until `reset()`.
364
+ */
365
+ lastPayment: PaymentRecord | null;
366
+ error: Error | null;
367
+ reset: () => void;
368
+ }
369
+ /**
370
+ * State around a caller-owned paying fetch — `createX402Fetch`
371
+ * (`@naculus/payments-x402`) or `createMppFetch` (`@naculus/payments-mpp`),
372
+ * built with the session key and limits the app chooses. What may be paid is
373
+ * decided there and by the session key's policy, not here.
374
+ */
375
+ declare function usePaymentFetch(pay: PaymentFetch): UsePaymentFetchReturn;
376
+
377
+ interface UseSolanaSessionKeyReturn {
378
+ /** The connected owner's keys, newest first. */
379
+ keys: SolanaSessionKeyInfo[];
380
+ /** Create a key; the owner's wallet approves it once. */
381
+ create: (scope: SolanaSessionKeyScope) => Promise<{
382
+ key: SolanaSessionKeyInfo;
383
+ signature: string;
384
+ }>;
385
+ /** Stop a key; the owner's wallet signs the on-chain Revoke. */
386
+ revoke: (id: string) => Promise<{
387
+ signature: string;
388
+ }>;
389
+ refresh: () => Promise<void>;
390
+ isPending: boolean;
391
+ error: Error | null;
392
+ }
393
+ /**
394
+ * Solana session keys that pay x402 / MPP without a prompt (pass
395
+ * `{ sessionKey: { manager, id }, rpc }` to the paying fetch). The app owns
396
+ * the `SolanaSessionKeyManager` and the RPC; `owner` is the connected
397
+ * wallet's Solana signer role. Keep `manager`, `rpc` and `owner` stable
398
+ * (module scope or `useMemo`): a new object each render rebuilds the flow
399
+ * and refetches the keys every render.
400
+ */
401
+ declare function useSolanaSessionKey(deps: SolanaSessionKeyFlowDeps | null): UseSolanaSessionKeyReturn;
402
+
345
403
  interface UseDelegationReturn extends DelegationStatus {
346
404
  isFetching: boolean;
347
405
  error: Error | null;
@@ -436,6 +494,14 @@ interface UseDelegationPolicyOptions {
436
494
  origin?: string;
437
495
  /** Concrete AA-module or EIP-7702 executor for promptless submissions. */
438
496
  adapter?: PolicyExecutionAdapter;
497
+ /**
498
+ * For `eip7702` policies: the wallet's EIP-712 signer. `message.salt` is a
499
+ * decimal string (JSON-safe, as `eth_signTypedData_v4` takes it); for viem's
500
+ * `signTypedData`, pass `{ ...t, message: { ...t.message, salt: BigInt(t.message.salt) } }`.
501
+ */
502
+ signTypedData?: (typedData: DelegationTypedData) => Promise<string>;
503
+ /** For `eip7702` policies: the connected EVM chain number. */
504
+ chainId?: number | null;
439
505
  }
440
506
  interface UseDelegationPolicyReturn {
441
507
  policies: SessionKeyInfo[];
@@ -2047,4 +2113,4 @@ declare const AppkitToggleGroup: StencilReactComponent<AppkitToggleGroup$1, Appk
2047
2113
  type AppkitTooltipEvents = NonNullable<unknown>;
2048
2114
  declare const AppkitTooltip: StencilReactComponent<AppkitTooltip$1, AppkitTooltipEvents, Components.AppkitTooltip>;
2049
2115
 
2050
- export { type AddressValidationResult, AppkitAccordion, type AppkitAccordionEvents, AppkitAccountButton, type AppkitAccountButtonEvents, AppkitAlertDialog, type AppkitAlertDialogEvents, AppkitAvatar, type AppkitAvatarEvents, AppkitBadge, type AppkitBadgeEvents, AppkitButton, type AppkitButtonEvents, AppkitCard, AppkitCardContent, type AppkitCardContentEvents, AppkitCardDescription, type AppkitCardDescriptionEvents, type AppkitCardEvents, AppkitCardFooter, type AppkitCardFooterEvents, AppkitCardHeader, type AppkitCardHeaderEvents, AppkitCardTitle, type AppkitCardTitleEvents, AppkitCheckbox, type AppkitCheckboxEvents, AppkitCollapsible, type AppkitCollapsibleEvents, AppkitConnectButton, type AppkitConnectButtonEvents, AppkitDialog, type AppkitDialogEvents, AppkitDropdownMenu, type AppkitDropdownMenuEvents, AppkitInput, type AppkitInputEvents, AppkitPopover, type AppkitPopoverEvents, AppkitProgress, type AppkitProgressEvents, AppkitScrollArea, type AppkitScrollAreaEvents, AppkitSelect, type AppkitSelectEvents, AppkitSeparator, type AppkitSeparatorEvents, AppkitSkeleton, type AppkitSkeletonEvents, AppkitSwitch, type AppkitSwitchEvents, AppkitTabs, type AppkitTabsEvents, AppkitToggleGroup, type AppkitToggleGroupEvents, AppkitTooltip, type AppkitTooltipEvents, DEFAULT_EVM_CHAINS, type EmbeddedWalletAccountView, type EmbeddedWalletView, type EvmTransaction, type ExecuteError, type ExecuteOptions, type ExecutionPreview, type ExecutionRoute, type Locale, type Quote, type QuoteOptions, type SIWxConfig, type SendCallsStatus, type TokenBalanceResult, type TokenInfo, TokenSelector, type TokenSelectorProps, TxMonitorContext, type TxMonitorLike, type TxStatus, type TxStatusEntry, type UseCapabilitiesReturn, type UseCompareCostsInput, type UseCompareCostsReturn, type UseCreateSessionKeyReturn, type UseDelegateOptions, type UseDelegateReturn, type UseDelegationPolicyOptions, type UseDelegationPolicyReturn, type UseDelegationReturn, type UseERC20AllowanceOptions, type UseERC20AllowanceReturn, type UseERC20ApproveOptions, type UseERC20ApproveReturn, type UseERC20TransferOptions, type UseERC20TransferReturn, type UseERC20TransferSimulationOptions, type UseERC20TransferSimulationReturn, type UseEmbeddedWalletReturn, type UseExecuteCallsOptions, type UseExecuteCallsReturn, type UseExecuteRouteReturn, type UseLastTxResult, type UseLookupAddressOptions, type UseLookupAddressResult, type UsePassphraseGateReturn, type UseResolveNameOptions, type UseResolveNameResult, type UseRevokeSessionReturn, type UseRouteQuoteInput, type UseRouteQuoteReturn, type UseSIWxLoginOptions, type UseSIWxLoginReturn, type UseSIWxSessionOptions, type UseSIWxSessionReturn, type UseSendUserOperationOptions, type UseSendUserOperationReturn, type UseSendWithSessionReturn, type UseSessionKeysReturn, type UseSessionReturn, type UseSignInWithEthereumOptions, type UseSignInWithEthereumReturn, type UseSignInWithXOptions, type UseSignInWithXReturn, type UseSimulateTransferOptions, type UseSimulateTransferReturn, type UseSiwxAuthSessionOptions, type UseSiwxAuthSessionReturn, type UseSmartAccountOptions, type UseSmartAccountReturn, type UseSolanaAccountReturn, type UseSolanaBalanceOptions, type UseSolanaBalanceReturn, type UseSolanaRolesReturn, type UseSolanaTransactionReturn, type UseSwitchChainReturn, type UseTokenBalanceOptions, type UseTokenListOptions, type UseTokenListReturn, type UseTokenSearchReturn, type UseTransactionSimulationReturn, type UseTxHistoryResult, type UseTxMonitorResult, type UseUserOpStatusOptions, type UseUserOpStatusReturn, type UseValidateDestinationOptions, type UseValidateDestinationReturn, type UseWalletReturn, type UseWeb3ErrorHandlerReturn, type UserFriendlyError, type UserOpStatus, WALLET_ERROR_DESCRIPTIONS, WALLET_ERROR_TITLES, type Web3Actions, Web3Client, type Web3ConnectConfig, Web3ConnectProvider, type Web3ConnectProviderProps, Web3Context, getChainById, getDefaultChains, getLocale, getUserFriendlyError, isRetryableError, resetSessionKeyManager, setLocale, t, useAccount, useBalance, useCapabilities, useChain, useCompareCosts, useConnect, useCreateSessionKey, useDelegate, useDelegation, useDelegationPolicy, useDisconnect, useERC20Allowance, useERC20Approve, useERC20Transfer, useERC20TransferSimulation, useEmbeddedWallet, useExecuteCalls, useExecuteRoute, useLastTx, useLookupAddress, useNotification, usePassphraseGate, useResolveName, useRevokeSession, useRouteQuote, useSIWxLogin, useSIWxSession, useSendCalls, useSendTransaction, useSendUserOperation, useSendWithSession, useSession, useSessionKeys, useSignInWithEthereum, useSignInWithX, useSignMessage, useSimulateTransfer, useSiwxAuthSession, useSmartAccount, useSolanaAccount, useSolanaBalance, useSolanaRoles, useSolanaTransaction, useSwitchChain, useTokenBalance, useTokenList, useTokenSearch, useTransactionSimulation, useTxHistory, useTxMonitor, useUserOpStatus, useValidateDestination, useViemClient, useWallet, useWeb3, useWeb3ErrorHandler, validateDestination };
2116
+ export { type AddressValidationResult, AppkitAccordion, type AppkitAccordionEvents, AppkitAccountButton, type AppkitAccountButtonEvents, AppkitAlertDialog, type AppkitAlertDialogEvents, AppkitAvatar, type AppkitAvatarEvents, AppkitBadge, type AppkitBadgeEvents, AppkitButton, type AppkitButtonEvents, AppkitCard, AppkitCardContent, type AppkitCardContentEvents, AppkitCardDescription, type AppkitCardDescriptionEvents, type AppkitCardEvents, AppkitCardFooter, type AppkitCardFooterEvents, AppkitCardHeader, type AppkitCardHeaderEvents, AppkitCardTitle, type AppkitCardTitleEvents, AppkitCheckbox, type AppkitCheckboxEvents, AppkitCollapsible, type AppkitCollapsibleEvents, AppkitConnectButton, type AppkitConnectButtonEvents, AppkitDialog, type AppkitDialogEvents, AppkitDropdownMenu, type AppkitDropdownMenuEvents, AppkitInput, type AppkitInputEvents, AppkitPopover, type AppkitPopoverEvents, AppkitProgress, type AppkitProgressEvents, AppkitScrollArea, type AppkitScrollAreaEvents, AppkitSelect, type AppkitSelectEvents, AppkitSeparator, type AppkitSeparatorEvents, AppkitSkeleton, type AppkitSkeletonEvents, AppkitSwitch, type AppkitSwitchEvents, AppkitTabs, type AppkitTabsEvents, AppkitToggleGroup, type AppkitToggleGroupEvents, AppkitTooltip, type AppkitTooltipEvents, DEFAULT_EVM_CHAINS, type EmbeddedWalletAccountView, type EmbeddedWalletView, type EvmTransaction, type ExecuteError, type ExecuteOptions, type ExecutionPreview, type ExecutionRoute, InjectedProviderRegistration, type Locale, NativeWalletConnectOptions, type Quote, type QuoteOptions, type SIWxConfig, type SendCallsStatus, type TokenBalanceResult, type TokenInfo, TokenSelector, type TokenSelectorProps, TxMonitorContext, type TxMonitorLike, type TxStatus, type TxStatusEntry, type UseCapabilitiesReturn, type UseCompareCostsInput, type UseCompareCostsReturn, type UseCreateSessionKeyReturn, type UseDelegateOptions, type UseDelegateReturn, type UseDelegationPolicyOptions, type UseDelegationPolicyReturn, type UseDelegationReturn, type UseERC20AllowanceOptions, type UseERC20AllowanceReturn, type UseERC20ApproveOptions, type UseERC20ApproveReturn, type UseERC20TransferOptions, type UseERC20TransferReturn, type UseERC20TransferSimulationOptions, type UseERC20TransferSimulationReturn, type UseEmbeddedWalletReturn, type UseExecuteCallsOptions, type UseExecuteCallsReturn, type UseExecuteRouteReturn, type UseLastTxResult, type UseLookupAddressOptions, type UseLookupAddressResult, type UsePassphraseGateReturn, type UsePaymentFetchReturn, type UseResolveNameOptions, type UseResolveNameResult, type UseRevokeSessionReturn, type UseRouteQuoteInput, type UseRouteQuoteReturn, type UseSIWxLoginOptions, type UseSIWxLoginReturn, type UseSIWxSessionOptions, type UseSIWxSessionReturn, type UseSendUserOperationOptions, type UseSendUserOperationReturn, type UseSendWithSessionReturn, type UseSessionKeysReturn, type UseSessionReturn, type UseSignInWithEthereumOptions, type UseSignInWithEthereumReturn, type UseSignInWithXOptions, type UseSignInWithXReturn, type UseSimulateTransferOptions, type UseSimulateTransferReturn, type UseSiwxAuthSessionOptions, type UseSiwxAuthSessionReturn, type UseSmartAccountOptions, type UseSmartAccountReturn, type UseSolanaAccountReturn, type UseSolanaBalanceOptions, type UseSolanaBalanceReturn, type UseSolanaRolesReturn, type UseSolanaSessionKeyReturn, type UseSolanaTransactionReturn, type UseSwitchChainReturn, type UseTokenBalanceOptions, type UseTokenListOptions, type UseTokenListReturn, type UseTokenSearchReturn, type UseTransactionSimulationReturn, type UseTxHistoryResult, type UseTxMonitorResult, type UseUserOpStatusOptions, type UseUserOpStatusReturn, type UseValidateDestinationOptions, type UseValidateDestinationReturn, type UseWalletReturn, type UseWeb3ErrorHandlerReturn, type UserFriendlyError, type UserOpStatus, WALLET_ERROR_DESCRIPTIONS, WALLET_ERROR_TITLES, type Web3Actions, Web3Client, type Web3ConnectConfig, Web3ConnectProvider, type Web3ConnectProviderProps, Web3Context, getChainById, getDefaultChains, getLocale, getUserFriendlyError, isRetryableError, resetSessionKeyManager, setLocale, t, useAccount, useBalance, useCapabilities, useChain, useCompareCosts, useConnect, useCreateSessionKey, useDelegate, useDelegation, useDelegationPolicy, useDisconnect, useERC20Allowance, useERC20Approve, useERC20Transfer, useERC20TransferSimulation, useEmbeddedWallet, useExecuteCalls, useExecuteRoute, useLastTx, useLookupAddress, useNotification, usePassphraseGate, usePaymentFetch, useResolveName, useRevokeSession, useRouteQuote, useSIWxLogin, useSIWxSession, useSendCalls, useSendTransaction, useSendUserOperation, useSendWithSession, useSession, useSessionKeys, useSignInWithEthereum, useSignInWithX, useSignMessage, useSimulateTransfer, useSiwxAuthSession, useSmartAccount, useSolanaAccount, useSolanaBalance, useSolanaRoles, useSolanaSessionKey, useSolanaTransaction, useSwitchChain, useTokenBalance, useTokenList, useTokenSearch, useTransactionSimulation, useTxHistory, useTxMonitor, useUserOpStatus, useValidateDestination, useViemClient, useWallet, useWeb3, useWeb3ErrorHandler, validateDestination };