@coinbase/cdp-react-native 0.0.87 → 0.0.89
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/esm/index6.js +34 -29
- package/package.json +7 -7
package/dist/esm/index6.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import E from "./index10.js";
|
|
2
2
|
import { getFramework as m } from "./index11.js";
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
return
|
|
7
|
-
|
|
3
|
+
const v = "1f8d3e558f493e38a037dbfadb8ba344", y = "d473b1dcc969105adab157226cd9cf63", i = Symbol.for("@coinbase/cdp-analytics");
|
|
4
|
+
function u() {
|
|
5
|
+
const n = globalThis;
|
|
6
|
+
return n[i] || (n[i] = {
|
|
7
|
+
developerIdentifier: "",
|
|
8
|
+
endUserIdentifier: "",
|
|
8
9
|
enabled: !0,
|
|
9
10
|
isProduction: !1,
|
|
10
11
|
isUsingMocks: !1,
|
|
@@ -12,33 +13,37 @@ function g() {
|
|
|
12
13
|
sendActionCallEvent: (e) => o({ ...e, type: "action_call" }),
|
|
13
14
|
sendHookCallEvent: (e) => o({ ...e, type: "hook_call" }),
|
|
14
15
|
sendComponentCallEvent: (e) => o({ ...e, type: "component_call" }),
|
|
16
|
+
sendSessionRefreshEvent: (e) => o({ ...e, type: "session_refresh" }),
|
|
15
17
|
versionRegistry: {},
|
|
16
18
|
registerPackageVersion: (e, s) => {
|
|
17
|
-
|
|
19
|
+
t.versionRegistry[e] = s;
|
|
18
20
|
}
|
|
19
|
-
}),
|
|
21
|
+
}), n[i];
|
|
20
22
|
}
|
|
21
|
-
const
|
|
22
|
-
async function o(
|
|
23
|
-
if (!
|
|
23
|
+
const t = u(), _ = /* @__PURE__ */ new Set(["session_refresh"]);
|
|
24
|
+
async function o(n) {
|
|
25
|
+
if (!t.enabled)
|
|
26
|
+
return;
|
|
27
|
+
const s = _.has(n.type) ? t.endUserIdentifier : t.developerIdentifier;
|
|
28
|
+
if (!s)
|
|
24
29
|
return;
|
|
25
|
-
const
|
|
26
|
-
user_id:
|
|
27
|
-
event_type:
|
|
28
|
-
platform:
|
|
29
|
-
timestamp:
|
|
30
|
+
const a = Date.now(), d = [{
|
|
31
|
+
user_id: s,
|
|
32
|
+
event_type: n.type,
|
|
33
|
+
platform: r() ? "web" : "native",
|
|
34
|
+
timestamp: a,
|
|
30
35
|
event_properties: {
|
|
31
36
|
project_name: "cdp-embedded-wallet",
|
|
32
37
|
framework: m(),
|
|
33
|
-
isLocalHost:
|
|
34
|
-
isUsingMocks:
|
|
35
|
-
package_versions:
|
|
36
|
-
...
|
|
38
|
+
isLocalHost: g(),
|
|
39
|
+
isUsingMocks: t.isUsingMocks,
|
|
40
|
+
package_versions: t.versionRegistry,
|
|
41
|
+
...n
|
|
37
42
|
}
|
|
38
|
-
}],
|
|
39
|
-
client:
|
|
40
|
-
e:
|
|
41
|
-
checksum:
|
|
43
|
+
}], c = JSON.stringify(d), l = a.toString(), f = E(c + l), p = {
|
|
44
|
+
client: t.isProduction ? y : v,
|
|
45
|
+
e: c,
|
|
46
|
+
checksum: f
|
|
42
47
|
};
|
|
43
48
|
await fetch("https://cca-lite.coinbase.com/amp", {
|
|
44
49
|
method: "POST",
|
|
@@ -46,15 +51,15 @@ async function o(t) {
|
|
|
46
51
|
headers: {
|
|
47
52
|
"Content-Type": "application/json"
|
|
48
53
|
},
|
|
49
|
-
body: JSON.stringify(
|
|
54
|
+
body: JSON.stringify(p)
|
|
50
55
|
});
|
|
51
56
|
}
|
|
52
|
-
function
|
|
57
|
+
function r() {
|
|
53
58
|
return typeof window < "u" && typeof document < "u";
|
|
54
59
|
}
|
|
55
|
-
function
|
|
56
|
-
return
|
|
60
|
+
function g() {
|
|
61
|
+
return r() ? window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" : !1;
|
|
57
62
|
}
|
|
58
63
|
export {
|
|
59
|
-
|
|
64
|
+
t as Analytics
|
|
60
65
|
};
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cdp-react-native",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.89",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"react": ">=18.2.0",
|
|
7
7
|
"react-native": ">=0.70.0",
|
|
8
8
|
"react-native-webview": ">=13.0.0",
|
|
9
|
-
"@coinbase/cdp-api-client": "^0.0.
|
|
10
|
-
"@coinbase/cdp-core": "^0.0.
|
|
11
|
-
"@coinbase/cdp-hooks": "^0.0.
|
|
9
|
+
"@coinbase/cdp-api-client": "^0.0.89",
|
|
10
|
+
"@coinbase/cdp-core": "^0.0.89",
|
|
11
|
+
"@coinbase/cdp-hooks": "^0.0.89"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"@testing-library/react": "^16.0.0",
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"react-dom": "^19.1.2",
|
|
18
18
|
"react-native": "^0.79.6",
|
|
19
19
|
"react-native-webview": "^13.13.5",
|
|
20
|
-
"@coinbase/cdp-api-client": "0.0.
|
|
21
|
-
"@coinbase/cdp-core": "0.0.
|
|
22
|
-
"@coinbase/cdp-hooks": "0.0.
|
|
20
|
+
"@coinbase/cdp-api-client": "0.0.89",
|
|
21
|
+
"@coinbase/cdp-core": "0.0.89",
|
|
22
|
+
"@coinbase/cdp-hooks": "0.0.89"
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
25
|
"dist/**",
|