@rhinestone/1auth 0.7.8-dev.0 → 0.8.1

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.
Files changed (43) hide show
  1. package/dist/chunk-IX45E5LE.mjs +6135 -0
  2. package/dist/chunk-IX45E5LE.mjs.map +1 -0
  3. package/dist/chunk-ZDW2LY6H.mjs +116 -0
  4. package/dist/chunk-ZDW2LY6H.mjs.map +1 -0
  5. package/dist/{client-Dn6mL7BZ.d.ts → client-B0vb_deA.d.mts} +26 -14
  6. package/dist/{client-C8QSA1th.d.mts → client-CPt1hn4_.d.ts} +26 -14
  7. package/dist/errors-Blx9IVF_.d.mts +16 -0
  8. package/dist/errors-Cg605N0t.d.ts +16 -0
  9. package/dist/headless.d.mts +5 -10
  10. package/dist/headless.d.ts +5 -10
  11. package/dist/headless.js +74 -24
  12. package/dist/headless.js.map +1 -1
  13. package/dist/headless.mjs +74 -24
  14. package/dist/headless.mjs.map +1 -1
  15. package/dist/index.d.mts +8 -7
  16. package/dist/index.d.ts +8 -7
  17. package/dist/index.js +678 -220
  18. package/dist/index.js.map +1 -1
  19. package/dist/index.mjs +68 -5271
  20. package/dist/index.mjs.map +1 -1
  21. package/dist/{provider-CJv38fIK.d.mts → provider-CNDrBzGs.d.mts} +2 -2
  22. package/dist/{provider-BsVmPgkQ.d.ts → provider-DwZPA2N1.d.ts} +2 -2
  23. package/dist/react.d.mts +3 -2
  24. package/dist/react.d.ts +3 -2
  25. package/dist/react.js +61 -1
  26. package/dist/react.js.map +1 -1
  27. package/dist/react.mjs +6 -1
  28. package/dist/react.mjs.map +1 -1
  29. package/dist/server.d.mts +2 -2
  30. package/dist/server.d.ts +2 -2
  31. package/dist/{types-Dzm5lZK-.d.mts → types-BN6cCuAd.d.mts} +88 -69
  32. package/dist/{types-Dzm5lZK-.d.ts → types-BN6cCuAd.d.ts} +88 -69
  33. package/dist/{verify-0VXQpQBJ.d.mts → verify-CEzkfM92.d.mts} +1 -1
  34. package/dist/{verify-9UgxLSdo.d.ts → verify-DhEkGnym.d.ts} +1 -1
  35. package/dist/wagmi.d.mts +3 -3
  36. package/dist/wagmi.d.ts +3 -3
  37. package/dist/wagmi.js +116 -26
  38. package/dist/wagmi.js.map +1 -1
  39. package/dist/wagmi.mjs +3 -1
  40. package/dist/wagmi.mjs.map +1 -1
  41. package/package.json +1 -1
  42. package/dist/chunk-E4YZS7FZ.mjs +0 -565
  43. package/dist/chunk-E4YZS7FZ.mjs.map +0 -1
@@ -226,6 +226,12 @@ interface PasskeyProviderConfig {
226
226
  * can use this callback to create spans/logs in their own OTEL setup.
227
227
  */
228
228
  telemetry?: OneAuthTelemetryConfig;
229
+ /**
230
+ * Called when the trusted passkey dialog invalidates the current application
231
+ * session, including deployment-forced logout. Use this to clear host-app
232
+ * in-memory auth state that cannot be inferred from localStorage alone.
233
+ */
234
+ onDisconnect?: () => void;
229
235
  /**
230
236
  * When `true`, the SDK schedules a one-time {@link OneAuthClient.prewarm} on
231
237
  * an idle callback after construction — loading the dialog bundle into a
@@ -395,6 +401,40 @@ interface SignMessageOptions {
395
401
  /** Override the client's blind signing setting for this request. */
396
402
  blind_signing?: boolean;
397
403
  }
404
+ /** A sanitized candidate failure returned by intent preparation. */
405
+ interface OneAuthCandidateError {
406
+ code?: string;
407
+ message?: string;
408
+ details?: OneAuthErrorDetails;
409
+ }
410
+ /** Provider and orchestrator diagnostics safe to expose to the integrating app. */
411
+ interface OneAuthErrorDetails {
412
+ /** Rhinestone request trace ID for support and log correlation. */
413
+ traceId?: string;
414
+ /** Machine-readable Rhinestone error code, when supplied. */
415
+ providerCode?: string;
416
+ /** HTTP status returned by the upstream provider, when supplied. */
417
+ statusCode?: number;
418
+ /** Execution-error category returned by the orchestrator. */
419
+ errorType?: string;
420
+ /** Tenderly or provider simulation links for failed execution. */
421
+ simulationUrls?: string[];
422
+ /** Human-readable reason supplied by a prepare-stage failure. */
423
+ reason?: string;
424
+ /** Sanitized alternatives returned when no preparation candidate succeeded. */
425
+ candidateErrors?: OneAuthCandidateError[];
426
+ }
427
+ /** Common structured error returned by signing and intent operations. */
428
+ interface OneAuthResultError<Code extends string = string> {
429
+ code: Code;
430
+ message: string;
431
+ details?: OneAuthErrorDetails;
432
+ }
433
+ /** Runtime signing codes accepted from redirects, HTTP results, and dialog messages. */
434
+ declare const SIGNING_ERROR_CODES: readonly ["USER_REJECTED", "EXPIRED", "INVALID_REQUEST", "NETWORK_ERROR", "POPUP_BLOCKED", "SIGNING_FAILED", "UNKNOWN"];
435
+ type SigningErrorCode = (typeof SIGNING_ERROR_CODES)[number];
436
+ /** Returns whether an untrusted value is a public signing error code. */
437
+ declare function isSigningErrorCode(value: unknown): value is SigningErrorCode;
398
438
  /**
399
439
  * Base result for all signing operations (message signing, typed data signing).
400
440
  */
