@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/README.md +130 -0
- package/dist/{chunk-UXYKIMGZ.mjs → chunk-TACK3LJN.mjs} +180 -21
- package/dist/chunk-TACK3LJN.mjs.map +1 -0
- package/dist/{client-C1inywuT.d.mts → client-DyYGKWj3.d.mts} +321 -33
- package/dist/{client-C1inywuT.d.ts → client-DyYGKWj3.d.ts} +321 -33
- package/dist/index.d.mts +29 -16
- package/dist/index.d.ts +29 -16
- package/dist/index.js +1041 -249
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +861 -229
- package/dist/index.mjs.map +1 -1
- package/dist/provider-CNTZPPFz.d.ts +33 -0
- package/dist/provider-Ctr7HQHR.d.mts +33 -0
- package/dist/react.d.mts +4 -4
- package/dist/react.d.ts +4 -4
- package/dist/react.js.map +1 -1
- package/dist/react.mjs.map +1 -1
- package/dist/server.d.mts +10 -44
- package/dist/server.d.ts +10 -44
- package/dist/server.js +11 -8
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +11 -8
- package/dist/server.mjs.map +1 -1
- package/dist/wagmi.d.mts +5 -4
- package/dist/wagmi.d.ts +5 -4
- package/dist/wagmi.js +173 -23
- package/dist/wagmi.js.map +1 -1
- package/dist/wagmi.mjs +3 -2
- package/dist/wagmi.mjs.map +1 -1
- package/package.json +24 -11
- package/dist/chunk-UXYKIMGZ.mjs.map +0 -1
- package/dist/provider-Dgh51NRc.d.mts +0 -24
- package/dist/provider-q7M728Mn.d.ts +0 -24
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as AuthenticateOptions,
|
|
3
|
-
export { P as PasskeyProvider,
|
|
4
|
-
import { Address,
|
|
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:
|
|
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
|
|
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://
|
|
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
|
|
174
|
-
client:
|
|
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
|
|
223
|
-
* This
|
|
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
|
|
234
|
+
declare const ETHEREUM_MESSAGE_PREFIX = "\u0019Ethereum Signed Message:\n";
|
|
226
235
|
/**
|
|
227
|
-
*
|
|
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("\
|
|
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 };
|