@connect-xyz/withdraw-react 0.42.1 → 0.42.3
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/dist/index.d.ts +1 -1
- package/dist/index.js +28 -28
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -106,7 +106,7 @@ declare type Theme = 'auto' | 'light' | 'dark';
|
|
|
106
106
|
* // With callback functions
|
|
107
107
|
* <Withdraw
|
|
108
108
|
* jwt="your-jwt-token"
|
|
109
|
-
* theme="
|
|
109
|
+
* theme="light"
|
|
110
110
|
* onError={({ errorCode, reason }) => console.error('Withdraw error:', errorCode, 'Reason:', reason)}
|
|
111
111
|
* onClose={() => console.log('Withdraw closed')}
|
|
112
112
|
* onWithdrawal={({ data }) => console.log('Withdrawal completed:', data.withdrawalId, 'Status:', data.status.value)}
|
package/dist/index.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import w, { useRef as h, useEffect as
|
|
1
|
+
import w, { useRef as h, useEffect as a } from "react";
|
|
2
2
|
const x = {
|
|
3
3
|
sandbox: "https://sdk.sandbox.connect.xyz/withdraw-web/index.js",
|
|
4
4
|
production: "https://sdk.connect.xyz/withdraw-web/index.js"
|
|
5
|
-
}, y = "connect-withdraw-script",
|
|
6
|
-
jwt:
|
|
7
|
-
env:
|
|
8
|
-
theme:
|
|
9
|
-
onError:
|
|
10
|
-
onClose:
|
|
11
|
-
onEvent:
|
|
12
|
-
onWithdrawal:
|
|
13
|
-
onLoaded:
|
|
14
|
-
...
|
|
5
|
+
}, y = "connect-withdraw-script", l = "connect-withdraw", I = (n = "production") => x[n], b = ({
|
|
6
|
+
jwt: n,
|
|
7
|
+
env: c = "production",
|
|
8
|
+
theme: e,
|
|
9
|
+
onError: o,
|
|
10
|
+
onClose: i,
|
|
11
|
+
onEvent: s,
|
|
12
|
+
onWithdrawal: d,
|
|
13
|
+
onLoaded: p,
|
|
14
|
+
...m
|
|
15
15
|
}) => {
|
|
16
|
-
const
|
|
17
|
-
return
|
|
18
|
-
const t =
|
|
19
|
-
t && (
|
|
20
|
-
}, [
|
|
21
|
-
const t = I(
|
|
22
|
-
if (document.getElementById(
|
|
16
|
+
const u = h(null);
|
|
17
|
+
return a(() => {
|
|
18
|
+
const t = u.current;
|
|
19
|
+
t && (e !== void 0 && (t.theme = e), o && (t.onError = o), i && (t.onClose = i), s && (t.onEvent = s), d && (t.onWithdrawal = d), p && (t.onLoaded = p));
|
|
20
|
+
}, [e, o, i, s, d, p]), a(() => {
|
|
21
|
+
const t = I(c), f = `${y}-${c}`;
|
|
22
|
+
if (document.getElementById(f))
|
|
23
23
|
return;
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
console.error(`Failed to load the script for ${
|
|
27
|
-
}, document.head.appendChild(
|
|
28
|
-
}, [
|
|
29
|
-
ref:
|
|
30
|
-
jwt:
|
|
31
|
-
env:
|
|
32
|
-
theme:
|
|
33
|
-
...
|
|
24
|
+
const r = document.createElement("script");
|
|
25
|
+
r.id = f, r.src = t, r.type = "module", r.async = !0, r.onerror = () => {
|
|
26
|
+
console.error(`Failed to load the script for ${l} from ${c} environment.`);
|
|
27
|
+
}, document.head.appendChild(r);
|
|
28
|
+
}, [c]), w.createElement(l, {
|
|
29
|
+
ref: u,
|
|
30
|
+
jwt: n,
|
|
31
|
+
env: c,
|
|
32
|
+
theme: e,
|
|
33
|
+
...m
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
36
|
export {
|