@naculus/connect-appkit-react 0.2.4 → 0.2.6
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 +44 -309
- package/dist/index.d.ts +44 -309
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.d.cts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as _naculus_connect_core from '@naculus/connect-core';
|
|
2
|
-
import { UniversalWalletSession, DelegationStatus, ExecutionPlan, AtomicityRequirement, BatchCall, SessionKeyInfo,
|
|
2
|
+
import { UniversalWalletSession, 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
|
+
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';
|
|
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';
|
|
6
9
|
import { Web3Client } from './client.cjs';
|
|
7
10
|
export { ClientConfig, clearClient, createClient, getClient } from './client.cjs';
|
|
8
|
-
import * as _naculus_connect_appkit_core from '@naculus/connect-appkit-core';
|
|
9
|
-
import { Web3State, WalletChain, ChainCapabilities, AtomicSupport, ChainInfo, SolanaRoles, SolanaRolesAbsence, SolanaIdentity, SolanaSigner, SolanaPayer } from '@naculus/connect-appkit-core';
|
|
10
|
-
export { AtomicSupport, ChainCapabilities, ChainInfo, ConnectionStatus, SolanaIdentity, SolanaPayer, SolanaRoles, SolanaRolesAbsence, SolanaSigner, SolanaWalletFeatures, WalletChain, Web3State } from '@naculus/connect-appkit-core';
|
|
11
11
|
import { Address, PublicClient, WalletClient } from 'viem';
|
|
12
12
|
import { SimulationResult } from '@naculus/wallet-engine';
|
|
13
13
|
export { ApprovalChange, BalanceChange, GasInfo, RiskAssessment, RiskLevel, RiskWarning, SimulationResult, SimulationStatus } from '@naculus/wallet-engine';
|
|
@@ -49,233 +49,59 @@ import '@naculus/connector-passkeys';
|
|
|
49
49
|
import '@naculus/connector-walletconnect';
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
|
-
* useCompareCosts —
|
|
53
|
-
*
|
|
54
|
-
* Provides reactive state for comparing gas costs, fees, and estimated
|
|
55
|
-
* times for a given operation across multiple chains.
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* ```tsx
|
|
59
|
-
* import { useCompareCosts } from "@naculus/connect-appkit-react";
|
|
52
|
+
* useCompareCosts — compare an operation's cost across chains.
|
|
60
53
|
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* operation: "send_erc20",
|
|
64
|
-
* chains: ["eip155:1", "eip155:137", "eip155:10"],
|
|
65
|
-
* });
|
|
66
|
-
*
|
|
67
|
-
* if (loading) return <div>Loading...</div>;
|
|
68
|
-
*
|
|
69
|
-
* return (
|
|
70
|
-
* <div>
|
|
71
|
-
* {comparisons.map(c => (
|
|
72
|
-
* <div key={c.chain}>
|
|
73
|
-
* {c.chainName}: ${c.totalCost} (gas: ${c.gasCost})
|
|
74
|
-
* </div>
|
|
75
|
-
* ))}
|
|
76
|
-
* </div>
|
|
77
|
-
* );
|
|
78
|
-
* }
|
|
79
|
-
* ```
|
|
54
|
+
* Types and the value-key for the input live in
|
|
55
|
+
* `@naculus/connect-appkit-core` (`routing`), shared with the Vue composable.
|
|
80
56
|
*/
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
chainName: string;
|
|
84
|
-
totalCost: string;
|
|
85
|
-
gasCost: string;
|
|
86
|
-
estimatedTimeMs: number;
|
|
87
|
-
}
|
|
88
|
-
type CostComparisonOperation = "send_erc20" | "swap" | "bridge" | (string & {});
|
|
89
|
-
interface CostComparisonOptions {
|
|
90
|
-
amount?: string;
|
|
91
|
-
token?: string;
|
|
92
|
-
[key: string]: unknown;
|
|
93
|
-
}
|
|
94
|
-
interface UseCompareCostsInput {
|
|
95
|
-
operation: CostComparisonOperation;
|
|
96
|
-
chains: string[];
|
|
97
|
-
options?: CostComparisonOptions;
|
|
98
|
-
}
|
|
57
|
+
|
|
58
|
+
type UseCompareCostsInput = CompareCostsInput;
|
|
99
59
|
interface UseCompareCostsReturn {
|
|
100
|
-
/** Sorted cost comparisons (cheapest first) */
|
|
101
60
|
comparisons: CostComparison[];
|
|
102
|
-
/** Whether a comparison request is in flight */
|
|
103
61
|
loading: boolean;
|
|
104
|
-
/** Error that occurred during the last request */
|
|
105
62
|
error: Error | null;
|
|
106
|
-
/** Manually trigger a refresh */
|
|
107
63
|
refresh: () => Promise<void>;
|
|
108
64
|
}
|
|
109
|
-
declare function useCompareCosts(input: UseCompareCostsInput, compareCostsFn?:
|
|
65
|
+
declare function useCompareCosts(input: UseCompareCostsInput, compareCostsFn?: CompareCosts): UseCompareCostsReturn;
|
|
110
66
|
|
|
111
67
|
/**
|
|
112
|
-
* useExecuteRoute —
|
|
113
|
-
*
|
|
114
|
-
* Manages the execution lifecycle of a cross-chain transfer.
|
|
115
|
-
* Tracks execution status, bridge reference, and completion state.
|
|
116
|
-
*
|
|
117
|
-
* @example
|
|
118
|
-
* ```tsx
|
|
119
|
-
* import { useExecuteRoute } from "@naculus/connect-appkit-react";
|
|
68
|
+
* useExecuteRoute — execute a quoted cross-chain route once.
|
|
120
69
|
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
* return (
|
|
125
|
-
* <div>
|
|
126
|
-
* <button onClick={() => execute(quote, "0xRecipient")} disabled={executing}>
|
|
127
|
-
* {executing ? "Executing..." : "Execute Route"}
|
|
128
|
-
* </button>
|
|
129
|
-
* {result && <div>Tx: {result.fromTxHash}</div>}
|
|
130
|
-
* {error && <div>Error: {error.message}</div>}
|
|
131
|
-
* </div>
|
|
132
|
-
* );
|
|
133
|
-
* }
|
|
134
|
-
* ```
|
|
70
|
+
* Types, the recipient check and error normalisation live in
|
|
71
|
+
* `@naculus/connect-appkit-core` (`routing`), shared with the Vue composable.
|
|
135
72
|
*/
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* CAIP-2 chain the funds arrive on.
|
|
143
|
-
*
|
|
144
|
-
* Optional, and the only thing that makes `recipient` checkable. Without it
|
|
145
|
-
* this hook cannot know whether "0x…" or a base58 string is the right shape,
|
|
146
|
-
* so it does not guess — an EVM-looking check here would reject every
|
|
147
|
-
* legitimate Solana and XRPL recipient. Supply it and the recipient is
|
|
148
|
-
* validated for that namespace before anything is sent.
|
|
149
|
-
*
|
|
150
|
-
* Note that `Quote` as exported from the package root is `useRouteQuote`'s
|
|
151
|
-
* type, which has different fields. A quote from that hook satisfies this
|
|
152
|
-
* one structurally, so `totalCost` and `estimatedTimeMs` arrive undefined
|
|
153
|
-
* and `toChain` has to be supplied by the caller.
|
|
154
|
-
*/
|
|
155
|
-
toChain?: string;
|
|
156
|
-
}
|
|
157
|
-
interface ExecuteRouteResult {
|
|
158
|
-
fromTxHash: string;
|
|
159
|
-
toTxHash?: string;
|
|
160
|
-
}
|
|
161
|
-
interface ExecuteOptions {
|
|
162
|
-
timeoutMs?: number;
|
|
163
|
-
gasLimit?: bigint;
|
|
164
|
-
}
|
|
73
|
+
|
|
74
|
+
type Quote$1 = ExecutableQuote;
|
|
75
|
+
type ExecuteOptions = ExecuteRouteOptions;
|
|
76
|
+
type ExecuteError = ExecuteRouteError;
|
|
77
|
+
|
|
165
78
|
interface UseExecuteRouteReturn {
|
|
166
|
-
/**
|
|
167
|
-
* Execute a route. Resolves with the result, or null if it failed.
|
|
168
|
-
*
|
|
169
|
-
* The result is returned as well as stored because `result` on this object
|
|
170
|
-
* belongs to the render that produced it: a caller awaiting `execute` cannot
|
|
171
|
-
* read it, and for a cross-chain transfer "did the funds move" is not a
|
|
172
|
-
* question to answer on the next render.
|
|
173
|
-
*/
|
|
174
79
|
execute: (quote: Quote$1, recipient: string, options?: ExecuteOptions) => Promise<ExecuteRouteResult | null>;
|
|
175
|
-
/** Whether execution is in progress */
|
|
176
80
|
executing: boolean;
|
|
177
|
-
/** The execution result (populated after successful execution) */
|
|
178
81
|
result: ExecuteRouteResult | null;
|
|
179
|
-
/** Error that occurred during execution */
|
|
180
82
|
error: ExecuteError | null;
|
|
181
|
-
/** Reset execution state back to initial */
|
|
182
83
|
reset: () => void;
|
|
183
84
|
}
|
|
184
|
-
|
|
185
|
-
code: string;
|
|
186
|
-
message: string;
|
|
187
|
-
details?: Record<string, unknown>;
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Hook for executing a cross-chain route.
|
|
191
|
-
*
|
|
192
|
-
* Manages the full lifecycle from calling executeRoute to
|
|
193
|
-
* tracking the result. For auto-approve flows, handles the
|
|
194
|
-
* approve → cross-chain sequence.
|
|
195
|
-
*
|
|
196
|
-
* @param executeRouteFn - Function that performs the actual route execution
|
|
197
|
-
*/
|
|
198
|
-
declare function useExecuteRoute(executeRouteFn?: (quote: Quote$1, recipient: string, options?: ExecuteOptions) => Promise<ExecuteRouteResult>): UseExecuteRouteReturn;
|
|
85
|
+
declare function useExecuteRoute(executeRouteFn?: ExecuteRoute): UseExecuteRouteReturn;
|
|
199
86
|
|
|
200
87
|
/**
|
|
201
|
-
* useRouteQuote —
|
|
202
|
-
*
|
|
203
|
-
* Provides reactive state for discovering routes and getting quotes
|
|
204
|
-
* from the RouteEngine. Returns loading, error, and result states.
|
|
88
|
+
* useRouteQuote — debounced cross-chain route quotes.
|
|
205
89
|
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
* import { useRouteQuote } from "@naculus/connect-appkit-react";
|
|
209
|
-
*
|
|
210
|
-
* function QuotePanel() {
|
|
211
|
-
* const { quotes, loading, error, refresh } = useRouteQuote({
|
|
212
|
-
* fromChain: "eip155:1",
|
|
213
|
-
* toChain: "eip155:137",
|
|
214
|
-
* fromToken: "USDC",
|
|
215
|
-
* amount: "1000000",
|
|
216
|
-
* });
|
|
217
|
-
*
|
|
218
|
-
* if (loading) return <div>Loading quotes...</div>;
|
|
219
|
-
* if (error) return <div>Error: {error.message}</div>;
|
|
220
|
-
*
|
|
221
|
-
* return (
|
|
222
|
-
* <div>
|
|
223
|
-
* {quotes.map(q => (
|
|
224
|
-
* <div key={q.routeId}>
|
|
225
|
-
* {q.provider} — {q.netReceiveFormatted} {q.toTokenSymbol}
|
|
226
|
-
* </div>
|
|
227
|
-
* ))}
|
|
228
|
-
* </div>
|
|
229
|
-
* );
|
|
230
|
-
* }
|
|
231
|
-
* ```
|
|
90
|
+
* Types and the "is this amount quotable" decision live in
|
|
91
|
+
* `@naculus/connect-appkit-core` (`routing`), shared with the Vue composable.
|
|
232
92
|
*/
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
toTokenSymbol: string;
|
|
238
|
-
}
|
|
239
|
-
interface QuoteOptions {
|
|
240
|
-
sortBy?: "cost" | "time" | "balance";
|
|
241
|
-
maxSlippage?: number;
|
|
242
|
-
}
|
|
243
|
-
interface UseRouteQuoteInput {
|
|
244
|
-
fromChain: string;
|
|
245
|
-
toChain: string;
|
|
246
|
-
fromToken: string;
|
|
247
|
-
toToken?: string;
|
|
248
|
-
amount: string;
|
|
249
|
-
options?: QuoteOptions;
|
|
250
|
-
}
|
|
93
|
+
|
|
94
|
+
type Quote = RouteQuote;
|
|
95
|
+
type QuoteOptions = RouteQuoteOptions;
|
|
96
|
+
type UseRouteQuoteInput = RouteQuoteInput;
|
|
251
97
|
interface UseRouteQuoteReturn {
|
|
252
|
-
/** Current list of quotes (sorted by options.sortBy) */
|
|
253
98
|
quotes: Quote[];
|
|
254
|
-
/** Whether a quote request is in flight */
|
|
255
99
|
loading: boolean;
|
|
256
|
-
/** Error that occurred during the last request */
|
|
257
100
|
error: Error | null;
|
|
258
|
-
/** Manually trigger a refresh (re-fetches quotes) */
|
|
259
101
|
refresh: () => Promise<void>;
|
|
260
|
-
/** Clear the current quotes and error state */
|
|
261
102
|
clear: () => void;
|
|
262
103
|
}
|
|
263
|
-
|
|
264
|
-
* Hook for fetching cross-chain route quotes.
|
|
265
|
-
*
|
|
266
|
-
* Automatically re-fetches when input parameters change.
|
|
267
|
-
* Debounces rapid changes to avoid excessive API calls.
|
|
268
|
-
*
|
|
269
|
-
* @param input - Quote request parameters
|
|
270
|
-
* @param getQuoteFn - Function that performs the actual quote fetch
|
|
271
|
-
*/
|
|
272
|
-
declare function useRouteQuote(input: UseRouteQuoteInput, getQuoteFn?: (from: string, to: string, token: string, amount: string, options?: QuoteOptions,
|
|
273
|
-
/**
|
|
274
|
-
* Destination token for a cross-token route. Appended so existing
|
|
275
|
-
* implementations stay assignable; `toToken` was declared on the input and
|
|
276
|
-
* then dropped, so a USDC→USDT quote silently asked for USDC→USDC.
|
|
277
|
-
*/
|
|
278
|
-
toToken?: string) => Promise<Quote[]>): UseRouteQuoteReturn;
|
|
104
|
+
declare function useRouteQuote(input: UseRouteQuoteInput, getQuoteFn?: GetRouteQuotes): UseRouteQuoteReturn;
|
|
279
105
|
|
|
280
106
|
interface AccountEntry {
|
|
281
107
|
/** As the session reports it: CAIP-10 for most wallets, bare hex for some. */
|
|
@@ -569,80 +395,6 @@ interface UseExecuteCallsReturn {
|
|
|
569
395
|
*/
|
|
570
396
|
declare function useExecuteCalls(options?: UseExecuteCallsOptions): UseExecuteCallsReturn;
|
|
571
397
|
|
|
572
|
-
interface DelegationPolicyPreview {
|
|
573
|
-
policy: SessionKeyInfo | null;
|
|
574
|
-
scope: ScopeCheckResult;
|
|
575
|
-
execution: ExecutionPreview;
|
|
576
|
-
signerMatches: boolean;
|
|
577
|
-
/** The stored signature still matches the persisted scope, signer, and origin. */
|
|
578
|
-
authorizationVerified: boolean;
|
|
579
|
-
/** Policy and route preflight passed; this does not imply broadcast. */
|
|
580
|
-
ready: boolean;
|
|
581
|
-
/** False until a session-signature-aware AA/7702 broadcaster is attached. */
|
|
582
|
-
broadcastReady: boolean;
|
|
583
|
-
/** The concrete on-chain route, when one has proved the policy is installed. */
|
|
584
|
-
broadcastRoute: PolicyExecutionRoute | null;
|
|
585
|
-
/** Whether that route has verified on-chain authorization for this policy. */
|
|
586
|
-
onchainAuthorizationVerified: boolean;
|
|
587
|
-
/** Guaranteed gas payer status for the configured broadcast route. */
|
|
588
|
-
broadcastSponsored: boolean | null;
|
|
589
|
-
/** Whether submission can proceed without invoking the main wallet again. */
|
|
590
|
-
broadcastPromptless: boolean;
|
|
591
|
-
reason: string;
|
|
592
|
-
}
|
|
593
|
-
type PolicyExecutionRoute = "erc4337" | "eip7702";
|
|
594
|
-
interface PolicyExecutionCheck {
|
|
595
|
-
/** True only after the adapter has checked its live account/module state. */
|
|
596
|
-
ready: boolean;
|
|
597
|
-
/** True only when the session policy is enforceable by the target account. */
|
|
598
|
-
authorizationInstalled: boolean;
|
|
599
|
-
/** Whether this route guarantees the user will not pay gas. */
|
|
600
|
-
sponsored: boolean;
|
|
601
|
-
/** True only when submission does not invoke the main wallet again. */
|
|
602
|
-
promptless: boolean;
|
|
603
|
-
/** EIP-7702 delegate observed/configured by the adapter. */
|
|
604
|
-
executorAddress?: `0x${string}`;
|
|
605
|
-
reason: string;
|
|
606
|
-
}
|
|
607
|
-
interface PreparedPolicyExecution {
|
|
608
|
-
/** Exact digest the configured account/module validates on chain. */
|
|
609
|
-
digest: Hex;
|
|
610
|
-
/** Authoritative facts used for the final locked policy check. */
|
|
611
|
-
transaction: SessionKeyTransaction;
|
|
612
|
-
/** Adapter-private payload passed back unchanged for submission. */
|
|
613
|
-
payload: unknown;
|
|
614
|
-
}
|
|
615
|
-
interface PolicyExecutionSubmission {
|
|
616
|
-
route: PolicyExecutionRoute;
|
|
617
|
-
/** UserOperation hash for ERC-4337, transaction hash for EIP-7702. */
|
|
618
|
-
hash: Hex;
|
|
619
|
-
/** A hash proves submission, not inclusion. */
|
|
620
|
-
status: "submitted";
|
|
621
|
-
}
|
|
622
|
-
/**
|
|
623
|
-
* Account-specific bridge between a signed Naculus policy and on-chain code.
|
|
624
|
-
*
|
|
625
|
-
* ERC-4337 does not standardize session keys, and EIP-7702 only delegates code;
|
|
626
|
-
* the selected account/module still defines the signature envelope and policy
|
|
627
|
-
* storage. The adapter therefore has to prove that authorization is installed,
|
|
628
|
-
* prepare the exact digest that code validates, and broadcast that same payload.
|
|
629
|
-
*/
|
|
630
|
-
interface PolicyExecutionAdapter {
|
|
631
|
-
route: PolicyExecutionRoute;
|
|
632
|
-
check: (request: {
|
|
633
|
-
policy: SessionKeyInfo;
|
|
634
|
-
transaction: SessionKeyTransaction;
|
|
635
|
-
}) => Promise<PolicyExecutionCheck>;
|
|
636
|
-
prepare: (request: {
|
|
637
|
-
policy: SessionKeyInfo;
|
|
638
|
-
transaction: SessionKeyTransaction;
|
|
639
|
-
}) => Promise<PreparedPolicyExecution>;
|
|
640
|
-
broadcast: (request: {
|
|
641
|
-
policy: SessionKeyInfo;
|
|
642
|
-
prepared: PreparedPolicyExecution;
|
|
643
|
-
signature: Hex;
|
|
644
|
-
}) => Promise<PolicyExecutionSubmission>;
|
|
645
|
-
}
|
|
646
398
|
interface UseDelegationPolicyOptions {
|
|
647
399
|
/** Must include a host-provided encryptionKey before a policy can be created. */
|
|
648
400
|
managerConfig?: SessionKeyManagerConfig;
|
|
@@ -674,8 +426,6 @@ interface UseDelegationPolicyReturn {
|
|
|
674
426
|
refresh: () => Promise<void>;
|
|
675
427
|
clearError: () => void;
|
|
676
428
|
}
|
|
677
|
-
/** Build the exact, deterministic message the main wallet authorizes. */
|
|
678
|
-
declare function buildDelegationPolicyMessage(policy: SessionKeyInfo, origin: string): string;
|
|
679
429
|
/**
|
|
680
430
|
* Complete product flow for local, signed, persistent session policies.
|
|
681
431
|
*
|
|
@@ -844,15 +594,10 @@ interface UseERC20TransferReturn {
|
|
|
844
594
|
declare function useERC20Transfer(options: UseERC20TransferOptions): UseERC20TransferReturn;
|
|
845
595
|
|
|
846
596
|
interface UseTransactionSimulationReturn {
|
|
847
|
-
/** Current simulation result (undefined until first run) */
|
|
848
597
|
result: SimulationResult | undefined;
|
|
849
|
-
/** Whether a simulation is in progress */
|
|
850
598
|
isSimulating: boolean;
|
|
851
|
-
/** Error from the last simulation attempt */
|
|
852
599
|
error: Error | null;
|
|
853
|
-
/** Manually trigger a simulation */
|
|
854
600
|
simulate: () => Promise<SimulationResult>;
|
|
855
|
-
/** Reset the simulation state */
|
|
856
601
|
reset: () => void;
|
|
857
602
|
}
|
|
858
603
|
declare function useTransactionSimulation(tx: EvmTransaction | undefined, chainId?: number): UseTransactionSimulationReturn;
|
|
@@ -1039,11 +784,7 @@ declare function useNotification(options?: {
|
|
|
1039
784
|
/** External InAppChannel instance (for sharing between hooks). If omitted, creates one. */
|
|
1040
785
|
channel?: InAppChannel;
|
|
1041
786
|
/** Custom storage for settings (defaults to localStorage) */
|
|
1042
|
-
storage?:
|
|
1043
|
-
getItem: <T>(key: string) => Promise<T | null>;
|
|
1044
|
-
setItem: <T>(key: string, value: T) => Promise<void>;
|
|
1045
|
-
removeItem: (key: string) => Promise<void>;
|
|
1046
|
-
};
|
|
787
|
+
storage?: NotificationSettingsStorage;
|
|
1047
788
|
}): {
|
|
1048
789
|
/** All in-app notifications (newest last) */
|
|
1049
790
|
notifications: NotificationItem[];
|
|
@@ -1467,6 +1208,14 @@ interface UseSIWxSessionReturn {
|
|
|
1467
1208
|
/** Clear the last error */
|
|
1468
1209
|
clearError: () => void;
|
|
1469
1210
|
}
|
|
1211
|
+
/**
|
|
1212
|
+
* Random suffix for a session record ID.
|
|
1213
|
+
*
|
|
1214
|
+
* `Math.random` gave roughly 31 predictable bits. The signature, not this ID,
|
|
1215
|
+
* is what authenticates a SIWx session, so this was not an authentication
|
|
1216
|
+
* bypass — but an ID a consumer may key storage or a request on should not be
|
|
1217
|
+
* guessable, and the CSPRNG is already the convention everywhere else here.
|
|
1218
|
+
*/
|
|
1470
1219
|
declare function useSIWxSession(options?: UseSIWxSessionOptions): UseSIWxSessionReturn;
|
|
1471
1220
|
|
|
1472
1221
|
interface UseSignInWithXOptions {
|
|
@@ -1886,33 +1635,19 @@ interface UseUserOpStatusReturn {
|
|
|
1886
1635
|
/** Reset state */
|
|
1887
1636
|
reset: () => void;
|
|
1888
1637
|
}
|
|
1889
|
-
/**
|
|
1890
|
-
* Hook for tracking the lifecycle of an ERC-4337 UserOperation.
|
|
1891
|
-
*
|
|
1892
|
-
* @param options - Configuration for polling behavior
|
|
1893
|
-
* @returns UserOperation status, receipt, and lifecycle controls
|
|
1894
|
-
*/
|
|
1895
1638
|
declare function useUserOpStatus(options?: UseUserOpStatusOptions): UseUserOpStatusReturn;
|
|
1896
1639
|
|
|
1897
1640
|
/**
|
|
1898
1641
|
* useValidateDestination — address blackhole prevention hook.
|
|
1899
1642
|
*
|
|
1900
|
-
*
|
|
1901
|
-
*
|
|
1643
|
+
* The checks live in `@naculus/connect-appkit-core` (`validateDestination`),
|
|
1644
|
+
* shared with the Vue composable. This file only adds React and the
|
|
1645
|
+
* user-facing string for the machine-readable issue.
|
|
1902
1646
|
*
|
|
1903
|
-
* Level: "ok" | "warning" | "blocked"
|
|
1647
|
+
* Level: "ok" | "warning" | "blocked". "ok" means nothing wrong was found —
|
|
1648
|
+
* not that the destination is safe; see the core module for why.
|
|
1904
1649
|
*/
|
|
1905
|
-
|
|
1906
|
-
* What the four syntactic checks below found.
|
|
1907
|
-
*
|
|
1908
|
-
* `"ok"` was `"safe"`, which this function is in no position to say. It checks
|
|
1909
|
-
* that an address is non-empty, well-formed, and not the zero or a burn
|
|
1910
|
-
* address — nothing about whether the recipient is who the user thinks. It
|
|
1911
|
-
* cannot see an address-poisoning lookalike, a contract that will not release
|
|
1912
|
-
* the funds, or a known-malicious destination. Labelling that "safe" put a
|
|
1913
|
-
* green tick beside a scammer's address.
|
|
1914
|
-
*/
|
|
1915
|
-
type AddressValidationLevel = "ok" | "warning" | "blocked";
|
|
1650
|
+
|
|
1916
1651
|
interface AddressValidationResult {
|
|
1917
1652
|
isValid: boolean;
|
|
1918
1653
|
level: AddressValidationLevel;
|
|
@@ -1925,7 +1660,7 @@ interface UseValidateDestinationOptions {
|
|
|
1925
1660
|
interface UseValidateDestinationReturn {
|
|
1926
1661
|
validation: AddressValidationResult;
|
|
1927
1662
|
}
|
|
1928
|
-
declare function useValidateDestination({ address }: UseValidateDestinationOptions): UseValidateDestinationReturn;
|
|
1663
|
+
declare function useValidateDestination({ address, }: UseValidateDestinationOptions): UseValidateDestinationReturn;
|
|
1929
1664
|
|
|
1930
1665
|
declare function useViemClient(): {
|
|
1931
1666
|
publicClient: PublicClient | null;
|
|
@@ -2279,4 +2014,4 @@ declare const AppkitToggleGroup: StencilReactComponent<AppkitToggleGroup$1, Appk
|
|
|
2279
2014
|
type AppkitTooltipEvents = NonNullable<unknown>;
|
|
2280
2015
|
declare const AppkitTooltip: StencilReactComponent<AppkitTooltip$1, AppkitTooltipEvents, Components.AppkitTooltip>;
|
|
2281
2016
|
|
|
2282
|
-
export { type
|
|
2017
|
+
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 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, 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 };
|