@@ -407,10 +447,7 @@ interface SigningResultBase {
407
447
  /** Passkey credentials used for signing */
408
448
  passkey?: PasskeyCredentials;
409
449
  /** Error details if failed */
410
- error?: {
411
- code: SigningErrorCode;
412
- message: string;
413
- };
450
+ error?: OneAuthResultError<SigningErrorCode>;
414
451
  }
415
452
  /**
416
453
  * Result of signMessage
@@ -478,15 +515,6 @@ interface SigningRequestOptions {
478
515
  /** Override the client's blind signing setting for this request. */
479
516
  blind_signing?: boolean;
480
517
  }
481
- interface PasskeyCredential {
482
- id: string;
483
- deviceName: string | null;
484
- publicKeyX: string;
485
- publicKeyY: string;
486
- }
487
- interface UserPasskeysResponse {
488
- passkeys: PasskeyCredential[];
489
- }
490
518
  interface WebAuthnSignature {
491
519
  authenticatorData: string;
492
520
  clientDataJSON: string;
@@ -496,10 +524,13 @@ interface WebAuthnSignature {
496
524
  s: string;
497
525
  topOrigin: string | null;
498
526
  }
527
+ /** Passkey identity returned after server-side verification. */
499
528
  interface PasskeyCredentials {
500
529
  credentialId: string;
501
530
  publicKeyX: string;
502
531
  publicKeyY: string;
532
+ /** Server-owned on-chain slot. Optional for compatibility with pre-slot SDK consumers. */
533
+ keyId?: number;
503
534
  }
504
535
  interface SigningSuccess {
505
536
  success: true;
@@ -513,7 +544,6 @@ interface SigningSuccess {
513
544
  /** Intent ID - present for intent signing (after execute in dialog) */
514
545
  intentId?: string;
515
546
  }
516
- type SigningErrorCode = "USER_REJECTED" | "EXPIRED" | "INVALID_REQUEST" | "NETWORK_ERROR" | "POPUP_BLOCKED" | "SIGNING_FAILED" | "UNKNOWN";
517
547
  interface EmbedOptions {
518
548
  container: HTMLElement;
519
549
  width?: string;
@@ -524,10 +554,7 @@ interface EmbedOptions {
524
554
  interface SigningError {
525
555
  success: false;
526
556
  requestId?: string;
527
- error: {
528
- code: SigningErrorCode;
529
- message: string;
530
- };
557
+ error: OneAuthResultError<SigningErrorCode>;
531
558
  }
532
559
  type SigningResult = SigningSuccess | SigningError;
533
560
  interface CreateSigningRequestResponse {
@@ -540,10 +567,7 @@ interface SigningRequestStatus {
540
567
  id: string;
541
568
  status: "PENDING" | "COMPLETED" | "REJECTED" | "EXPIRED" | "FAILED";
542
569
  signature?: WebAuthnSignature;
543
- error?: {
544
- code: SigningErrorCode;
545
- message: string;
546
- };
570
+ error?: OneAuthResultError<SigningErrorCode>;
547
571
  }
548
572
  /**
549
573
  * Low-level sponsorship config: caller supplies callbacks that produce tokens.
@@ -680,6 +704,14 @@ interface IntentTokenRequest {
680
704
  /** Amount in base units (use parseUnits for decimals) */
681
705
  amount: bigint;
682
706
  }
707
+ /**
708
+ * Funding policy for an intent.
709
+ *
710
+ * - `required`: app sponsorship must succeed or the intent fails.
711
+ * - `preferred`: try app sponsorship, then explicitly re-quote as self-funded.
712
+ * - `disabled`: quote and submit as self-funded without an extension grant.
713
+ */
714
+ type SponsorshipMode = "required" | "preferred" | "disabled";
683
715
  /**
684
716
  * Options for sendIntent
685
717
  */
@@ -716,12 +748,12 @@ interface SendIntentOptions {
716
748
  /** Poll interval for transaction hash in ms. */
717
749
  hashIntervalMs?: number;
718
750
  /**
719
- * Whether to request sponsorship (app pays gas) for this intent.
720
- * Defaults to `true`. When `false`, the intent authenticates with the
721
- * app's JWT but pays its own gas from source assets — no extension
722
- * token is fetched. Requires `sponsorship` to be configured on the
723
- * client either way; there is no anonymous fallback.
751
+ * Funding policy. Defaults to `required`, so sponsorship failures never
752
+ * silently charge the user. Use `preferred` to opt into a reviewed,
753
+ * self-funded fallback, or `disabled` to request self-funding directly.
724
754
  */
755
+ sponsorshipMode?: SponsorshipMode;
756
+ /** @deprecated Use `sponsorshipMode: "disabled"` instead of `sponsor: false`. */
725
757
  sponsor?: boolean;
726
758
  /** Override the client's blind signing setting for this request. */
727
759
  blind_signing?: boolean;
@@ -778,12 +810,7 @@ interface SendIntentResult {
778
810
  /** Operation ID from orchestrator */
779
811
  operationId?: string;
780
812
  /** Error details if failed */
781
- error?: {
782
- code: string;
783
- message: string;
784
- /** Structured provider details, when the auth service returns them. */
785
- details?: unknown;
786
- };
813
+ error?: OneAuthResultError;
787
814
  }
788
815
  /**
789
816
  * Prepare intent response from auth service
@@ -828,12 +855,7 @@ interface ExecuteIntentResponse {
828
855
  transactionHash?: string;
829
856
  /** Transaction result data needed for waiting via POST /api/intent/wait */
830
857
  transactionResult?: unknown;
831
- error?: {
832
- code: string;
833
- message: string;
834
- /** Structured provider details, when the auth service returns them. */
835
- details?: unknown;
836
- };
858
+ error?: OneAuthResultError;
837
859
  }
838
860
  /**
839
861
  * EIP-712 Domain parameters
@@ -956,11 +978,9 @@ interface BatchIntentItem {
956
978
  moduleAddress: string;
957
979
  initData?: string;
958
980
  };
959
- /**
960
- * Whether to request sponsorship for this item. Defaults to `true`.
961
- * When `false`, the item authenticates with the app's JWT but no
962
- * extension token is fetched for it.
963
- */
981
+ /** Funding policy for this item. Defaults to `required`. */
982
+ sponsorshipMode?: SponsorshipMode;
983
+ /** @deprecated Use `sponsorshipMode: "disabled"` instead of `sponsor: false`. */
964
984
  sponsor?: boolean;
965
985
  }
966
986
  /**
@@ -1118,23 +1138,16 @@ interface RequestConsentResult {
1118
1138
  * key may do. This triggers a passkey-signed management transaction
1119
1139
  * that installs the SmartSession validator and registers the session.
1120
1140
  */
1121
- interface InstallSmartSessionOptions {
1141
+ interface InstallSmartSessionBaseOptions {
1122
1142
  /** Account address of the owner — the sole account identity. */
1123
1143
  accountAddress: string;
1124
1144
  /** Target chain to install the validator on. */
1125
1145
  targetChain: number;
1126
1146
  /** Public address of the ECDSA session-key the app holds in localStorage. */
1127
1147
  sessionKeyAddress: `0x${string}`;
1128
- /**
1129
- * Per-contract permission specs from `definePermissions()`. 1auth
1130
- * re-validates server-side against an allowlist before asking the
1131
- * user to passkey-sign.
1132
- */
1148
+ /** Per-contract permission specs re-validated by 1auth before signing. */
1133
1149
  permissions: Permission<Abi>[];
1134
- /**
1135
- * Cross-chain asset movement permits. The upstream SmartSession SDK expands
1136
- * these into Permit2 claim policy plus fallback guardrails for bridge fills.
1137
- */
1150
+ /** Cross-chain asset movement permits used by the SmartSession policies. */
1138
1151
  crossChainPermits?: CrossChainPermit[];
1139
1152
  /** Unix seconds. Session is invalid after this time. */
1140
1153
  validUntil?: number;
@@ -1142,16 +1155,20 @@ interface InstallSmartSessionOptions {
1142
1155
  validAfter?: number;
1143
1156
  /** Optional max number of uses across the session lifetime. */
1144
1157
  maxUses?: number;
1145
- /**
1146
- * Passkey EIP-712 signature over `sessionEnable.typedData`.
1147
- * Omit on the first request to discover whether this exact
1148
- * permission needs owner authorization; include on the second
1149
- * request to receive the on-chain enable call.
1150
- */
1151
- enableSessionSignature?: `0x${string}` | WebAuthnSignature;
1152
1158
  /** Optional human label shown in the install dialog. */
1153
1159
  label?: string;
1154
1160
  }
1161
+ /**
1162
+ * A WebAuthn enable signature must name the exact credential that produced it.
1163
+ * Unsigned discovery/preflight requests intentionally omit both fields.
1164
+ */
1165
+ type InstallSmartSessionOptions = InstallSmartSessionBaseOptions & ({
1166
+ enableSessionSignature: WebAuthnSignature;
1167
+ credentialId: string;
1168
+ } | {
1169
+ enableSessionSignature?: `0x${string}` | undefined;
1170
+ credentialId?: never;
1171
+ });
1155
1172
  interface SmartSessionEnableRequest {
1156
1173
  alreadyEnabled: boolean;
1157
1174
  /**
@@ -1386,8 +1403,8 @@ interface HeadlessIntentOptions {
1386
1403
  sourceChainId?: number;
1387
1404
  /** Persisted handle from `installSmartSession`; required for SmartSession headless quotes. */
1388
1405
  sessionKeyHandle?: SessionKeyHandle;
1389
- /** Whether to request sponsorship for this intent. Defaults to `true`. */
1390
- sponsor?: boolean;
1406
+ /** Funding policy chosen at prepare time. Defaults to `required`. */
1407
+ sponsorshipMode?: SponsorshipMode;
1391
1408
  }
1392
1409
  /**
1393
1410
  * Result of {@link OneAuthHeadlessClient.prepareIntent}. The host app
@@ -1421,11 +1438,13 @@ interface HeadlessPrepareResult {
1421
1438
  accountAddress: `0x${string}`;
1422
1439
  /** Cost / token-requirement breakdown from the orchestrator quote. */
1423
1440
  quote?: IntentQuote;
1441
+ /** Funding mode of the authoritative quote. */
1442
+ sponsorshipMode?: "sponsored" | "self-funded";
1424
1443
  }
1425
1444
  /**
1426
- * Options for {@link OneAuthHeadlessClient.submitIntent}. The caller
1427
- * supplies pre-encoded validator-prefixed signatures; 1auth forwards
1428
- * them unchanged to the orchestrator.
1445
+ * Options for {@link OneAuthHeadlessClient.submitIntent}. The caller supplies
1446
+ * pre-encoded validator-prefixed signatures; 1auth forwards them unchanged.
1447
+ * Funding mode and authorization come from the authoritative prepare result.
1429
1448
  */
1430
1449
  interface HeadlessSubmitOptions {
1431
1450
  /** Echoed verbatim from the prepare result. */
@@ -1443,8 +1462,8 @@ interface HeadlessSubmitOptions {
1443
1462
  destinationSignature: `0x${string}`;
1444
1463
  /** Extra SmartSession signature required by SAME_CHAIN / INTENT_EXECUTOR execution. */
1445
1464
  targetExecutionSignature?: `0x${string}`;
1446
- /** Whether to request sponsorship at submit time. Defaults to `true`. */
1447
- sponsor?: boolean;
1465
+ /** Funding mode returned by prepareIntent; sponsored submit mints a fresh grant. */
1466
+ sponsorshipMode: "sponsored" | "self-funded";
1448
1467
  }
1449
1468
  /** Result of {@link OneAuthHeadlessClient.submitIntent}. */
1450
1469
  interface HeadlessSubmitResult {
@@ -1467,4 +1486,4 @@ interface HeadlessIntentStatusResult {
1467
1486
  transactionHash?: string;
1468
1487
  }
1469
1488
 
1470
- export { type IntentQuote as $, type AuthResult as A, type AuthenticateOptions as B, type CloseOnStatus as C, type AuthenticateResult as D, type EmbedOptions as E, type SigningResultBase as F, type SignMessageOptions as G, type HeadlessIntentOptions as H, type InstallSmartSessionOptions as I, type SignMessageResult as J, type SignTypedDataOptions as K, type LoginWithModalOptions as L, type SignTypedDataResult as M, type EIP712Domain as N, type EIP712Types as O, type PasskeyProviderConfig as P, type EIP712TypeField as Q, type TransactionAction as R, type SponsorshipConfig as S, type ThemeConfig as T, type UserPasskeysResponse as U, type TransactionFees as V, type WebAuthnSignature as W, type BalanceRequirement as X, type TransactionDetails as Y, type IntentTokenRequest as Z, type SendIntentOptions as _, type HeadlessPrepareResult as a, type IntentStatus as a0, type OrchestratorStatus as a1, type PrepareIntentResponse as a2, type ExecuteIntentResponse as a3, type IntentHistoryOptions as a4, type IntentHistoryItem as a5, type IntentHistoryResult as a6, type GetAssetsOptions as a7, type AssetBalance as a8, type AssetBalanceBucket as a9, type OneAuthTelemetryEvent as aA, type OneAuthTelemetryEventName as aB, type OneAuthTelemetryFlow as aC, type OneAuthTelemetryTraceContext as aD, type AssetsResponse as aa, type ConsentField as ab, type ConsentData as ac, type CheckConsentOptions as ad, type CheckConsentResult as ae, type RequestConsentOptions as af, type RequestConsentResult as ag, type GrantPermissionsOptions as ah, type GrantPermissionsResult as ai, type ListSessionGrantsOptions as aj, type ListSessionGrantsResult as ak, type SessionGrantRecord as al, type SessionGrantChain as am, type GrantPermissionContractMetadata as an, type SmartSessionPolicy as ao, type BatchIntentItem as ap, type SendBatchIntentOptions as aq, type SendBatchIntentResult as ar, type BatchIntentItemResult as as, type PreparedBatchIntent as at, type PrepareBatchIntentResponse as au, type SponsorshipCallbackConfig as av, type SponsorshipUrlConfig as aw, type OneAuthTelemetryAttributeValue as ax, type OneAuthTelemetryAttributes as ay, type OneAuthTelemetryConfig as az, type HeadlessSubmitOptions as b, type HeadlessSubmitResult as c, type HeadlessIntentStatusResult as d, type InstallSmartSessionResult as e, type SessionKeyHandle as f, type SmartSessionEnableRequest as g, type SignerType as h, type IntentCall as i, type SendIntentResult as j, createCrossChainPermission as k, type CreateCrossChainPermissionInput as l, type CrossChainPermit as m, type CrossChainSettlementLayer as n, type SigningRequestOptions as o, type SigningResult as p, type SigningSuccess as q, type SigningError as r, type SigningErrorCode as s, type CreateSigningRequestResponse as t, type SigningRequestStatus as u, type PasskeyCredential as v, type AuthFlow as w, type AuthWithModalOptions as x, type CreateAccountWithModalOptions as y, type ConnectResult as z };
1489
+ export { type OneAuthCandidateError as $, type AuthResult as A, type CreateAccountWithModalOptions as B, type CloseOnStatus as C, type ConnectResult as D, type EmbedOptions as E, type AuthenticateOptions as F, type AuthenticateResult as G, type HeadlessIntentOptions as H, type InstallSmartSessionOptions as I, type SigningResultBase as J, type SignMessageOptions as K, type LoginWithModalOptions as L, type SignMessageResult as M, type SignTypedDataOptions as N, type SignTypedDataResult as O, type PasskeyProviderConfig as P, type EIP712Domain as Q, type EIP712Types as R, type SponsorshipConfig as S, type ThemeConfig as T, type EIP712TypeField as U, type TransactionAction as V, type WebAuthnSignature as W, type TransactionFees as X, type BalanceRequirement as Y, type TransactionDetails as Z, type OneAuthErrorDetails as _, type HeadlessPrepareResult as a, type OneAuthResultError as a0, type IntentTokenRequest as a1, type SendIntentOptions as a2, type IntentQuote as a3, type IntentStatus as a4, type OrchestratorStatus as a5, type PrepareIntentResponse as a6, type ExecuteIntentResponse as a7, type IntentHistoryOptions as a8, type IntentHistoryItem as a9, type SponsorshipUrlConfig as aA, type OneAuthTelemetryAttributeValue as aB, type OneAuthTelemetryAttributes as aC, type OneAuthTelemetryConfig as aD, type OneAuthTelemetryEvent as aE, type OneAuthTelemetryEventName as aF, type OneAuthTelemetryFlow as aG, type OneAuthTelemetryTraceContext as aH, type IntentHistoryResult as aa, type GetAssetsOptions as ab, type AssetBalance as ac, type AssetBalanceBucket as ad, type AssetsResponse as ae, type ConsentField as af, type ConsentData as ag, type CheckConsentOptions as ah, type CheckConsentResult as ai, type RequestConsentOptions as aj, type RequestConsentResult as ak, type GrantPermissionsOptions as al, type GrantPermissionsResult as am, type ListSessionGrantsOptions as an, type ListSessionGrantsResult as ao, type SessionGrantRecord as ap, type SessionGrantChain as aq, type GrantPermissionContractMetadata as ar, type SmartSessionPolicy as as, type BatchIntentItem as at, type SendBatchIntentOptions as au, type SendBatchIntentResult as av, type BatchIntentItemResult as aw, type PreparedBatchIntent as ax, type PrepareBatchIntentResponse as ay, type SponsorshipCallbackConfig as az, type HeadlessSubmitOptions as b, type HeadlessSubmitResult as c, type HeadlessIntentStatusResult as d, type InstallSmartSessionResult as e, type SessionKeyHandle as f, type SmartSessionEnableRequest as g, type SignerType as h, type IntentCall as i, type SendIntentResult as j, SIGNING_ERROR_CODES as k, isSigningErrorCode as l, createCrossChainPermission as m, type CreateCrossChainPermissionInput as n, type CrossChainPermit as o, type CrossChainSettlementLayer as p, type SigningRequestOptions as q, type SigningResult as r, type SigningSuccess as s, type SigningError as t, type SigningErrorCode as u, type PasskeyCredentials as v, type CreateSigningRequestResponse as w, type SigningRequestStatus as x, type AuthFlow as y, type AuthWithModalOptions as z };
@@ -226,6 +226,12 @@ interface PasskeyProviderConfig {
226
226
  * can use this callback to create spans/logs in their own OTEL setup.
227
227
  */
228
228
  telemetry?: OneAuthTelemetryConfig;
229
+ /**
230
+ * Called when the trusted passkey dialog invalidates the current application
231
+ * session, including deployment-forced logout. Use this to clear host-app
232
+ * in-memory auth state that cannot be inferred from localStorage alone.
233
+ */
234
+ onDisconnect?: () => void;
229
235
  /**
230
236
  * When `true`, the SDK schedules a one-time {@link OneAuthClient.prewarm} on
231
237
  * an idle callback after construction — loading the dialog bundle into a
@@ -395,6 +401,40 @@ interface SignMessageOptions {
395
401
  /** Override the client's blind signing setting for this request. */
396
402
  blind_signing?: boolean;
397
403
  }
404
+ /** A sanitized candidate failure returned by intent preparation. */
405
+ interface OneAuthCandidateError {
406
+ code?: string;
407
+ message?: string;
408
+ details?: OneAuthErrorDetails;
409
+ }
410
+ /** Provider and orchestrator diagnostics safe to expose to the integrating app. */
411
+ interface OneAuthErrorDetails {
412
+ /** Rhinestone request trace ID for support and log correlation. */
413
+ traceId?: string;
414
+ /** Machine-readable Rhinestone error code, when supplied. */
415
+ providerCode?: string;
416
+ /** HTTP status returned by the upstream provider, when supplied. */
417
+ statusCode?: number;
418
+ /** Execution-error category returned by the orchestrator. */
419
+ errorType?: string;
420
+ /** Tenderly or provider simulation links for failed execution. */
421
+ simulationUrls?: string[];
422
+ /** Human-readable reason supplied by a prepare-stage failure. */
423
+ reason?: string;
424
+ /** Sanitized alternatives returned when no preparation candidate succeeded. */
425
+ candidateErrors?: OneAuthCandidateError[];
426
+ }
427
+ /** Common structured error returned by signing and intent operations. */
428
+ interface OneAuthResultError<Code extends string = string> {
429
+ code: Code;
430
+ message: string;
431
+ details?: OneAuthErrorDetails;
432
+ }
433
+ /** Runtime signing codes accepted from redirects, HTTP results, and dialog messages. */
434
+ declare const SIGNING_ERROR_CODES: readonly ["USER_REJECTED", "EXPIRED", "INVALID_REQUEST", "NETWORK_ERROR", "POPUP_BLOCKED", "SIGNING_FAILED", "UNKNOWN"];
435
+ type SigningErrorCode = (typeof SIGNING_ERROR_CODES)[number];
436
+ /** Returns whether an untrusted value is a public signing error code. */
437
+ declare function isSigningErrorCode(value: unknown): value is SigningErrorCode;
398
438
  /**
399
439
  * Base result for all signing operations (message signing, typed data signing).
400
440
  */
@@ -407,10 +447,7 @@ interface SigningResultBase {
407
447
  /** Passkey credentials used for signing */
408
448
  passkey?: PasskeyCredentials;
409
449
  /** Error details if failed */
410
- error?: {
411
- code: SigningErrorCode;
412
- message: string;
413
- };
450
+ error?: OneAuthResultError<SigningErrorCode>;
414
451
  }
415
452
  /**
416
453
  * Result of signMessage
@@ -478,15 +515,6 @@ interface SigningRequestOptions {
478
515
  /** Override the client's blind signing setting for this request. */
479
516
  blind_signing?: boolean;
480
517
  }
481
- interface PasskeyCredential {
482
- id: string;
483
- deviceName: string | null;
484
- publicKeyX: string;
485
- publicKeyY: string;
486
- }
487
- interface UserPasskeysResponse {
488
- passkeys: PasskeyCredential[];
489
- }
490
518
  interface WebAuthnSignature {
491
519
  authenticatorData: string;
492
520
  clientDataJSON: string;
@@ -496,10 +524,13 @@ interface WebAuthnSignature {
496
524
  s: string;
497
525
  topOrigin: string | null;
498
526
  }
527
+ /** Passkey identity returned after server-side verification. */
499
528
  interface PasskeyCredentials {
500
529
  credentialId: string;
501
530
  publicKeyX: string;
502
531
  publicKeyY: string;
532
+ /** Server-owned on-chain slot. Optional for compatibility with pre-slot SDK consumers. */
533
+ keyId?: number;
503
534
  }
504
535
  interface SigningSuccess {
505
536
  success: true;
@@ -513,7 +544,6 @@ interface SigningSuccess {
513
544
  /** Intent ID - present for intent signing (after execute in dialog) */
514
545
  intentId?: string;
515
546
  }
516
- type SigningErrorCode = "USER_REJECTED" | "EXPIRED" | "INVALID_REQUEST" | "NETWORK_ERROR" | "POPUP_BLOCKED" | "SIGNING_FAILED" | "UNKNOWN";
517
547
  interface EmbedOptions {
518
548
  container: HTMLElement;
519
549
  width?: string;
@@ -524,10 +554,7 @@ interface EmbedOptions {
524
554
  interface SigningError {
525
555
  success: false;
526
556
  requestId?: string;
527
- error: {
528
- code: SigningErrorCode;
529
- message: string;
530
- };
557
+ error: OneAuthResultError<SigningErrorCode>;
531
558
  }
532
559
  type SigningResult = SigningSuccess | SigningError;
533
560
  interface CreateSigningRequestResponse {
@@ -540,10 +567,7 @@ interface SigningRequestStatus {
540
567
  id: string;
541
568
  status: "PENDING" | "COMPLETED" | "REJECTED" | "EXPIRED" | "FAILED";
542
569
  signature?: WebAuthnSignature;
543
- error?: {
544
- code: SigningErrorCode;
545
- message: string;
546
- };
570
+ error?: OneAuthResultError<SigningErrorCode>;
547
571
  }
548
572
  /**
549
573
  * Low-level sponsorship config: caller supplies callbacks that produce tokens.
@@ -680,6 +704,14 @@ interface IntentTokenRequest {
680
704
  /** Amount in base units (use parseUnits for decimals) */
681
705
  amount: bigint;
682
706
  }
707
+ /**
708
+ * Funding policy for an intent.
709
+ *
710
+ * - `required`: app sponsorship must succeed or the intent fails.
711
+ * - `preferred`: try app sponsorship, then explicitly re-quote as self-funded.
712
+ * - `disabled`: quote and submit as self-funded without an extension grant.
713
+ */
714
+ type SponsorshipMode = "required" | "preferred" | "disabled";
683
715
  /**
684
716
  * Options for sendIntent
685
717
  */
@@ -716,12 +748,12 @@ interface SendIntentOptions {
716
748
  /** Poll interval for transaction hash in ms. */
717
749
  hashIntervalMs?: number;
718
750
  /**
719
- * Whether to request sponsorship (app pays gas) for this intent.
720
- * Defaults to `true`. When `false`, the intent authenticates with the
721
- * app's JWT but pays its own gas from source assets — no extension
722
- * token is fetched. Requires `sponsorship` to be configured on the
723
- * client either way; there is no anonymous fallback.
751
+ * Funding policy. Defaults to `required`, so sponsorship failures never
752
+ * silently charge the user. Use `preferred` to opt into a reviewed,
753
+ * self-funded fallback, or `disabled` to request self-funding directly.
724
754
  */
755
+ sponsorshipMode?: SponsorshipMode;
756
+ /** @deprecated Use `sponsorshipMode: "disabled"` instead of `sponsor: false`. */
725
757
  sponsor?: boolean;
726
758
  /** Override the client's blind signing setting for this request. */
727
759
  blind_signing?: boolean;
@@ -778,12 +810,7 @@ interface SendIntentResult {
778
810
  /** Operation ID from orchestrator */
779
811
  operationId?: string;
780
812
  /** Error details if failed */
781
- error?: {
782
- code: string;
783
- message: string;
784
- /** Structured provider details, when the auth service returns them. */
785
- details?: unknown;
786
- };
813
+ error?: OneAuthResultError;
787
814
  }
788
815
  /**
789
816
  * Prepare intent response from auth service
@@ -828,12 +855,7 @@ interface ExecuteIntentResponse {
828
855
  transactionHash?: string;
829
856
  /** Transaction result data needed for waiting via POST /api/intent/wait */
830
857
  transactionResult?: unknown;
831
- error?: {
832
- code: string;
833
- message: string;
834
- /** Structured provider details, when the auth service returns them. */
835
- details?: unknown;
836
- };
858
+ error?: OneAuthResultError;
837
859
  }
838
860
  /**
839
861
  * EIP-712 Domain parameters
@@ -956,11 +978,9 @@ interface BatchIntentItem {
956
978
  moduleAddress: string;
957
979
  initData?: string;
958
980
  };
959
- /**
960
- * Whether to request sponsorship for this item. Defaults to `true`.
961
- * When `false`, the item authenticates with the app's JWT but no
962
- * extension token is fetched for it.
963
- */
981
+ /** Funding policy for this item. Defaults to `required`. */
982
+ sponsorshipMode?: SponsorshipMode;
983
+ /** @deprecated Use `sponsorshipMode: "disabled"` instead of `sponsor: false`. */
964
984
  sponsor?: boolean;
965
985
  }
966
986
  /**
@@ -1118,23 +1138,16 @@ interface RequestConsentResult {
1118
1138
  * key may do. This triggers a passkey-signed management transaction
1119
1139
  * that installs the SmartSession validator and registers the session.
1120
1140
  */
1121
- interface InstallSmartSessionOptions {
1141
+ interface InstallSmartSessionBaseOptions {
1122
1142
  /** Account address of the owner — the sole account identity. */
1123
1143
  accountAddress: string;
1124
1144
  /** Target chain to install the validator on. */
1125
1145
  targetChain: number;
1126
1146
  /** Public address of the ECDSA session-key the app holds in localStorage. */
1127
1147
  sessionKeyAddress: `0x${string}`;
1128
- /**
1129
- * Per-contract permission specs from `definePermissions()`. 1auth
1130
- * re-validates server-side against an allowlist before asking the
1131
- * user to passkey-sign.
1132
- */
1148
+ /** Per-contract permission specs re-validated by 1auth before signing. */
1133
1149
  permissions: Permission<Abi>[];
1134
- /**
1135
- * Cross-chain asset movement permits. The upstream SmartSession SDK expands
1136
- * these into Permit2 claim policy plus fallback guardrails for bridge fills.
1137
- */
1150
+ /** Cross-chain asset movement permits used by the SmartSession policies. */
1138
1151
  crossChainPermits?: CrossChainPermit[];
1139
1152
  /** Unix seconds. Session is invalid after this time. */
1140
1153
  validUntil?: number;
@@ -1142,16 +1155,20 @@ interface InstallSmartSessionOptions {
1142
1155
  validAfter?: number;
1143
1156
  /** Optional max number of uses across the session lifetime. */
1144
1157
  maxUses?: number;
1145
- /**
1146
- * Passkey EIP-712 signature over `sessionEnable.typedData`.
1147
- * Omit on the first request to discover whether this exact
1148
- * permission needs owner authorization; include on the second
1149
- * request to receive the on-chain enable call.
1150
- */
1151
- enableSessionSignature?: `0x${string}` | WebAuthnSignature;
1152
1158
  /** Optional human label shown in the install dialog. */
1153
1159
  label?: string;
1154
1160
  }
1161
+ /**
1162
+ * A WebAuthn enable signature must name the exact credential that produced it.
1163
+ * Unsigned discovery/preflight requests intentionally omit both fields.
1164
+ */
1165
+ type InstallSmartSessionOptions = InstallSmartSessionBaseOptions & ({
1166
+ enableSessionSignature: WebAuthnSignature;
1167
+ credentialId: string;
1168
+ } | {
1169
+ enableSessionSignature?: `0x${string}` | undefined;
1170
+ credentialId?: never;
1171
+ });
1155
1172
  interface SmartSessionEnableRequest {
1156
1173
  alreadyEnabled: boolean;
1157
1174
  /**
@@ -1386,8 +1403,8 @@ interface HeadlessIntentOptions {
1386
1403
  sourceChainId?: number;
1387
1404
  /** Persisted handle from `installSmartSession`; required for SmartSession headless quotes. */
1388
1405
  sessionKeyHandle?: SessionKeyHandle;
1389
- /** Whether to request sponsorship for this intent. Defaults to `true`. */
1390
- sponsor?: boolean;
1406
+ /** Funding policy chosen at prepare time. Defaults to `required`. */
1407
+ sponsorshipMode?: SponsorshipMode;
1391
1408
  }
1392
1409
  /**
1393
1410
  * Result of {@link OneAuthHeadlessClient.prepareIntent}. The host app
@@ -1421,11 +1438,13 @@ interface HeadlessPrepareResult {
1421
1438
  accountAddress: `0x${string}`;
1422
1439
  /** Cost / token-requirement breakdown from the orchestrator quote. */
1423
1440
  quote?: IntentQuote;
1441
+ /** Funding mode of the authoritative quote. */
1442
+ sponsorshipMode?: "sponsored" | "self-funded";
1424
1443
  }
1425
1444
  /**
1426
- * Options for {@link OneAuthHeadlessClient.submitIntent}. The caller
1427
- * supplies pre-encoded validator-prefixed signatures; 1auth forwards
1428
- * them unchanged to the orchestrator.
1445
+ * Options for {@link OneAuthHeadlessClient.submitIntent}. The caller supplies
1446
+ * pre-encoded validator-prefixed signatures; 1auth forwards them unchanged.
1447
+ * Funding mode and authorization come from the authoritative prepare result.
1429
1448
  */
1430
1449
  interface HeadlessSubmitOptions {
1431
1450
  /** Echoed verbatim from the prepare result. */
@@ -1443,8 +1462,8 @@ interface HeadlessSubmitOptions {
1443
1462
  destinationSignature: `0x${string}`;
1444
1463
  /** Extra SmartSession signature required by SAME_CHAIN / INTENT_EXECUTOR execution. */
1445
1464
  targetExecutionSignature?: `0x${string}`;
1446
- /** Whether to request sponsorship at submit time. Defaults to `true`. */
1447
- sponsor?: boolean;
1465
+ /** Funding mode returned by prepareIntent; sponsored submit mints a fresh grant. */
1466
+ sponsorshipMode: "sponsored" | "self-funded";
1448
1467
  }
1449
1468
  /** Result of {@link OneAuthHeadlessClient.submitIntent}. */
1450
1469
  interface HeadlessSubmitResult {
@@ -1467,4 +1486,4 @@ interface HeadlessIntentStatusResult {
1467
1486
  transactionHash?: string;
1468
1487
  }
1469
1488
 
1470
- export { type IntentQuote as $, type AuthResult as A, type AuthenticateOptions as B, type CloseOnStatus as C, type AuthenticateResult as D, type EmbedOptions as E, type SigningResultBase as F, type SignMessageOptions as G, type HeadlessIntentOptions as H, type InstallSmartSessionOptions as I, type SignMessageResult as J, type SignTypedDataOptions as K, type LoginWithModalOptions as L, type SignTypedDataResult as M, type EIP712Domain as N, type EIP712Types as O, type PasskeyProviderConfig as P, type EIP712TypeField as Q, type TransactionAction as R, type SponsorshipConfig as S, type ThemeConfig as T, type UserPasskeysResponse as U, type TransactionFees as V, type WebAuthnSignature as W, type BalanceRequirement as X, type TransactionDetails as Y, type IntentTokenRequest as Z, type SendIntentOptions as _, type HeadlessPrepareResult as a, type IntentStatus as a0, type OrchestratorStatus as a1, type PrepareIntentResponse as a2, type ExecuteIntentResponse as a3, type IntentHistoryOptions as a4, type IntentHistoryItem as a5, type IntentHistoryResult as a6, type GetAssetsOptions as a7, type AssetBalance as a8, type AssetBalanceBucket as a9, type OneAuthTelemetryEvent as aA, type OneAuthTelemetryEventName as aB, type OneAuthTelemetryFlow as aC, type OneAuthTelemetryTraceContext as aD, type AssetsResponse as aa, type ConsentField as ab, type ConsentData as ac, type CheckConsentOptions as ad, type CheckConsentResult as ae, type RequestConsentOptions as af, type RequestConsentResult as ag, type GrantPermissionsOptions as ah, type GrantPermissionsResult as ai, type ListSessionGrantsOptions as aj, type ListSessionGrantsResult as ak, type SessionGrantRecord as al, type SessionGrantChain as am, type GrantPermissionContractMetadata as an, type SmartSessionPolicy as ao, type BatchIntentItem as ap, type SendBatchIntentOptions as aq, type SendBatchIntentResult as ar, type BatchIntentItemResult as as, type PreparedBatchIntent as at, type PrepareBatchIntentResponse as au, type SponsorshipCallbackConfig as av, type SponsorshipUrlConfig as aw, type OneAuthTelemetryAttributeValue as ax, type OneAuthTelemetryAttributes as ay, type OneAuthTelemetryConfig as az, type HeadlessSubmitOptions as b, type HeadlessSubmitResult as c, type HeadlessIntentStatusResult as d, type InstallSmartSessionResult as e, type SessionKeyHandle as f, type SmartSessionEnableRequest as g, type SignerType as h, type IntentCall as i, type SendIntentResult as j, createCrossChainPermission as k, type CreateCrossChainPermissionInput as l, type CrossChainPermit as m, type CrossChainSettlementLayer as n, type SigningRequestOptions as o, type SigningResult as p, type SigningSuccess as q, type SigningError as r, type SigningErrorCode as s, type CreateSigningRequestResponse as t, type SigningRequestStatus as u, type PasskeyCredential as v, type AuthFlow as w, type AuthWithModalOptions as x, type CreateAccountWithModalOptions as y, type ConnectResult as z };
1489
+ export { type OneAuthCandidateError as $, type AuthResult as A, type CreateAccountWithModalOptions as B, type CloseOnStatus as C, type ConnectResult as D, type EmbedOptions as E, type AuthenticateOptions as F, type AuthenticateResult as G, type HeadlessIntentOptions as H, type InstallSmartSessionOptions as I, type SigningResultBase as J, type SignMessageOptions as K, type LoginWithModalOptions as L, type SignMessageResult as M, type SignTypedDataOptions as N, type SignTypedDataResult as O, type PasskeyProviderConfig as P, type EIP712Domain as Q, type EIP712Types as R, type SponsorshipConfig as S, type ThemeConfig as T, type EIP712TypeField as U, type TransactionAction as V, type WebAuthnSignature as W, type TransactionFees as X, type BalanceRequirement as Y, type TransactionDetails as Z, type OneAuthErrorDetails as _, type HeadlessPrepareResult as a, type OneAuthResultError as a0, type IntentTokenRequest as a1, type SendIntentOptions as a2, type IntentQuote as a3, type IntentStatus as a4, type OrchestratorStatus as a5, type PrepareIntentResponse as a6, type ExecuteIntentResponse as a7, type IntentHistoryOptions as a8, type IntentHistoryItem as a9, type SponsorshipUrlConfig as aA, type OneAuthTelemetryAttributeValue as aB, type OneAuthTelemetryAttributes as aC, type OneAuthTelemetryConfig as aD, type OneAuthTelemetryEvent as aE, type OneAuthTelemetryEventName as aF, type OneAuthTelemetryFlow as aG, type OneAuthTelemetryTraceContext as aH, type IntentHistoryResult as aa, type GetAssetsOptions as ab, type AssetBalance as ac, type AssetBalanceBucket as ad, type AssetsResponse as ae, type ConsentField as af, type ConsentData as ag, type CheckConsentOptions as ah, type CheckConsentResult as ai, type RequestConsentOptions as aj, type RequestConsentResult as ak, type GrantPermissionsOptions as al, type GrantPermissionsResult as am, type ListSessionGrantsOptions as an, type ListSessionGrantsResult as ao, type SessionGrantRecord as ap, type SessionGrantChain as aq, type GrantPermissionContractMetadata as ar, type SmartSessionPolicy as as, type BatchIntentItem as at, type SendBatchIntentOptions as au, type SendBatchIntentResult as av, type BatchIntentItemResult as aw, type PreparedBatchIntent as ax, type PrepareBatchIntentResponse as ay, type SponsorshipCallbackConfig as az, type HeadlessSubmitOptions as b, type HeadlessSubmitResult as c, type HeadlessIntentStatusResult as d, type InstallSmartSessionResult as e, type SessionKeyHandle as f, type SmartSessionEnableRequest as g, type SignerType as h, type IntentCall as i, type SendIntentResult as j, SIGNING_ERROR_CODES as k, isSigningErrorCode as l, createCrossChainPermission as m, type CreateCrossChainPermissionInput as n, type CrossChainPermit as o, type CrossChainSettlementLayer as p, type SigningRequestOptions as q, type SigningResult as r, type SigningSuccess as s, type SigningError as t, type SigningErrorCode as u, type PasskeyCredentials as v, type CreateSigningRequestResponse as w, type SigningRequestStatus as x, type AuthFlow as y, type AuthWithModalOptions as z };
@@ -1,5 +1,5 @@
1
1
  import { Address, Chain, Transport, Hex } from 'viem';
2
- import { T as ThemeConfig, S as SponsorshipConfig, W as WebAuthnSignature } from './types-Dzm5lZK-.mjs';
2
+ import { T as ThemeConfig, S as SponsorshipConfig, W as WebAuthnSignature } from './types-BN6cCuAd.mjs';
3
3
 
4
4
  /**
5
5
  * Configuration for creating a passkey-enabled WalletClient
@@ -1,5 +1,5 @@
1
1
  import { Address, Chain, Transport, Hex } from 'viem';
2
- import { T as ThemeConfig, S as SponsorshipConfig, W as WebAuthnSignature } from './types-Dzm5lZK-.js';
2
+ import { T as ThemeConfig, S as SponsorshipConfig, W as WebAuthnSignature } from './types-BN6cCuAd.js';
3
3
 
4
4
  /**
5
5
  * Configuration for creating a passkey-enabled WalletClient
package/dist/wagmi.d.mts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as _wagmi_core from '@wagmi/core';
2
- import { O as OneAuthProvider } from './provider-CJv38fIK.mjs';
3
- import { O as OneAuthClient } from './client-C8QSA1th.mjs';
2
+ import { O as OneAuthProvider } from './provider-CNDrBzGs.mjs';
3
+ import { O as OneAuthClient } from './client-B0vb_deA.mjs';
4
4
  import 'viem';
5
- import './types-Dzm5lZK-.mjs';
5
+ import './types-BN6cCuAd.mjs';
6
6
  import '@rhinestone/sdk';
7
7
 
8
8
  type OneAuthConnectorOptions = {
package/dist/wagmi.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as _wagmi_core from '@wagmi/core';
2
- import { O as OneAuthProvider } from './provider-BsVmPgkQ.js';
3
- import { O as OneAuthClient } from './client-Dn6mL7BZ.js';
2
+ import { O as OneAuthProvider } from './provider-DwZPA2N1.js';
3
+ import { O as OneAuthClient } from './client-CPt1hn4_.js';
4
4
  import 'viem';
5
- import './types-Dzm5lZK-.js';
5
+ import './types-BN6cCuAd.js';
6
6
  import '@rhinestone/sdk';
7
7
 
8
8
  type OneAuthConnectorOptions = {