@zerohash-sdk/crypto-withdrawals-react 1.15.9 → 1.15.11

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 CHANGED
@@ -105,17 +105,31 @@ export default App;
105
105
 
106
106
  ### CryptoWithdrawals Component Props
107
107
 
108
- | Prop | Type | Required | Default | Description |
109
- | ------------- | -------------------------------------- | -------- | -------- | -------------------------------------------------------- |
110
- | `jwt` | `string` | Yes | - | JWT token for authentication with Connect |
111
- | `env` | `"prod" \| "cert" \| "dev" \| "local"` | No | `"prod"` | Target environment |
112
- | `theme` | `"auto" \| "light" \| "dark"` | No | `"auto"` | Theme mode for the interface |
113
- | `onCompleted` | `({ withdrawalRequestId }) => void` | No | - | Callback when the withdrawal flow completes successfully |
114
- | `onFailed` | `({ withdrawalRequestId }) => void` | No | - | Callback when a withdrawal ends in a failed state |
115
- | `onError` | `({ errorCode, reason }) => void` | No | - | Callback for error events |
116
- | `onClose` | `() => void` | No | - | Callback when the widget is closed |
117
- | `onEvent` | `({ type, data }) => void` | No | - | Callback for general events |
118
- | `onLoaded` | `() => void` | No | - | Callback when the widget is loaded and ready |
108
+ | Prop | Type | Required | Default | Description |
109
+ | ------------- | ----------------------------------------------------------------------- | -------- | -------- | -------------------------------------------------------- |
110
+ | `jwt` | `string` | Yes | - | JWT token for authentication with Connect |
111
+ | `env` | `"prod" \| "cert" \| "dev" \| "local"` | No | `"prod"` | Target environment |
112
+ | `theme` | `"auto" \| "light" \| "dark"` | No | `"auto"` | Theme mode for the interface |
113
+ | `onCompleted` | `({ withdrawalRequestId, status, assetId, networkId, amount }) => void` | No | - | Callback when the withdrawal flow completes successfully |
114
+ | `onFailed` | `({ withdrawalRequestId }) => void` | No | - | Callback when a withdrawal ends in a failed state |
115
+ | `onError` | `({ errorCode, reason }) => void` | No | - | Callback for error events |
116
+ | `onClose` | `() => void` | No | - | Callback when the widget is closed |
117
+ | `onEvent` | `({ type, data }) => void` | No | - | Callback for general events |
118
+ | `onLoaded` | `() => void` | No | - | Callback when the widget is loaded and ready |
119
+
120
+ ### `onCompleted` payload
121
+
122
+ `onCompleted` receives `{ withdrawalRequestId, status, assetId, networkId, amount }`.
123
+ What `status` and `amount` mean depends on the flow that completed:
124
+
125
+ | Flow | `status` | `amount` |
126
+ | ---------------- | ----------- | --------------------------------------- |
127
+ | Classic (manual) | `SUBMITTED` | The requested amount, before fees |
128
+ | Auth | `CONFIRMED` | The net amount the destination received |
129
+
130
+ `SUBMITTED` means the withdrawal was submitted, not confirmed on-chain.
131
+ `assetId` is the asset ticker (e.g. `BTC`, `USDC`) and `networkId` the network
132
+ chain code (e.g. `bitcoin`, `ethereum`).
119
133
 
120
134
  ### `onFailed` and `onError` on a failed withdrawal
121
135
 
package/dist/index.d.ts CHANGED
@@ -56,7 +56,12 @@ export declare const CryptoWithdrawals: default_2.FC<CryptoWithdrawalsProps>;
56
56
  declare type CryptoWithdrawalsCompletedData = {
57
57
  /** The withdrawal request ID returned from the API */
58
58
  withdrawalRequestId: string;
59
- /** Terminal status value, e.g. `CONFIRMED` or `FAILED` */
59
+ /**
60
+ * Status value. The Auth flow sends a terminal status, e.g. `CONFIRMED` or
61
+ * `FAILED`. The classic (manual) flow sends `SUBMITTED`
62
+ * ({@link CRYPTO_WITHDRAWALS_STATUS_SUBMITTED}): the withdrawal was
63
+ * submitted, not confirmed.
64
+ */
60
65
  status?: string;
61
66
  /**
62
67
  * Human-readable reason for the status. On a failure this is the only
@@ -64,13 +69,15 @@ declare type CryptoWithdrawalsCompletedData = {
64
69
  * reporting a bare id.
65
70
  */
66
71
  statusDetails?: string;
67
- /** Asset identifier (e.g. 'btc', 'eth') */
72
+ /** Asset ticker (e.g. 'BTC', 'USDC') */
68
73
  assetId?: string;
69
- /** Network identifier (e.g. 'bitcoin', 'ethereum') */
74
+ /** Network chain code (e.g. 'bitcoin', 'ethereum') */
70
75
  networkId?: string;
71
76
  /**
72
- * On `onCompleted`, the net amount the destination received, after fees.
73
- * On `onFailed`, the requested amount, since nothing was received.
77
+ * On the Auth flow's `onCompleted`, the net amount the destination received,
78
+ * after fees. On the classic (manual) flow's `onCompleted`, the requested
79
+ * amount, before fees, since the withdrawal has not settled yet. On
80
+ * `onFailed`, the requested amount, since nothing was received.
74
81
  */
75
82
  amount?: string;
76
83
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zerohash-sdk/crypto-withdrawals-react",
3
- "version": "1.15.9",
3
+ "version": "1.15.11",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",