@naculus/connect-appkit-react 0.2.5 → 0.2.7
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.cjs +1 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +45 -91
- package/dist/index.d.ts +45 -91
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/package.json +12 -12
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as _naculus_connect_core from '@naculus/connect-core';
|
|
2
|
-
import { UniversalWalletSession, DelegationStatus, ExecutionPlan, AtomicityRequirement, BatchCall, SessionKeyInfo,
|
|
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';
|
|
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, NotificationSettingsStorage, SolanaRoles, SolanaRolesAbsence, SolanaIdentity, SolanaSigner, SolanaPayer, AddressValidationLevel } from '@naculus/connect-appkit-core';
|
|
8
|
-
export { AddressValidationLevel, AtomicSupport, ChainCapabilities, ChainInfo, ConnectionStatus, CostComparison, CostComparisonOperation, CostComparisonOptions, ExecuteRouteResult, SolanaIdentity, SolanaPayer, SolanaRoles, SolanaRolesAbsence, SolanaSigner, SolanaWalletFeatures, WalletChain, Web3State } 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';
|
|
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
9
|
import { Web3Client } from './client.cjs';
|
|
10
10
|
export { ClientConfig, clearClient, createClient, getClient } from './client.cjs';
|
|
11
11
|
import { Address, PublicClient, WalletClient } from 'viem';
|
|
@@ -309,6 +309,39 @@ declare function useConnect(): {
|
|
|
309
309
|
error: Error | null;
|
|
310
310
|
};
|
|
311
311
|
|
|
312
|
+
interface UseDelegateOptions {
|
|
313
|
+
/**
|
|
314
|
+
* Implementations this app trusts to run with full control of the
|
|
315
|
+
* account. Required and empty by default: which contract an EOA runs is the
|
|
316
|
+
* security decision, and nothing is allowed unless listed. Revoking is
|
|
317
|
+
* always allowed.
|
|
318
|
+
*/
|
|
319
|
+
allowlist: readonly string[];
|
|
320
|
+
}
|
|
321
|
+
interface UseDelegateReturn {
|
|
322
|
+
/** Delegate the connected account to `delegate` (must be allowlisted). */
|
|
323
|
+
delegate: (delegate: `0x${string}`) => Promise<SentDelegation | null>;
|
|
324
|
+
/** Clear the account's delegation. */
|
|
325
|
+
revoke: () => Promise<SentDelegation | null>;
|
|
326
|
+
/** The last sent type-4 transaction and the authorization it carried. */
|
|
327
|
+
result: SentDelegation | null;
|
|
328
|
+
isPending: boolean;
|
|
329
|
+
error: Error | null;
|
|
330
|
+
reset: () => void;
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* EIP-7702 owner path: delegate or revoke the connected account by sending
|
|
334
|
+
* a type-4 transaction from it.
|
|
335
|
+
*
|
|
336
|
+
* Embedded wallet only. Browser and WalletConnect wallets upgrade accounts
|
|
337
|
+
* through `wallet_sendCalls`; for them this fails with `method_unsupported`
|
|
338
|
+
* before anything is read or signed. Core's `delegateAccount` applies the
|
|
339
|
+
* allowlist and computes both nonces; this hook only wires the session and
|
|
340
|
+
* the pending-nonce read. Pair with `useDelegation().refetch()` once the
|
|
341
|
+
* transaction is included.
|
|
342
|
+
*/
|
|
343
|
+
declare function useDelegate(options: UseDelegateOptions): UseDelegateReturn;
|
|
344
|
+
|
|
312
345
|
interface UseDelegationReturn extends DelegationStatus {
|
|
313
346
|
isFetching: boolean;
|
|
314
347
|
error: Error | null;
|
|
@@ -395,80 +428,6 @@ interface UseExecuteCallsReturn {
|
|
|
395
428
|
*/
|
|
396
429
|
declare function useExecuteCalls(options?: UseExecuteCallsOptions): UseExecuteCallsReturn;
|
|
397
430
|
|
|
398
|
-
interface DelegationPolicyPreview {
|
|
399
|
-
policy: SessionKeyInfo | null;
|
|
400
|
-
scope: ScopeCheckResult;
|
|
401
|
-
execution: ExecutionPreview;
|
|
402
|
-
signerMatches: boolean;
|
|
403
|
-
/** The stored signature still matches the persisted scope, signer, and origin. */
|
|
404
|
-
authorizationVerified: boolean;
|
|
405
|
-
/** Policy and route preflight passed; this does not imply broadcast. */
|
|
406
|
-
ready: boolean;
|
|
407
|
-
/** False until a session-signature-aware AA/7702 broadcaster is attached. */
|
|
408
|
-
broadcastReady: boolean;
|
|
409
|
-
/** The concrete on-chain route, when one has proved the policy is installed. */
|
|
410
|
-
broadcastRoute: PolicyExecutionRoute | null;
|
|
411
|
-
/** Whether that route has verified on-chain authorization for this policy. */
|
|
412
|
-
onchainAuthorizationVerified: boolean;
|
|
413
|
-
/** Guaranteed gas payer status for the configured broadcast route. */
|
|
414
|
-
broadcastSponsored: boolean | null;
|
|
415
|
-
/** Whether submission can proceed without invoking the main wallet again. */
|
|
416
|
-
broadcastPromptless: boolean;
|
|
417
|
-
reason: string;
|
|
418
|
-
}
|
|
419
|
-
type PolicyExecutionRoute = "erc4337" | "eip7702";
|
|
420
|
-
interface PolicyExecutionCheck {
|
|
421
|
-
/** True only after the adapter has checked its live account/module state. */
|
|
422
|
-
ready: boolean;
|
|
423
|
-
/** True only when the session policy is enforceable by the target account. */
|
|
424
|
-
authorizationInstalled: boolean;
|
|
425
|
-
/** Whether this route guarantees the user will not pay gas. */
|
|
426
|
-
sponsored: boolean;
|
|
427
|
-
/** True only when submission does not invoke the main wallet again. */
|
|
428
|
-
promptless: boolean;
|
|
429
|
-
/** EIP-7702 delegate observed/configured by the adapter. */
|
|
430
|
-
executorAddress?: `0x${string}`;
|
|
431
|
-
reason: string;
|
|
432
|
-
}
|
|
433
|
-
interface PreparedPolicyExecution {
|
|
434
|
-
/** Exact digest the configured account/module validates on chain. */
|
|
435
|
-
digest: Hex;
|
|
436
|
-
/** Authoritative facts used for the final locked policy check. */
|
|
437
|
-
transaction: SessionKeyTransaction;
|
|
438
|
-
/** Adapter-private payload passed back unchanged for submission. */
|
|
439
|
-
payload: unknown;
|
|
440
|
-
}
|
|
441
|
-
interface PolicyExecutionSubmission {
|
|
442
|
-
route: PolicyExecutionRoute;
|
|
443
|
-
/** UserOperation hash for ERC-4337, transaction hash for EIP-7702. */
|
|
444
|
-
hash: Hex;
|
|
445
|
-
/** A hash proves submission, not inclusion. */
|
|
446
|
-
status: "submitted";
|
|
447
|
-
}
|
|
448
|
-
/**
|
|
449
|
-
* Account-specific bridge between a signed Naculus policy and on-chain code.
|
|
450
|
-
*
|
|
451
|
-
* ERC-4337 does not standardize session keys, and EIP-7702 only delegates code;
|
|
452
|
-
* the selected account/module still defines the signature envelope and policy
|
|
453
|
-
* storage. The adapter therefore has to prove that authorization is installed,
|
|
454
|
-
* prepare the exact digest that code validates, and broadcast that same payload.
|
|
455
|
-
*/
|
|
456
|
-
interface PolicyExecutionAdapter {
|
|
457
|
-
route: PolicyExecutionRoute;
|
|
458
|
-
check: (request: {
|
|
459
|
-
policy: SessionKeyInfo;
|
|
460
|
-
transaction: SessionKeyTransaction;
|
|
461
|
-
}) => Promise<PolicyExecutionCheck>;
|
|
462
|
-
prepare: (request: {
|
|
463
|
-
policy: SessionKeyInfo;
|
|
464
|
-
transaction: SessionKeyTransaction;
|
|
465
|
-
}) => Promise<PreparedPolicyExecution>;
|
|
466
|
-
broadcast: (request: {
|
|
467
|
-
policy: SessionKeyInfo;
|
|
468
|
-
prepared: PreparedPolicyExecution;
|
|
469
|
-
signature: Hex;
|
|
470
|
-
}) => Promise<PolicyExecutionSubmission>;
|
|
471
|
-
}
|
|
472
431
|
interface UseDelegationPolicyOptions {
|
|
473
432
|
/** Must include a host-provided encryptionKey before a policy can be created. */
|
|
474
433
|
managerConfig?: SessionKeyManagerConfig;
|
|
@@ -500,8 +459,6 @@ interface UseDelegationPolicyReturn {
|
|
|
500
459
|
refresh: () => Promise<void>;
|
|
501
460
|
clearError: () => void;
|
|
502
461
|
}
|
|
503
|
-
/** Build the exact, deterministic message the main wallet authorizes. */
|
|
504
|
-
declare function buildDelegationPolicyMessage(policy: SessionKeyInfo, origin: string): string;
|
|
505
462
|
/**
|
|
506
463
|
* Complete product flow for local, signed, persistent session policies.
|
|
507
464
|
*
|
|
@@ -670,15 +627,10 @@ interface UseERC20TransferReturn {
|
|
|
670
627
|
declare function useERC20Transfer(options: UseERC20TransferOptions): UseERC20TransferReturn;
|
|
671
628
|
|
|
672
629
|
interface UseTransactionSimulationReturn {
|
|
673
|
-
/** Current simulation result (undefined until first run) */
|
|
674
630
|
result: SimulationResult | undefined;
|
|
675
|
-
/** Whether a simulation is in progress */
|
|
676
631
|
isSimulating: boolean;
|
|
677
|
-
/** Error from the last simulation attempt */
|
|
678
632
|
error: Error | null;
|
|
679
|
-
/** Manually trigger a simulation */
|
|
680
633
|
simulate: () => Promise<SimulationResult>;
|
|
681
|
-
/** Reset the simulation state */
|
|
682
634
|
reset: () => void;
|
|
683
635
|
}
|
|
684
636
|
declare function useTransactionSimulation(tx: EvmTransaction | undefined, chainId?: number): UseTransactionSimulationReturn;
|
|
@@ -1289,6 +1241,14 @@ interface UseSIWxSessionReturn {
|
|
|
1289
1241
|
/** Clear the last error */
|
|
1290
1242
|
clearError: () => void;
|
|
1291
1243
|
}
|
|
1244
|
+
/**
|
|
1245
|
+
* Random suffix for a session record ID.
|
|
1246
|
+
*
|
|
1247
|
+
* `Math.random` gave roughly 31 predictable bits. The signature, not this ID,
|
|
1248
|
+
* is what authenticates a SIWx session, so this was not an authentication
|
|
1249
|
+
* bypass — but an ID a consumer may key storage or a request on should not be
|
|
1250
|
+
* guessable, and the CSPRNG is already the convention everywhere else here.
|
|
1251
|
+
*/
|
|
1292
1252
|
declare function useSIWxSession(options?: UseSIWxSessionOptions): UseSIWxSessionReturn;
|
|
1293
1253
|
|
|
1294
1254
|
interface UseSignInWithXOptions {
|
|
@@ -1708,12 +1668,6 @@ interface UseUserOpStatusReturn {
|
|
|
1708
1668
|
/** Reset state */
|
|
1709
1669
|
reset: () => void;
|
|
1710
1670
|
}
|
|
1711
|
-
/**
|
|
1712
|
-
* Hook for tracking the lifecycle of an ERC-4337 UserOperation.
|
|
1713
|
-
*
|
|
1714
|
-
* @param options - Configuration for polling behavior
|
|
1715
|
-
* @returns UserOperation status, receipt, and lifecycle controls
|
|
1716
|
-
*/
|
|
1717
1671
|
declare function useUserOpStatus(options?: UseUserOpStatusOptions): UseUserOpStatusReturn;
|
|
1718
1672
|
|
|
1719
1673
|
/**
|
|
@@ -2093,4 +2047,4 @@ declare const AppkitToggleGroup: StencilReactComponent<AppkitToggleGroup$1, Appk
|
|
|
2093
2047
|
type AppkitTooltipEvents = NonNullable<unknown>;
|
|
2094
2048
|
declare const AppkitTooltip: StencilReactComponent<AppkitTooltip$1, AppkitTooltipEvents, Components.AppkitTooltip>;
|
|
2095
2049
|
|
|
2096
|
-
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
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as _naculus_connect_core from '@naculus/connect-core';
|
|
2
|
-
import { UniversalWalletSession, DelegationStatus, ExecutionPlan, AtomicityRequirement, BatchCall, SessionKeyInfo,
|
|
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';
|
|
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, NotificationSettingsStorage, SolanaRoles, SolanaRolesAbsence, SolanaIdentity, SolanaSigner, SolanaPayer, AddressValidationLevel } from '@naculus/connect-appkit-core';
|
|
8
|
-
export { AddressValidationLevel, AtomicSupport, ChainCapabilities, ChainInfo, ConnectionStatus, CostComparison, CostComparisonOperation, CostComparisonOptions, ExecuteRouteResult, SolanaIdentity, SolanaPayer, SolanaRoles, SolanaRolesAbsence, SolanaSigner, SolanaWalletFeatures, WalletChain, Web3State } 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';
|
|
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
9
|
import { Web3Client } from './client.js';
|
|
10
10
|
export { ClientConfig, clearClient, createClient, getClient } from './client.js';
|
|
11
11
|
import { Address, PublicClient, WalletClient } from 'viem';
|
|
@@ -309,6 +309,39 @@ declare function useConnect(): {
|
|
|
309
309
|
error: Error | null;
|
|
310
310
|
};
|
|
311
311
|
|
|
312
|
+
interface UseDelegateOptions {
|
|
313
|
+
/**
|
|
314
|
+
* Implementations this app trusts to run with full control of the
|
|
315
|
+
* account. Required and empty by default: which contract an EOA runs is the
|
|
316
|
+
* security decision, and nothing is allowed unless listed. Revoking is
|
|
317
|
+
* always allowed.
|
|
318
|
+
*/
|
|
319
|
+
allowlist: readonly string[];
|
|
320
|
+
}
|
|
321
|
+
interface UseDelegateReturn {
|
|
322
|
+
/** Delegate the connected account to `delegate` (must be allowlisted). */
|
|
323
|
+
delegate: (delegate: `0x${string}`) => Promise<SentDelegation | null>;
|
|
324
|
+
/** Clear the account's delegation. */
|
|
325
|
+
revoke: () => Promise<SentDelegation | null>;
|
|
326
|
+
/** The last sent type-4 transaction and the authorization it carried. */
|
|
327
|
+
result: SentDelegation | null;
|
|
328
|
+
isPending: boolean;
|
|
329
|
+
error: Error | null;
|
|
330
|
+
reset: () => void;
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* EIP-7702 owner path: delegate or revoke the connected account by sending
|
|
334
|
+
* a type-4 transaction from it.
|
|
335
|
+
*
|
|
336
|
+
* Embedded wallet only. Browser and WalletConnect wallets upgrade accounts
|
|
337
|
+
* through `wallet_sendCalls`; for them this fails with `method_unsupported`
|
|
338
|
+
* before anything is read or signed. Core's `delegateAccount` applies the
|
|
339
|
+
* allowlist and computes both nonces; this hook only wires the session and
|
|
340
|
+
* the pending-nonce read. Pair with `useDelegation().refetch()` once the
|
|
341
|
+
* transaction is included.
|
|
342
|
+
*/
|
|
343
|
+
declare function useDelegate(options: UseDelegateOptions): UseDelegateReturn;
|
|
344
|
+
|
|
312
345
|
interface UseDelegationReturn extends DelegationStatus {
|
|
313
346
|
isFetching: boolean;
|
|
314
347
|
error: Error | null;
|
|
@@ -395,80 +428,6 @@ interface UseExecuteCallsReturn {
|
|
|
395
428
|
*/
|
|
396
429
|
declare function useExecuteCalls(options?: UseExecuteCallsOptions): UseExecuteCallsReturn;
|
|
397
430
|
|
|
398
|
-
interface DelegationPolicyPreview {
|
|
399
|
-
policy: SessionKeyInfo | null;
|
|
400
|
-
scope: ScopeCheckResult;
|
|
401
|
-
execution: ExecutionPreview;
|
|
402
|
-
signerMatches: boolean;
|
|
403
|
-
/** The stored signature still matches the persisted scope, signer, and origin. */
|
|
404
|
-
authorizationVerified: boolean;
|
|
405
|
-
/** Policy and route preflight passed; this does not imply broadcast. */
|
|
406
|
-
ready: boolean;
|
|
407
|
-
/** False until a session-signature-aware AA/7702 broadcaster is attached. */
|
|
408
|
-
broadcastReady: boolean;
|
|
409
|
-
/** The concrete on-chain route, when one has proved the policy is installed. */
|
|
410
|
-
broadcastRoute: PolicyExecutionRoute | null;
|
|
411
|
-
/** Whether that route has verified on-chain authorization for this policy. */
|
|
412
|
-
onchainAuthorizationVerified: boolean;
|
|
413
|
-
/** Guaranteed gas payer status for the configured broadcast route. */
|
|
414
|
-
broadcastSponsored: boolean | null;
|
|
415
|
-
/** Whether submission can proceed without invoking the main wallet again. */
|
|
416
|
-
broadcastPromptless: boolean;
|
|
417
|
-
reason: string;
|
|
418
|
-
}
|
|
419
|
-
type PolicyExecutionRoute = "erc4337" | "eip7702";
|
|
420
|
-
interface PolicyExecutionCheck {
|
|
421
|
-
/** True only after the adapter has checked its live account/module state. */
|
|
422
|
-
ready: boolean;
|
|
423
|
-
/** True only when the session policy is enforceable by the target account. */
|
|
424
|
-
authorizationInstalled: boolean;
|
|
425
|
-
/** Whether this route guarantees the user will not pay gas. */
|
|
426
|
-
sponsored: boolean;
|
|
427
|
-
/** True only when submission does not invoke the main wallet again. */
|
|
428
|
-
promptless: boolean;
|
|
429
|
-
/** EIP-7702 delegate observed/configured by the adapter. */
|
|
430
|
-
executorAddress?: `0x${string}`;
|
|
431
|
-
reason: string;
|
|
432
|
-
}
|
|
433
|
-
interface PreparedPolicyExecution {
|
|
434
|
-
/** Exact digest the configured account/module validates on chain. */
|
|
435
|
-
digest: Hex;
|
|
436
|
-
/** Authoritative facts used for the final locked policy check. */
|
|
437
|
-
transaction: SessionKeyTransaction;
|
|
438
|
-
/** Adapter-private payload passed back unchanged for submission. */
|
|
439
|
-
payload: unknown;
|
|
440
|
-
}
|
|
441
|
-
interface PolicyExecutionSubmission {
|
|
442
|
-
route: PolicyExecutionRoute;
|
|
443
|
-
/** UserOperation hash for ERC-4337, transaction hash for EIP-7702. */
|
|
444
|
-
hash: Hex;
|
|
445
|
-
/** A hash proves submission, not inclusion. */
|
|
446
|
-
status: "submitted";
|
|
447
|
-
}
|
|
448
|
-
/**
|
|
449
|
-
* Account-specific bridge between a signed Naculus policy and on-chain code.
|
|
450
|
-
*
|
|
451
|
-
* ERC-4337 does not standardize session keys, and EIP-7702 only delegates code;
|
|
452
|
-
* the selected account/module still defines the signature envelope and policy
|
|
453
|
-
* storage. The adapter therefore has to prove that authorization is installed,
|
|
454
|
-
* prepare the exact digest that code validates, and broadcast that same payload.
|
|
455
|
-
*/
|
|
456
|
-
interface PolicyExecutionAdapter {
|
|
457
|
-
route: PolicyExecutionRoute;
|
|
458
|
-
check: (request: {
|
|
459
|
-
policy: SessionKeyInfo;
|
|
460
|
-
transaction: SessionKeyTransaction;
|
|
461
|
-
}) => Promise<PolicyExecutionCheck>;
|
|
462
|
-
prepare: (request: {
|
|
463
|
-
policy: SessionKeyInfo;
|
|
464
|
-
transaction: SessionKeyTransaction;
|
|
465
|
-
}) => Promise<PreparedPolicyExecution>;
|
|
466
|
-
broadcast: (request: {
|
|
467
|
-
policy: SessionKeyInfo;
|
|
468
|
-
prepared: PreparedPolicyExecution;
|
|
469
|
-
signature: Hex;
|
|
470
|
-
}) => Promise<PolicyExecutionSubmission>;
|
|
471
|
-
}
|
|
472
431
|
interface UseDelegationPolicyOptions {
|
|
473
432
|
/** Must include a host-provided encryptionKey before a policy can be created. */
|
|
474
433
|
managerConfig?: SessionKeyManagerConfig;
|
|
@@ -500,8 +459,6 @@ interface UseDelegationPolicyReturn {
|
|
|
500
459
|
refresh: () => Promise<void>;
|
|
501
460
|
clearError: () => void;
|
|
502
461
|
}
|
|
503
|
-
/** Build the exact, deterministic message the main wallet authorizes. */
|
|
504
|
-
declare function buildDelegationPolicyMessage(policy: SessionKeyInfo, origin: string): string;
|
|
505
462
|
/**
|
|
506
463
|
* Complete product flow for local, signed, persistent session policies.
|
|
507
464
|
*
|
|
@@ -670,15 +627,10 @@ interface UseERC20TransferReturn {
|
|
|
670
627
|
declare function useERC20Transfer(options: UseERC20TransferOptions): UseERC20TransferReturn;
|
|
671
628
|
|
|
672
629
|
interface UseTransactionSimulationReturn {
|
|
673
|
-
/** Current simulation result (undefined until first run) */
|
|
674
630
|
result: SimulationResult | undefined;
|
|
675
|
-
/** Whether a simulation is in progress */
|
|
676
631
|
isSimulating: boolean;
|
|
677
|
-
/** Error from the last simulation attempt */
|
|
678
632
|
error: Error | null;
|
|
679
|
-
/** Manually trigger a simulation */
|
|
680
633
|
simulate: () => Promise<SimulationResult>;
|
|
681
|
-
/** Reset the simulation state */
|
|
682
634
|
reset: () => void;
|
|
683
635
|
}
|
|
684
636
|
declare function useTransactionSimulation(tx: EvmTransaction | undefined, chainId?: number): UseTransactionSimulationReturn;
|
|
@@ -1289,6 +1241,14 @@ interface UseSIWxSessionReturn {
|
|
|
1289
1241
|
/** Clear the last error */
|
|
1290
1242
|
clearError: () => void;
|
|
1291
1243
|
}
|
|
1244
|
+
/**
|
|
1245
|
+
* Random suffix for a session record ID.
|
|
1246
|
+
*
|
|
1247
|
+
* `Math.random` gave roughly 31 predictable bits. The signature, not this ID,
|
|
1248
|
+
* is what authenticates a SIWx session, so this was not an authentication
|
|
1249
|
+
* bypass — but an ID a consumer may key storage or a request on should not be
|
|
1250
|
+
* guessable, and the CSPRNG is already the convention everywhere else here.
|
|
1251
|
+
*/
|
|
1292
1252
|
declare function useSIWxSession(options?: UseSIWxSessionOptions): UseSIWxSessionReturn;
|
|
1293
1253
|
|
|
1294
1254
|
interface UseSignInWithXOptions {
|
|
@@ -1708,12 +1668,6 @@ interface UseUserOpStatusReturn {
|
|
|
1708
1668
|
/** Reset state */
|
|
1709
1669
|
reset: () => void;
|
|
1710
1670
|
}
|
|
1711
|
-
/**
|
|
1712
|
-
* Hook for tracking the lifecycle of an ERC-4337 UserOperation.
|
|
1713
|
-
*
|
|
1714
|
-
* @param options - Configuration for polling behavior
|
|
1715
|
-
* @returns UserOperation status, receipt, and lifecycle controls
|
|
1716
|
-
*/
|
|
1717
1671
|
declare function useUserOpStatus(options?: UseUserOpStatusOptions): UseUserOpStatusReturn;
|
|
1718
1672
|
|
|
1719
1673
|
/**
|
|
@@ -2093,4 +2047,4 @@ declare const AppkitToggleGroup: StencilReactComponent<AppkitToggleGroup$1, Appk
|
|
|
2093
2047
|
type AppkitTooltipEvents = NonNullable<unknown>;
|
|
2094
2048
|
declare const AppkitTooltip: StencilReactComponent<AppkitTooltip$1, AppkitTooltipEvents, Components.AppkitTooltip>;
|
|
2095
2049
|
|
|
2096
|
-
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
|
|
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 };
|