@connect-xyz/auth-react 0.75.0 → 0.75.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 (2) hide show
  1. package/dist/index.d.ts +13 -17
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -53,13 +53,10 @@ declare type AppEvent<TType extends string = string, TData = Record<string, unkn
53
53
  export declare const Auth: default_2.FC<AuthWrapperProps>;
54
54
 
55
55
  /**
56
- * Callback function types for Connect Auth components
57
- * Extends common callbacks with auth-specific callbacks
56
+ * Callback function types for Connect Auth components.
57
+ * Common ones (incl. `onDeposit`) come from `CommonCallbacks`.
58
58
  */
59
- declare type AuthCallbacks = CommonCallbacks<AuthEvent> & {
60
- /** Called when a deposit action occurs */
61
- onDeposit?: (deposit: DepositCompletedPayload) => void;
62
- };
59
+ declare type AuthCallbacks = CommonCallbacks<AuthEvent>;
63
60
 
64
61
  /**
65
62
  * Auth event structure for auth-specific events
@@ -140,23 +137,25 @@ declare type CommonCallbacks<TEvent = AppEvent> = {
140
137
  onEvent?: (event: TEvent) => void;
141
138
  /** Called when the widget has loaded and is ready */
142
139
  onLoaded?: () => void;
140
+ /**
141
+ * Called when a deposit reaches a terminal state (success/failure/verifying).
142
+ * Optional — only SDKs that drive the integrations deposit flow emit it.
143
+ */
144
+ onDeposit?: (deposit: DepositCompletedPayload) => void;
143
145
  };
144
146
 
145
147
  /**
146
- * Deposit completed payload structure for deposit callbacks
148
+ * Deposit completed payload emitted by SDKs that drive a deposit through
149
+ * the integrations flow. Lives on `CommonCallbacks` because both Auth and
150
+ * any SDK embedding `@zerohash/integrations-flow` (e.g. fund with `useAuth`)
151
+ * resolve through the same deposit-status hook.
147
152
  */
148
153
  declare type DepositCompletedPayload = {
149
- /** Data associated with the deposit */
150
154
  data: {
151
- /** Unique identifier for the deposit */
152
155
  depositId: string;
153
- /** Current status of the deposit */
154
156
  status: DepositStatus;
155
- /** Asset identifier (e.g., 'btc', 'eth') */
156
157
  assetId: string;
157
- /** Network identifier (e.g., 'bitcoin', 'ethereum') */
158
158
  networkId: string;
159
- /** Amount being deposited */
160
159
  amount?: string;
161
160
  accountMatchingValidation?: {
162
161
  status: 'PENDING' | 'VALID' | 'INVALID' | 'ERROR';
@@ -166,14 +165,11 @@ declare type DepositCompletedPayload = {
166
165
  };
167
166
 
168
167
  /**
169
- * Deposit status object structure
168
+ * Deposit status object — shared across SDKs that surface deposit completion.
170
169
  */
171
170
  declare type DepositStatus = {
172
- /** Status value */
173
171
  value: string;
174
- /** Human-readable details about the status */
175
172
  details: string;
176
- /** Timestamp when the status occurred (ISO 8601 format) */
177
173
  occurredAt: string;
178
174
  };
179
175
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@connect-xyz/auth-react",
3
- "version": "0.75.0",
3
+ "version": "0.75.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",