@zerohash-sdk/crypto-withdrawals-react 1.11.6 → 1.13.0
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 +17 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.js +114 -95
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -53,6 +53,10 @@ function App() {
|
|
|
53
53
|
onCompleted={({ withdrawalRequestId }) => {
|
|
54
54
|
console.log('Withdrawal completed:', withdrawalRequestId);
|
|
55
55
|
}}
|
|
56
|
+
onFailed={({ withdrawalRequestId, statusDetails }) => {
|
|
57
|
+
// statusDetails is the only explanation of the failure available.
|
|
58
|
+
console.log('Withdrawal failed:', withdrawalRequestId, statusDetails);
|
|
59
|
+
}}
|
|
56
60
|
onError={({ errorCode, reason }) => {
|
|
57
61
|
console.log('Error:', errorCode, 'Reason:', reason);
|
|
58
62
|
}}
|
|
@@ -84,6 +88,7 @@ function App() {
|
|
|
84
88
|
onCompleted={({ withdrawalRequestId }) => {
|
|
85
89
|
console.log('Withdrawal request:', withdrawalRequestId);
|
|
86
90
|
}}
|
|
91
|
+
onFailed={({ withdrawalRequestId }) => console.log('Withdrawal failed:', withdrawalRequestId)}
|
|
87
92
|
onError={({ errorCode, reason }) => console.log('Error:', errorCode, reason)}
|
|
88
93
|
onClose={() => console.log('Widget closed')}
|
|
89
94
|
onEvent={({ type, data }) => console.log('Event type:', type, 'Event data:', data)}
|
|
@@ -106,11 +111,23 @@ export default App;
|
|
|
106
111
|
| `env` | `"prod" \| "cert" \| "dev" \| "local"` | No | `"prod"` | Target environment |
|
|
107
112
|
| `theme` | `"auto" \| "light" \| "dark"` | No | `"auto"` | Theme mode for the interface |
|
|
108
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 |
|
|
109
115
|
| `onError` | `({ errorCode, reason }) => void` | No | - | Callback for error events |
|
|
110
116
|
| `onClose` | `() => void` | No | - | Callback when the widget is closed |
|
|
111
117
|
| `onEvent` | `({ type, data }) => void` | No | - | Callback for general events |
|
|
112
118
|
| `onLoaded` | `() => void` | No | - | Callback when the widget is loaded and ready |
|
|
113
119
|
|
|
120
|
+
### `onFailed` and `onError` on a failed withdrawal
|
|
121
|
+
|
|
122
|
+
A failed withdrawal fires **both** `onFailed` and `onError`, so existing
|
|
123
|
+
integrations that only implemented `onError` keep working.
|
|
124
|
+
|
|
125
|
+
`onFailed` is the correct callback: it carries the withdrawal's details,
|
|
126
|
+
including `statusDetails`, the only explanation of the failure available. Build
|
|
127
|
+
against `onFailed`, and if you handle both, guard against counting one failure
|
|
128
|
+
twice. Firing `onError` for a failed withdrawal is deprecated and will be
|
|
129
|
+
removed in a future major version.
|
|
130
|
+
|
|
114
131
|
## More Information & Support
|
|
115
132
|
|
|
116
133
|
For comprehensive documentation or support about Connect, visit our [Documentation Page](https://docs.zerohash.com/).
|
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ declare type AppEvent<TType extends string = string, TData = Record<string, unkn
|
|
|
20
20
|
* @param env - Target environment ("local" | "dev" | "cert" | "prod", defaults to "prod")
|
|
21
21
|
* @param theme - Theme mode ("auto" | "light" | "dark", defaults to "auto")
|
|
22
22
|
* @param onCompleted - Callback invoked when the withdrawal flow is successfully completed
|
|
23
|
+
* @param onFailed - Callback invoked when a withdrawal reaches a terminal failed state
|
|
23
24
|
* @param onError - Callback invoked when an error occurs
|
|
24
25
|
* @param onClose - Callback invoked when the user closes the widget
|
|
25
26
|
* @param onLoaded - Callback invoked when the widget has finished loading
|
|
@@ -55,6 +56,20 @@ export declare const CryptoWithdrawals: default_2.FC<CryptoWithdrawalsProps>;
|
|
|
55
56
|
declare type CryptoWithdrawalsCompletedData = {
|
|
56
57
|
/** The withdrawal request ID returned from the API */
|
|
57
58
|
withdrawalRequestId: string;
|
|
59
|
+
/** Terminal status value, e.g. `CONFIRMED` or `FAILED` */
|
|
60
|
+
status?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Human-readable reason for the status. On a failure this is the only
|
|
63
|
+
* explanation available anywhere in the stack, so surface it rather than
|
|
64
|
+
* reporting a bare id.
|
|
65
|
+
*/
|
|
66
|
+
statusDetails?: string;
|
|
67
|
+
/** Asset identifier (e.g. 'btc', 'eth') */
|
|
68
|
+
assetId?: string;
|
|
69
|
+
/** Network identifier (e.g. 'bitcoin', 'ethereum') */
|
|
70
|
+
networkId?: string;
|
|
71
|
+
/** Amount withdrawn */
|
|
72
|
+
amount?: string;
|
|
58
73
|
};
|
|
59
74
|
|
|
60
75
|
declare type CryptoWithdrawalsEvent = AppEvent<CryptoWithdrawalsEventType>;
|
|
@@ -127,6 +142,29 @@ declare interface CryptoWithdrawalsProps {
|
|
|
127
142
|
* ```
|
|
128
143
|
*/
|
|
129
144
|
onCompleted?: (data: CryptoWithdrawalsCompletedData) => void;
|
|
145
|
+
/**
|
|
146
|
+
* Callback invoked when a withdrawal reaches a terminal **failed** state,
|
|
147
|
+
* carrying the failed withdrawal's details rather than an SDK/request error.
|
|
148
|
+
*
|
|
149
|
+
* A failed withdrawal also fires `onError`, for backwards compatibility with
|
|
150
|
+
* hosts written before this callback existed — `onError` was this flow's only
|
|
151
|
+
* failure signal. Build against `onFailed`; if you handle both, guard against
|
|
152
|
+
* counting one failure twice. The compatibility `onError` is deprecated and
|
|
153
|
+
* will be removed in a future major version.
|
|
154
|
+
*
|
|
155
|
+
* @param data - Details about the failed withdrawal
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```tsx
|
|
159
|
+
* <CryptoWithdrawals
|
|
160
|
+
* jwt={token}
|
|
161
|
+
* onFailed={({ withdrawalRequestId }) =>
|
|
162
|
+
* console.warn('Withdrawal failed:', withdrawalRequestId)
|
|
163
|
+
* }
|
|
164
|
+
* />
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
onFailed?: (data: CryptoWithdrawalsCompletedData) => void;
|
|
130
168
|
/**
|
|
131
169
|
* Callback invoked when an error occurs during the crypto withdrawal flow.
|
|
132
170
|
*
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as U, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import M, { useEffect as A, useState as L, useCallback as j, useRef as D } from "react";
|
|
3
3
|
const $ = {
|
|
4
4
|
dev: "https://grafana-faro-collector.dev.0hash.com/collect",
|
|
5
5
|
cert: "https://grafana-faro-collector.cert.zerohash.com/collect",
|
|
@@ -15,48 +15,48 @@ const $ = {
|
|
|
15
15
|
if (t.length < 2)
|
|
16
16
|
return null;
|
|
17
17
|
try {
|
|
18
|
-
const o = t[1].replace(/-/g, "+").replace(/_/g, "/"), r = o + "===".slice(0, (4 - o.length % 4) % 4),
|
|
19
|
-
if (typeof
|
|
18
|
+
const o = t[1].replace(/-/g, "+").replace(/_/g, "/"), r = o + "===".slice(0, (4 - o.length % 4) % 4), c = typeof atob < "u" ? atob(r) : Buffer.from(r, "base64").toString("utf-8"), n = JSON.parse(c)?.payload?.region;
|
|
19
|
+
if (typeof n != "string")
|
|
20
20
|
return null;
|
|
21
|
-
const
|
|
22
|
-
return
|
|
21
|
+
const a = n.toLowerCase();
|
|
22
|
+
return a === "us" || a === "eu" ? a : null;
|
|
23
23
|
} catch {
|
|
24
24
|
return null;
|
|
25
25
|
}
|
|
26
|
-
},
|
|
26
|
+
}, I = (e, t) => V(t) !== "eu" ? e : e === "cert" ? "eu-cert" : e === "prod" ? "eu-prod" : e, P = (e) => {
|
|
27
27
|
if (!e || typeof e != "string")
|
|
28
28
|
return {};
|
|
29
29
|
const t = e.split(".");
|
|
30
30
|
if (t.length < 2)
|
|
31
31
|
return {};
|
|
32
32
|
try {
|
|
33
|
-
const o = t[1].replace(/-/g, "+").replace(/_/g, "/"), r = o + "===".slice(0, (4 - o.length % 4) % 4),
|
|
33
|
+
const o = t[1].replace(/-/g, "+").replace(/_/g, "/"), r = o + "===".slice(0, (4 - o.length % 4) % 4), c = typeof atob < "u" ? atob(r) : Buffer.from(r, "base64").toString("utf-8"), i = JSON.parse(c), n = i?.payload ?? {}, a = (s) => typeof s == "string" && s.length > 0 ? s : void 0;
|
|
34
34
|
return {
|
|
35
|
-
participantCode: n
|
|
36
|
-
platformName: n
|
|
37
|
-
platformCode:
|
|
38
|
-
region: n
|
|
35
|
+
participantCode: a(n.participant_code),
|
|
36
|
+
platformName: a(n.platform_name),
|
|
37
|
+
platformCode: a(i.platform_code),
|
|
38
|
+
region: a(n.region)
|
|
39
39
|
};
|
|
40
40
|
} catch {
|
|
41
41
|
return {};
|
|
42
42
|
}
|
|
43
|
-
},
|
|
44
|
-
const r =
|
|
43
|
+
}, z = (e, t, o) => {
|
|
44
|
+
const r = I(t, o);
|
|
45
45
|
return e[r] ?? e[t] ?? e.prod;
|
|
46
|
-
},
|
|
47
|
-
const r =
|
|
46
|
+
}, H = (e, t, o) => {
|
|
47
|
+
const r = I(t, o);
|
|
48
48
|
return e[r] ?? e[t];
|
|
49
|
-
},
|
|
50
|
-
},
|
|
49
|
+
}, C = () => {
|
|
50
|
+
}, J = () => {
|
|
51
51
|
const e = new Uint8Array(8);
|
|
52
52
|
return globalThis.crypto.getRandomValues(e), Array.from(e, (t) => t.toString(16).padStart(2, "0")).join("");
|
|
53
53
|
}, G = (e, t) => {
|
|
54
|
-
const o =
|
|
55
|
-
e.claims.participantCode && (
|
|
54
|
+
const o = J(), r = globalThis.__ZH_WEB_SDK_VERSION__, c = {};
|
|
55
|
+
e.claims.participantCode && (c.participant_code = e.claims.participantCode), e.claims.platformName && (c.platform_name = e.claims.platformName), e.claims.platformCode && (c.platform_code = e.claims.platformCode), e.claims.region && (c.region = e.claims.region), r && (c.zh_web_sdk_version = r);
|
|
56
56
|
const i = {
|
|
57
57
|
meta: {
|
|
58
58
|
app: { name: e.appName, version: t ?? "unknown", environment: e.env },
|
|
59
|
-
session: { id: o, attributes:
|
|
59
|
+
session: { id: o, attributes: c },
|
|
60
60
|
browser: typeof navigator < "u" ? { userAgent: navigator.userAgent } : void 0,
|
|
61
61
|
page: typeof window < "u" ? { url: window.location.origin } : void 0
|
|
62
62
|
},
|
|
@@ -79,61 +79,61 @@ const $ = {
|
|
|
79
79
|
}, K = (e, t, o) => {
|
|
80
80
|
if (!e || typeof fetch > "u")
|
|
81
81
|
return;
|
|
82
|
-
const { sessionId: r, payload:
|
|
82
|
+
const { sessionId: r, payload: c } = G(t, o);
|
|
83
83
|
try {
|
|
84
84
|
fetch(e, {
|
|
85
85
|
method: "POST",
|
|
86
86
|
headers: { "Content-Type": "application/json", "x-faro-session-id": r },
|
|
87
|
-
body: JSON.stringify(
|
|
87
|
+
body: JSON.stringify(c),
|
|
88
88
|
keepalive: !0
|
|
89
89
|
}).catch(() => {
|
|
90
90
|
});
|
|
91
91
|
} catch {
|
|
92
92
|
}
|
|
93
93
|
}, Z = (e) => {
|
|
94
|
-
const { webComponentTag: t, appName: o, appVersion: r, scriptUrls:
|
|
94
|
+
const { webComponentTag: t, appName: o, appVersion: r, scriptUrls: c, fallbackScriptUrls: i, collectorUrls: n, env: a, jwt: s, timeoutMs: g = 15e3, onLoad: h, onError: y } = e;
|
|
95
95
|
if (typeof document > "u")
|
|
96
|
-
return
|
|
97
|
-
const
|
|
98
|
-
if (customElements.get(t) || document.getElementById(
|
|
99
|
-
return
|
|
100
|
-
const S = P(s),
|
|
101
|
-
let
|
|
96
|
+
return C;
|
|
97
|
+
const p = `${t}-script-${a}`;
|
|
98
|
+
if (customElements.get(t) || document.getElementById(p))
|
|
99
|
+
return C;
|
|
100
|
+
const S = P(s), k = e.report ?? ((u) => K(n && H(n, a, s), u, r));
|
|
101
|
+
let m = !1, O = 0, v;
|
|
102
102
|
const R = () => {
|
|
103
|
-
|
|
104
|
-
},
|
|
105
|
-
if (
|
|
103
|
+
v !== void 0 && clearTimeout(v);
|
|
104
|
+
}, w = (u, b, l) => {
|
|
105
|
+
if (m)
|
|
106
106
|
return;
|
|
107
|
-
const
|
|
107
|
+
const W = Math.round(performance.now() - O), E = {
|
|
108
108
|
webComponentTag: t,
|
|
109
109
|
appName: o,
|
|
110
|
-
env:
|
|
111
|
-
scriptUrl:
|
|
112
|
-
reason:
|
|
110
|
+
env: a,
|
|
111
|
+
scriptUrl: b,
|
|
112
|
+
reason: u,
|
|
113
113
|
triedFallback: l,
|
|
114
|
-
elapsedMs:
|
|
114
|
+
elapsedMs: W,
|
|
115
115
|
claims: S
|
|
116
116
|
};
|
|
117
|
-
|
|
118
|
-
const
|
|
119
|
-
if (
|
|
120
|
-
N(
|
|
117
|
+
k(E);
|
|
118
|
+
const x = l ? void 0 : z(i ?? {}, a, s);
|
|
119
|
+
if (x && x !== b) {
|
|
120
|
+
N(x, !0);
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
123
|
-
|
|
124
|
-
}, N = (
|
|
125
|
-
R(),
|
|
123
|
+
m = !0, R(), document.getElementById(p)?.remove(), y?.(E);
|
|
124
|
+
}, N = (u, b) => {
|
|
125
|
+
R(), O = performance.now();
|
|
126
126
|
const l = document.createElement("script");
|
|
127
|
-
l.id =
|
|
127
|
+
l.id = p, l.src = u, l.type = "module", l.async = !0, l.onload = () => {
|
|
128
128
|
setTimeout(() => {
|
|
129
|
-
|
|
129
|
+
m || (customElements.get(t) ? (m = !0, R(), h?.()) : w("not-defined", u, b));
|
|
130
130
|
}, 0);
|
|
131
|
-
}, l.onerror = () =>
|
|
132
|
-
}, T =
|
|
131
|
+
}, l.onerror = () => w("network", u, b), v = setTimeout(() => w("timeout", u, b), g), document.getElementById(p)?.remove(), document.head.appendChild(l);
|
|
132
|
+
}, T = z(c, a, s);
|
|
133
133
|
return T ? (N(T, !1), () => {
|
|
134
|
-
|
|
135
|
-
}) :
|
|
136
|
-
},
|
|
134
|
+
m = !0, R();
|
|
135
|
+
}) : C;
|
|
136
|
+
}, f = {
|
|
137
137
|
local: "http://localhost:5173",
|
|
138
138
|
dev: "https://sdk-cdn.dev.0hash.com",
|
|
139
139
|
cert: "https://sdk-cdn.cert.zerohash.com",
|
|
@@ -141,25 +141,26 @@ const $ = {
|
|
|
141
141
|
"eu-cert": "https://sdk-cdn.cert.zerohash.eu",
|
|
142
142
|
"eu-prod": "https://sdk-cdn.zerohash.eu"
|
|
143
143
|
}, q = "https://sdk-cdn.gating.0hash.com", Q = (e, t, o = {}) => {
|
|
144
|
-
const { eu: r = !1, legacyAliases:
|
|
145
|
-
local:
|
|
146
|
-
dev:
|
|
147
|
-
gating:
|
|
148
|
-
cert:
|
|
149
|
-
prod:
|
|
144
|
+
const { eu: r = !1, legacyAliases: c = !1, local: i = f.local } = o, n = (s) => `${s}/${e}/${t}`, a = {
|
|
145
|
+
local: n(i),
|
|
146
|
+
dev: n(f.dev),
|
|
147
|
+
gating: n(q),
|
|
148
|
+
cert: n(f.cert),
|
|
149
|
+
prod: n(f.prod)
|
|
150
150
|
};
|
|
151
|
-
return
|
|
151
|
+
return c && (a.sandbox = n(f.cert), a.production = n(f.prod)), r && (a["eu-cert"] = n(f["eu-cert"]), a["eu-prod"] = n(f["eu-prod"])), a;
|
|
152
152
|
};
|
|
153
153
|
var F;
|
|
154
154
|
(function(e) {
|
|
155
155
|
e.NETWORK_ERROR = "network_error", e.AUTH_ERROR = "auth_error", e.NOT_FOUND_ERROR = "not_found_error", e.VALIDATION_ERROR = "validation_error", e.SERVER_ERROR = "server_error", e.CLIENT_ERROR = "client_error", e.UNKNOWN_ERROR = "unknown_error";
|
|
156
156
|
})(F || (F = {}));
|
|
157
|
-
const
|
|
157
|
+
const _ = {
|
|
158
158
|
evergreen: "#00381D",
|
|
159
159
|
green: "#CCFFD0",
|
|
160
160
|
offBlack: "#1C1B1C",
|
|
161
161
|
grayLight: "#EBEBE9"
|
|
162
|
-
}, X = ({ onRetry: e }) =>
|
|
162
|
+
}, X = ({ onRetry: e, onClose: t }) => U("div", { role: "alert", style: {
|
|
163
|
+
position: "relative",
|
|
163
164
|
display: "flex",
|
|
164
165
|
flexDirection: "column",
|
|
165
166
|
alignItems: "center",
|
|
@@ -169,80 +170,98 @@ const b = {
|
|
|
169
170
|
padding: "32px 24px",
|
|
170
171
|
textAlign: "center",
|
|
171
172
|
fontFamily: "inherit",
|
|
172
|
-
color:
|
|
173
|
+
color: _.offBlack,
|
|
173
174
|
background: "#FFFFFF",
|
|
174
|
-
border: `1px solid ${
|
|
175
|
+
border: `1px solid ${_.grayLight}`,
|
|
175
176
|
borderRadius: "12px"
|
|
176
|
-
}, children: [
|
|
177
|
+
}, children: [t && d("button", { type: "button", onClick: t, "aria-label": "Close", style: {
|
|
178
|
+
position: "absolute",
|
|
179
|
+
top: "12px",
|
|
180
|
+
right: "12px",
|
|
181
|
+
display: "flex",
|
|
182
|
+
padding: "4px",
|
|
183
|
+
color: _.offBlack,
|
|
184
|
+
background: "none",
|
|
185
|
+
border: "none",
|
|
186
|
+
cursor: "pointer",
|
|
187
|
+
lineHeight: 0
|
|
188
|
+
}, children: d("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: d("path", { d: "M18 6L6 18M6 6l12 12", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) }), d("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: d("path", { d: "M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z", stroke: _.evergreen, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }), d("p", { style: { margin: 0, fontSize: "16px", fontWeight: 600 }, children: "Something went wrong" }), d("p", { style: { margin: 0, fontSize: "14px", opacity: 0.75 }, children: "We couldn't load this content. Please check your internet connection and try again." }), d("button", { type: "button", onClick: e, style: {
|
|
177
189
|
marginTop: "8px",
|
|
178
190
|
padding: "8px 20px",
|
|
179
191
|
fontSize: "14px",
|
|
180
192
|
fontWeight: 600,
|
|
181
193
|
fontFamily: "inherit",
|
|
182
|
-
color:
|
|
183
|
-
background:
|
|
194
|
+
color: _.green,
|
|
195
|
+
background: _.evergreen,
|
|
184
196
|
border: "none",
|
|
185
197
|
borderRadius: "8px",
|
|
186
198
|
cursor: "pointer"
|
|
187
199
|
}, children: "Try again" })] }), Y = (e, t) => {
|
|
188
|
-
|
|
200
|
+
A(() => {
|
|
189
201
|
const o = e.current;
|
|
190
202
|
if (o)
|
|
191
|
-
for (const [r,
|
|
192
|
-
|
|
203
|
+
for (const [r, c] of Object.entries(t))
|
|
204
|
+
c !== void 0 && (o[r] = c);
|
|
193
205
|
});
|
|
194
206
|
}, ee = (e) => {
|
|
195
|
-
const { webComponentTag: t, appName: o, appVersion: r, scriptUrls:
|
|
196
|
-
|
|
207
|
+
const { webComponentTag: t, appName: o, appVersion: r, scriptUrls: c, fallbackScriptUrls: i, collectorUrls: n, env: a, jwt: s, timeoutMs: g } = e, [h, y] = L(!1), [p, S] = L(0);
|
|
208
|
+
A(() => (y(!1), Z({
|
|
197
209
|
webComponentTag: t,
|
|
198
210
|
appName: o ?? t,
|
|
199
211
|
appVersion: r,
|
|
200
|
-
scriptUrls:
|
|
212
|
+
scriptUrls: c,
|
|
201
213
|
fallbackScriptUrls: i,
|
|
202
|
-
collectorUrls:
|
|
203
|
-
env:
|
|
214
|
+
collectorUrls: n ?? $,
|
|
215
|
+
env: a,
|
|
204
216
|
jwt: s,
|
|
205
|
-
timeoutMs:
|
|
206
|
-
onError: () =>
|
|
217
|
+
timeoutMs: g,
|
|
218
|
+
onError: () => y(!0)
|
|
207
219
|
})), [
|
|
208
220
|
t,
|
|
209
221
|
o,
|
|
210
222
|
r,
|
|
211
|
-
a,
|
|
212
|
-
i,
|
|
213
223
|
c,
|
|
224
|
+
i,
|
|
214
225
|
n,
|
|
226
|
+
a,
|
|
215
227
|
s,
|
|
216
|
-
|
|
217
|
-
|
|
228
|
+
g,
|
|
229
|
+
p
|
|
218
230
|
]);
|
|
219
|
-
const
|
|
220
|
-
return { loadFailed:
|
|
221
|
-
}, te = Q("crypto-withdrawals-web", "index.js", { eu: !0 }),
|
|
231
|
+
const k = j(() => S((m) => m + 1), []);
|
|
232
|
+
return { loadFailed: h, retry: k };
|
|
233
|
+
}, te = Q("crypto-withdrawals-web", "index.js", { eu: !0 }), B = "zerohash-crypto-withdrawals", ne = ({
|
|
222
234
|
jwt: e,
|
|
223
235
|
env: t = "prod",
|
|
224
236
|
theme: o,
|
|
225
237
|
onCompleted: r,
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
238
|
+
onFailed: c,
|
|
239
|
+
onError: i,
|
|
240
|
+
onClose: n,
|
|
241
|
+
onLoaded: a,
|
|
242
|
+
onEvent: s,
|
|
243
|
+
...g
|
|
231
244
|
}) => {
|
|
232
|
-
const
|
|
233
|
-
Y(
|
|
234
|
-
const { loadFailed:
|
|
235
|
-
webComponentTag:
|
|
245
|
+
const h = D(null);
|
|
246
|
+
Y(h, { theme: o, onCompleted: r, onFailed: c, onError: i, onClose: n, onLoaded: a, onEvent: s });
|
|
247
|
+
const { loadFailed: y, retry: p } = ee({
|
|
248
|
+
webComponentTag: B,
|
|
236
249
|
scriptUrls: te,
|
|
237
250
|
env: t,
|
|
238
251
|
jwt: e
|
|
239
252
|
});
|
|
240
|
-
return
|
|
241
|
-
|
|
253
|
+
return y ? /* @__PURE__ */ d(
|
|
254
|
+
X,
|
|
255
|
+
{
|
|
256
|
+
onRetry: p,
|
|
257
|
+
onClose: n
|
|
258
|
+
}
|
|
259
|
+
) : M.createElement(B, {
|
|
260
|
+
ref: h,
|
|
242
261
|
jwt: e,
|
|
243
262
|
env: t,
|
|
244
263
|
theme: o,
|
|
245
|
-
...
|
|
264
|
+
...g
|
|
246
265
|
});
|
|
247
266
|
};
|
|
248
267
|
export {
|