@coinbase/cdp-react-native 0.0.95 → 0.0.97
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/_virtual/md5.js +7 -0
- package/dist/esm/apple-auth.js +14 -0
- package/dist/esm/{index4.js → components/ApplePayButton.js} +7 -7
- package/dist/esm/{index3.js → hooks/useApplePay.js} +3 -3
- package/dist/esm/index.js +3 -3
- package/dist/esm/{index6.js → internal/analytics/analytics.js} +2 -2
- package/dist/esm/{index8.js → internal/analytics/useSendComponentCallOnce.js} +1 -1
- package/dist/esm/{index7.js → internal/analytics/useSendHookCallOnce.js} +1 -1
- package/dist/esm/{index14.js → node_modules/crypt/crypt.js} +1 -1
- package/dist/esm/{index16.js → node_modules/is-buffer/index.js} +0 -6
- package/dist/esm/{index12.js → node_modules/md5/md5.js} +4 -4
- package/dist/esm/{index2.js → providers/ApplePayProvider.js} +1 -1
- package/dist/types/apple-auth.d.ts +1 -0
- package/package.json +21 -8
- package/dist/esm/index10.js +0 -7
- /package/dist/esm/{index18.js → _virtual/_commonjsHelpers.js} +0 -0
- /package/dist/esm/{index17.js → _virtual/crypt.js} +0 -0
- /package/dist/esm/{index13.js → _virtual/md52.js} +0 -0
- /package/dist/esm/{index11.js → internal/analytics/detectFramework.js} +0 -0
- /package/dist/esm/{index15.js → node_modules/charenc/charenc.js} +0 -0
- /package/dist/esm/{index5.js → utils/checkUserVerification.js} +0 -0
- /package/dist/esm/{index9.js → utils/parseWebViewMessage.js} +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { registerAppleAuthProvider as i } from "@coinbase/cdp-core";
|
|
2
|
+
import * as t from "expo-apple-authentication";
|
|
3
|
+
i(async () => {
|
|
4
|
+
const e = await t.signInAsync({
|
|
5
|
+
requestedScopes: [t.AppleAuthenticationScope.EMAIL]
|
|
6
|
+
});
|
|
7
|
+
if (!e.identityToken)
|
|
8
|
+
throw new Error("Apple Sign In did not return an identity token");
|
|
9
|
+
return {
|
|
10
|
+
identityToken: e.identityToken,
|
|
11
|
+
authorizationCode: e.authorizationCode ?? void 0,
|
|
12
|
+
email: e.email
|
|
13
|
+
};
|
|
14
|
+
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "
|
|
1
|
+
import "../internal/analytics/analytics.js";
|
|
2
2
|
import i, { useContext as p, useCallback as d } from "react";
|
|
3
|
-
import { useSendComponentCallOnce as c } from "
|
|
4
|
-
import {
|
|
3
|
+
import { useSendComponentCallOnce as c } from "../internal/analytics/useSendComponentCallOnce.js";
|
|
4
|
+
import { Platform as l, View as g, StyleSheet as v } from "react-native";
|
|
5
5
|
import { WebView as w } from "react-native-webview";
|
|
6
|
-
import { ApplePayContext as f } from "
|
|
7
|
-
import { parseWebViewMessage as u } from "
|
|
6
|
+
import { ApplePayContext as f } from "../providers/ApplePayProvider.js";
|
|
7
|
+
import { parseWebViewMessage as u } from "../utils/parseWebViewMessage.js";
|
|
8
8
|
function V({ style: s }) {
|
|
9
9
|
c("apple_pay_button");
|
|
10
10
|
const e = p(f);
|
|
@@ -21,7 +21,7 @@ function V({ style: s }) {
|
|
|
21
21
|
},
|
|
22
22
|
[e.paymentEventHandler]
|
|
23
23
|
);
|
|
24
|
-
return
|
|
24
|
+
return l.OS !== "ios" ? (__DEV__ && console.warn("ApplePayButton is only available on iOS"), null) : n ? /* @__PURE__ */ i.createElement(g, { style: [o.container, s] }, /* @__PURE__ */ i.createElement(
|
|
25
25
|
w,
|
|
26
26
|
{
|
|
27
27
|
source: { uri: n },
|
|
@@ -35,7 +35,7 @@ function V({ style: s }) {
|
|
|
35
35
|
}
|
|
36
36
|
)) : null;
|
|
37
37
|
}
|
|
38
|
-
const o =
|
|
38
|
+
const o = v.create({
|
|
39
39
|
container: {
|
|
40
40
|
height: 48,
|
|
41
41
|
width: "100%",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import { useSendHookCallOnce as r } from "
|
|
1
|
+
import "../internal/analytics/analytics.js";
|
|
2
|
+
import { useSendHookCallOnce as r } from "../internal/analytics/useSendHookCallOnce.js";
|
|
3
3
|
import { useContext as t } from "react";
|
|
4
|
-
import { ApplePayContext as o } from "
|
|
4
|
+
import { ApplePayContext as o } from "../providers/ApplePayProvider.js";
|
|
5
5
|
function u() {
|
|
6
6
|
r("use_apple_pay");
|
|
7
7
|
const e = t(o);
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ApplePayProvider as o } from "./
|
|
2
|
-
import { useApplePay as t } from "./
|
|
3
|
-
import { ApplePayButton as a } from "./
|
|
1
|
+
import { ApplePayProvider as o } from "./providers/ApplePayProvider.js";
|
|
2
|
+
import { useApplePay as t } from "./hooks/useApplePay.js";
|
|
3
|
+
import { ApplePayButton as a } from "./components/ApplePayButton.js";
|
|
4
4
|
export {
|
|
5
5
|
a as ApplePayButton,
|
|
6
6
|
o as ApplePayProvider,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import E from "
|
|
2
|
-
import { getFramework as m } from "./
|
|
1
|
+
import E from "../../_virtual/md5.js";
|
|
2
|
+
import { getFramework as m } from "./detectFramework.js";
|
|
3
3
|
const v = "1f8d3e558f493e38a037dbfadb8ba344", y = "d473b1dcc969105adab157226cd9cf63", i = Symbol.for("@coinbase/cdp-analytics");
|
|
4
4
|
function u() {
|
|
5
5
|
const n = globalThis;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { __module as h } from "
|
|
2
|
-
import { __require as S } from "
|
|
3
|
-
import { __require as q } from "
|
|
4
|
-
import { __require as w } from "
|
|
1
|
+
import { __module as h } from "../../_virtual/md52.js";
|
|
2
|
+
import { __require as S } from "../crypt/crypt.js";
|
|
3
|
+
import { __require as q } from "../charenc/charenc.js";
|
|
4
|
+
import { __require as w } from "../is-buffer/index.js";
|
|
5
5
|
var x;
|
|
6
6
|
function G() {
|
|
7
7
|
return x ? h.exports : (x = 1, function() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createEndUserApplePayOnrampOrder as f, APIError as h } from "@coinbase/cdp-api-client";
|
|
2
2
|
import { useCurrentUser as g, useConfig as v } from "@coinbase/cdp-hooks";
|
|
3
3
|
import C, { createContext as U, useReducer as x, useCallback as n, useEffect as A } from "react";
|
|
4
|
-
import { checkUserVerification as E } from "
|
|
4
|
+
import { checkUserVerification as E } from "../utils/checkUserVerification.js";
|
|
5
5
|
const I = U(null);
|
|
6
6
|
function w({ children: t, debug: a = !1 }) {
|
|
7
7
|
const [p, r] = x(P, i), { currentUser: o } = g(), { config: d } = v(), c = n(() => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { }
|
package/package.json
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cdp-react-native",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.97",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"peerDependencies": {
|
|
6
|
+
"expo-apple-authentication": ">=4.0.0",
|
|
6
7
|
"react": ">=18.2.0",
|
|
7
8
|
"react-native": ">=0.70.0",
|
|
8
9
|
"react-native-webview": ">=13.0.0",
|
|
9
|
-
"@coinbase/cdp-
|
|
10
|
-
"@coinbase/cdp-
|
|
11
|
-
"@coinbase/cdp-core": "^0.0.
|
|
10
|
+
"@coinbase/cdp-hooks": "^0.0.97",
|
|
11
|
+
"@coinbase/cdp-api-client": "^0.0.97",
|
|
12
|
+
"@coinbase/cdp-core": "^0.0.97"
|
|
13
|
+
},
|
|
14
|
+
"peerDependenciesMeta": {
|
|
15
|
+
"expo-apple-authentication": {
|
|
16
|
+
"optional": true
|
|
17
|
+
}
|
|
12
18
|
},
|
|
13
19
|
"devDependencies": {
|
|
14
20
|
"@testing-library/react": "^16.0.0",
|
|
@@ -17,23 +23,30 @@
|
|
|
17
23
|
"react-dom": "^19.1.2",
|
|
18
24
|
"react-native": "^0.79.6",
|
|
19
25
|
"react-native-webview": "^13.13.5",
|
|
20
|
-
"@coinbase/cdp-
|
|
21
|
-
"@coinbase/cdp-
|
|
22
|
-
"@coinbase/cdp-
|
|
26
|
+
"@coinbase/cdp-core": "0.0.97",
|
|
27
|
+
"@coinbase/cdp-hooks": "0.0.97",
|
|
28
|
+
"@coinbase/cdp-api-client": "0.0.97"
|
|
23
29
|
},
|
|
24
30
|
"files": [
|
|
25
31
|
"dist/**",
|
|
26
32
|
"!dist/**/*.tsbuildinfo"
|
|
27
33
|
],
|
|
34
|
+
"sideEffects": [
|
|
35
|
+
"./dist/esm/apple-auth.js"
|
|
36
|
+
],
|
|
28
37
|
"exports": {
|
|
29
38
|
".": {
|
|
30
39
|
"types": "./dist/types/index.d.ts",
|
|
31
40
|
"default": "./dist/esm/index.js"
|
|
32
41
|
},
|
|
42
|
+
"./apple-auth": {
|
|
43
|
+
"types": "./dist/types/apple-auth.d.ts",
|
|
44
|
+
"default": "./dist/esm/apple-auth.js"
|
|
45
|
+
},
|
|
33
46
|
"./package.json": "./package.json"
|
|
34
47
|
},
|
|
35
48
|
"scripts": {
|
|
36
|
-
"build": "pnpm run check:types && vite build
|
|
49
|
+
"build": "pnpm run check:types && vite build",
|
|
37
50
|
"build:watch": "vite build --config ../../vite.config.base.ts --watch",
|
|
38
51
|
"check:types": "tsc --noEmit",
|
|
39
52
|
"clean": "rm -rf dist",
|
package/dist/esm/index10.js
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|