@zerohash-sdk/fund-js 1.6.0 → 1.7.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 +34 -0
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -318,6 +318,40 @@ declare type CommonCallbacks<TEvent = AppEvent> = {
318
318
  onEvent?: (event: TEvent) => void;
319
319
  /** Called when the widget has loaded and is ready */
320
320
  onLoaded?: () => void;
321
+ /**
322
+ * Called when a deposit reaches a terminal state (success/failure/verifying).
323
+ * Optional — only SDKs that drive the integrations deposit flow emit it.
324
+ */
325
+ onDeposit?: (deposit: DepositCompletedPayload) => void;
326
+ };
327
+
328
+ /**
329
+ * Deposit completed payload — emitted by SDKs that drive a deposit through
330
+ * the integrations flow. Lives on `CommonCallbacks` because both Auth and
331
+ * any SDK embedding `@zerohash/integrations-flow` (e.g. fund with `useAuth`)
332
+ * resolve through the same deposit-status hook.
333
+ */
334
+ declare type DepositCompletedPayload = {
335
+ data: {
336
+ depositId: string;
337
+ status: DepositStatus;
338
+ assetId: string;
339
+ networkId: string;
340
+ amount?: string;
341
+ accountMatchingValidation?: {
342
+ status: 'PENDING' | 'VALID' | 'INVALID' | 'ERROR';
343
+ reason?: string;
344
+ };
345
+ };
346
+ };
347
+
348
+ /**
349
+ * Deposit status object — shared across SDKs that surface deposit completion.
350
+ */
351
+ declare type DepositStatus = {
352
+ value: string;
353
+ details: string;
354
+ occurredAt: string;
321
355
  };
322
356
 
323
357
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zerohash-sdk/fund-js",
3
- "version": "1.6.0",
3
+ "version": "1.7.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",