@connect-xyz/auth-js 1.62.0 → 1.62.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.
Files changed (2) hide show
  1. package/dist/index.d.ts +13 -17
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -88,13 +88,10 @@ export { Auth }
88
88
  export default Auth;
89
89
 
90
90
  /**
91
- * Callback function types for Connect Auth components
92
- * Extends common callbacks with auth-specific callbacks
91
+ * Callback function types for Connect Auth components.
92
+ * Common ones (incl. `onDeposit`) come from `CommonCallbacks`.
93
93
  */
94
- declare type AuthCallbacks = CommonCallbacks<AuthEvent> & {
95
- /** Called when a deposit action occurs */
96
- onDeposit?: (deposit: DepositCompletedPayload) => void;
97
- };
94
+ declare type AuthCallbacks = CommonCallbacks<AuthEvent>;
98
95
 
99
96
  export declare interface AuthConfig extends BaseConfig<AuthEvent>, AuthCallbacks {
100
97
  }
@@ -408,25 +405,27 @@ declare type CommonCallbacks<TEvent = AppEvent> = {
408
405
  onEvent?: (event: TEvent) => void;
409
406
  /** Called when the widget has loaded and is ready */
410
407
  onLoaded?: () => void;
408
+ /**
409
+ * Called when a deposit reaches a terminal state (success/failure/verifying).
410
+ * Optional — only SDKs that drive the integrations deposit flow emit it.
411
+ */
412
+ onDeposit?: (deposit: DepositCompletedPayload) => void;
411
413
  };
412
414
 
413
415
  export declare type ConnectAuthElement = SdkElement<AuthConfig>;
414
416
 
415
417
  /**
416
- * Deposit completed payload structure for deposit callbacks
418
+ * Deposit completed payload emitted by SDKs that drive a deposit through
419
+ * the integrations flow. Lives on `CommonCallbacks` because both Auth and
420
+ * any SDK embedding `@zerohash/integrations-flow` (e.g. fund with `useAuth`)
421
+ * resolve through the same deposit-status hook.
417
422
  */
418
423
  declare type DepositCompletedPayload = {
419
- /** Data associated with the deposit */
420
424
  data: {
421
- /** Unique identifier for the deposit */
422
425
  depositId: string;
423
- /** Current status of the deposit */
424
426
  status: DepositStatus;
425
- /** Asset identifier (e.g., 'btc', 'eth') */
426
427
  assetId: string;
427
- /** Network identifier (e.g., 'bitcoin', 'ethereum') */
428
428
  networkId: string;
429
- /** Amount being deposited */
430
429
  amount?: string;
431
430
  accountMatchingValidation?: {
432
431
  status: 'PENDING' | 'VALID' | 'INVALID' | 'ERROR';
@@ -436,14 +435,11 @@ declare type DepositCompletedPayload = {
436
435
  };
437
436
 
438
437
  /**
439
- * Deposit status object structure
438
+ * Deposit status object — shared across SDKs that surface deposit completion.
440
439
  */
441
440
  declare type DepositStatus = {
442
- /** Status value */
443
441
  value: string;
444
- /** Human-readable details about the status */
445
442
  details: string;
446
- /** Timestamp when the status occurred (ISO 8601 format) */
447
443
  occurredAt: string;
448
444
  };
449
445
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@connect-xyz/auth-js",
3
- "version": "1.62.0",
3
+ "version": "1.62.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",