@zerohash-sdk/fiat-withdrawals-react 1.3.1 → 1.3.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 CHANGED
@@ -79,7 +79,7 @@ declare type ErrorPayload = {
79
79
  * // With callback functions
80
80
  * <FiatWithdrawals
81
81
  * jwt="your-jwt-token"
82
- * theme="auto"
82
+ * theme="light"
83
83
  * onLoaded={() => console.log('Fiat withdrawals loaded and ready')}
84
84
  * onCompleted={({ amountWithdrawn }) => console.log('Withdrawn', amountWithdrawn)}
85
85
  * onClose={() => console.log('Fiat withdrawals closed')}
package/dist/index.js CHANGED
@@ -4,34 +4,34 @@ const x = {
4
4
  dev: "https://connect-sdk.dev.0hash.com/fiat-withdrawals-web/index.js",
5
5
  cert: "https://sdk.sandbox.connect.xyz/fiat-withdrawals-web/index.js",
6
6
  prod: "https://sdk.connect.xyz/fiat-withdrawals-web/index.js"
7
- }, b = "zerohash-fiat-withdrawals-script", f = "zerohash-fiat-withdrawals", y = (s = "prod") => x[s], R = ({
8
- jwt: s,
9
- env: r = "prod",
10
- theme: p,
7
+ }, b = "zerohash-fiat-withdrawals-script", p = "zerohash-fiat-withdrawals", y = (i = "prod") => x[i], R = ({
8
+ jwt: i,
9
+ env: e = "prod",
10
+ theme: s,
11
11
  onCompleted: c,
12
- onError: i,
13
- onClose: a,
12
+ onError: a,
13
+ onClose: o,
14
14
  onLoaded: n,
15
- onEvent: o,
15
+ onEvent: d,
16
16
  ...w
17
17
  }) => {
18
- const d = m(null);
18
+ const l = m(null);
19
19
  return h(() => {
20
- const t = d.current;
21
- t && (c && (t.onCompleted = c), i && (t.onError = i), a && (t.onClose = a), n && (t.onLoaded = n), o && (t.onEvent = o));
22
- }, [c, i, a, n, o]), h(() => {
23
- const t = y(r), l = `${b}-${r}`;
24
- if (document.getElementById(l))
20
+ const t = l.current;
21
+ t && (s !== void 0 && (t.theme = s), c && (t.onCompleted = c), a && (t.onError = a), o && (t.onClose = o), n && (t.onLoaded = n), d && (t.onEvent = d));
22
+ }, [s, c, a, o, n, d]), h(() => {
23
+ const t = y(e), f = `${b}-${e}`;
24
+ if (document.getElementById(f))
25
25
  return;
26
- const e = document.createElement("script");
27
- e.id = l, e.src = t, e.type = "module", e.async = !0, e.onerror = () => {
28
- console.error(`Failed to load the script for ${f} from ${r} environment.`);
29
- }, document.head.appendChild(e);
30
- }, [r]), u.createElement(f, {
31
- ref: d,
32
- jwt: s,
33
- env: r,
34
- theme: p,
26
+ const r = document.createElement("script");
27
+ r.id = f, r.src = t, r.type = "module", r.async = !0, r.onerror = () => {
28
+ console.error(`Failed to load the script for ${p} from ${e} environment.`);
29
+ }, document.head.appendChild(r);
30
+ }, [e]), u.createElement(p, {
31
+ ref: l,
32
+ jwt: i,
33
+ env: e,
34
+ theme: s,
35
35
  ...w
36
36
  });
37
37
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zerohash-sdk/fiat-withdrawals-react",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",