@rhinestone/1auth 0.1.0 → 0.1.2

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.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { P as PasskeyProviderClient, W as WebAuthnSignature, I as IntentCall, S as SendIntentResult } from './client-C1inywuT.js';
2
- export { A as AuthenticateOptions, k as AuthenticateResult, B as BalanceRequirement, y as CloseOnStatus, C as CreateSigningRequestResponse, p as EIP712Domain, r as EIP712TypeField, q as EIP712Types, E as EmbedOptions, D as ExecuteIntentResponse, w as IntentQuote, x as IntentStatus, u as IntentTokenRequest, L as LoginOptions, j as LoginResult, M as MerchantSignedIntent, O as OrchestratorStatus, h as PasskeyCredential, a as PasskeyProviderConfig, z as PrepareIntentResponse, R as RegisterOptions, i as RegisterResult, v as SendIntentOptions, F as SendSwapOptions, G as SendSwapResult, l as SignMessageOptions, m as SignMessageResult, n as SignTypedDataOptions, o as SignTypedDataResult, e as SigningError, f as SigningErrorCode, b as SigningRequestOptions, g as SigningRequestStatus, c as SigningResult, d as SigningSuccess, H as SwapQuote, J as ThemeConfig, T as TransactionAction, t as TransactionDetails, s as TransactionFees, U as UserPasskeysResponse } from './client-C1inywuT.js';
3
- export { P as PasskeyProvider, a as PasskeyProviderOptions, c as createPasskeyProvider } from './provider-q7M728Mn.js';
4
- import { Address, LocalAccount, Chain, Transport, Hex, WalletClient, Hash } from 'viem';
1
+ import { O as OneAuthClient, I as IntentSigner, W as WebAuthnSignature, a as IntentCall, S as SendIntentResult } from './client-DyYGKWj3.js';
2
+ export { A as AuthenticateOptions, b as AuthenticateResult, B as BalanceRequirement, c as BatchIntentItem, d as BatchIntentItemResult, C as CloseOnStatus, e as ConnectResult, f as CreateSigningRequestResponse, D as DeveloperSignedIntent, E as EIP712Domain, g as EIP712TypeField, h as EIP712Types, i as EmbedOptions, j as ExecuteIntentResponse, k as IntentHistoryItem, l as IntentHistoryOptions, m as IntentHistoryResult, n as IntentQuote, o as IntentStatus, p as IntentTokenRequest, L as LoginOptions, q as LoginResult, M as MerchantSignedIntent, r as OrchestratorStatus, P as PasskeyCredential, s as PasskeyProviderConfig, t as PrepareBatchIntentResponse, u as PrepareIntentResponse, v as PreparedBatchIntent, R as RegisterOptions, w as RegisterResult, x as SendBatchIntentOptions, y as SendBatchIntentResult, z as SendIntentOptions, F as SendSwapOptions, G as SendSwapResult, H as SignMessageOptions, J as SignMessageResult, K as SignTypedDataOptions, N as SignTypedDataResult, Q as SigningError, T as SigningErrorCode, U as SigningRequestOptions, V as SigningRequestStatus, X as SigningResult, Y as SigningSuccess, Z as SwapQuote, _ as ThemeConfig, $ as TransactionAction, a0 as TransactionDetails, a1 as TransactionFees, a2 as UserPasskeysResponse } from './client-DyYGKWj3.js';
3
+ export { O as OneAuthProvider, a as OneAuthProviderOptions, P as PasskeyProvider, b as PasskeyProviderOptions, c as createOneAuthProvider, d as createPasskeyProvider } from './provider-CNTZPPFz.js';
4
+ import { LocalAccount, Address, Hex, Chain, Transport, WalletClient, Hash } from 'viem';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import * as React from 'react';
7
7
  export { getTokenAddress, getTokenDecimals } from '@rhinestone/sdk';
@@ -9,7 +9,7 @@ export { getTokenAddress, getTokenDecimals } from '@rhinestone/sdk';
9
9
  type PasskeyAccount = LocalAccount<"1auth"> & {
10
10
  username: string;
11
11
  };
12
- declare function createPasskeyAccount(client: PasskeyProviderClient, params: {
12
+ declare function createPasskeyAccount(client: OneAuthClient, params: {
13
13
  address: Address;
14
14
  username: string;
15
15
  }): PasskeyAccount;
@@ -22,12 +22,14 @@ interface PasskeyWalletClientConfig {
22
22
  accountAddress: Address;
23
23
  /** Username for the passkey provider */
24
24
  username: string;
25
- /** Base URL of the auth API */
26
- providerUrl: string;
25
+ /** Base URL of the auth API (defaults to https://passkey.1auth.box) */
26
+ providerUrl?: string;
27
27
  /** Client identifier for this application */
28
28
  clientId: string;
29
29
  /** Optional URL of the dialog UI */
30
30
  dialogUrl?: string;
31
+ /** Optional signer for developer-protected intents */
32
+ signIntent?: IntentSigner;
31
33
  /** Chain configuration */
32
34
  chain: Chain;
33
35
  /** Transport (e.g., http(), webSocket()) */
@@ -60,6 +62,13 @@ interface TransactionCall {
60
62
  interface SendCallsParams {
61
63
  /** Array of calls to execute */
62
64
  calls: TransactionCall[];
65
+ /** Optional chain id override */
66
+ chainId?: number;
67
+ /** Optional token requests for orchestrator output (what tokens/amounts to deliver) */
68
+ tokenRequests?: {
69
+ token: string;
70
+ amount: bigint;
71
+ }[];
63
72
  }
64
73
 
65
74
  /**
@@ -99,7 +108,7 @@ type PasskeyWalletClient = WalletClient & {
99
108
  * const walletClient = createPasskeyWalletClient({
100
109
  * accountAddress: '0x...',
101
110
  * username: 'alice',
102
- * providerUrl: 'https://auth.example.com',
111
+ * providerUrl: 'https://passkey.1auth.box',
103
112
  * clientId: 'my-dapp',
104
113
  * chain: baseSepolia,
105
114
  * transport: http(),
@@ -170,8 +179,8 @@ interface BatchQueueContextValue {
170
179
  */
171
180
  declare function useBatchQueue(): BatchQueueContextValue;
172
181
  interface BatchQueueProviderProps {
173
- /** The PasskeyProviderClient instance */
174
- client: PasskeyProviderClient;
182
+ /** The OneAuthClient instance */
183
+ client: OneAuthClient;
175
184
  /** Optional username for localStorage persistence key */
176
185
  username?: string;
177
186
  /** Children to render */
@@ -219,18 +228,22 @@ declare function getTokenSymbol(tokenAddress: Address, chainId: number): string;
219
228
  declare function isTokenAddressSupported(tokenAddress: Address, chainId: number): boolean;
220
229
 
221
230
  /**
222
- * The domain separator prefix used for passkey message signing.
223
- * This ensures message signatures cannot be replayed for transaction signing.
231
+ * The EIP-191 prefix used for personal message signing.
232
+ * This is the standard Ethereum message prefix for `personal_sign`.
224
233
  */
225
- declare const PASSKEY_MESSAGE_PREFIX = "\u0019Passkey Signed Message:\n";
234
+ declare const ETHEREUM_MESSAGE_PREFIX = "\u0019Ethereum Signed Message:\n";
226
235
  /**
227
- * Hash a message with the passkey domain separator.
236
+ * @deprecated Use ETHEREUM_MESSAGE_PREFIX instead. Kept for backwards compatibility.
237
+ */
238
+ declare const PASSKEY_MESSAGE_PREFIX = "\u0019Ethereum Signed Message:\n";
239
+ /**
240
+ * Hash a message with the EIP-191 Ethereum prefix.
228
241
  *
229
242
  * This is the same hashing function used by the passkey sign dialog.
230
243
  * Use this to verify that the `signedHash` returned from `signMessage()`
231
244
  * matches your original message.
232
245
  *
233
- * Format: keccak256("\x19Passkey Signed Message:\n" + len + message)
246
+ * Format: keccak256("\x19Ethereum Signed Message:\n" + len + message)
234
247
  *
235
248
  * @example
236
249
  * ```typescript
@@ -264,4 +277,4 @@ declare function hashMessage(message: string): `0x${string}`;
264
277
  */
265
278
  declare function verifyMessageHash(message: string, signedHash: string | undefined): boolean;
266
279
 
267
- export { type BatchQueueContextValue, BatchQueueProvider, type BatchQueueProviderProps, BatchQueueWidget, type BatchQueueWidgetProps, type BatchedCall, type ChainFilterOptions, IntentCall, PASSKEY_MESSAGE_PREFIX, type PasskeyAccount, PasskeyProviderClient, type PasskeyWalletClient, type PasskeyWalletClientConfig, type SendCallsParams, SendIntentResult, type TokenConfig, type TransactionCall, WebAuthnSignature, createPasskeyAccount, createPasskeyWalletClient, encodeWebAuthnSignature, getAllSupportedChainsAndTokens, getChainById, getChainExplorerUrl, getChainName, getChainRpcUrl, getSupportedChainIds, getSupportedChains, getSupportedTokenSymbols, getSupportedTokens, getTokenSymbol, hashCalls, hashMessage, isTestnet, isTokenAddressSupported, resolveTokenAddress, useBatchQueue, verifyMessageHash };
280
+ export { type BatchQueueContextValue, BatchQueueProvider, type BatchQueueProviderProps, BatchQueueWidget, type BatchQueueWidgetProps, type BatchedCall, type ChainFilterOptions, ETHEREUM_MESSAGE_PREFIX, IntentCall, IntentSigner, OneAuthClient, PASSKEY_MESSAGE_PREFIX, type PasskeyAccount, OneAuthClient as PasskeyProviderClient, type PasskeyWalletClient, type PasskeyWalletClientConfig, type SendCallsParams, SendIntentResult, type TokenConfig, type TransactionCall, WebAuthnSignature, createPasskeyAccount, createPasskeyWalletClient, encodeWebAuthnSignature, getAllSupportedChainsAndTokens, getChainById, getChainExplorerUrl, getChainName, getChainRpcUrl, getSupportedChainIds, getSupportedChains, getSupportedTokenSymbols, getSupportedTokens, getTokenSymbol, hashCalls, hashMessage, isTestnet, isTokenAddressSupported, resolveTokenAddress, useBatchQueue, verifyMessageHash };