@coinbase/cdp-react-native 0.0.96 → 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.
@@ -0,0 +1,7 @@
1
+ import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
+ import { __require as o } from "../node_modules/md5/md5.js";
3
+ var t = o();
4
+ const a = /* @__PURE__ */ r(t);
5
+ export {
6
+ a as default
7
+ };
@@ -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 "./index6.js";
1
+ import "../internal/analytics/analytics.js";
2
2
  import i, { useContext as p, useCallback as d } from "react";
3
- import { useSendComponentCallOnce as c } from "./index8.js";
4
- import { StyleSheet as l, Platform as g, View as v } from "react-native";
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 "./index2.js";
7
- import { parseWebViewMessage as u } from "./index9.js";
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 g.OS !== "ios" ? (__DEV__ && console.warn("ApplePayButton is only available on iOS"), null) : n ? /* @__PURE__ */ i.createElement(v, { style: [o.container, s] }, /* @__PURE__ */ i.createElement(
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 = l.create({
38
+ const o = v.create({
39
39
  container: {
40
40
  height: 48,
41
41
  width: "100%",
@@ -1,7 +1,7 @@
1
- import "./index6.js";
2
- import { useSendHookCallOnce as r } from "./index7.js";
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 "./index2.js";
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 "./index2.js";
2
- import { useApplePay as t } from "./index3.js";
3
- import { ApplePayButton as a } from "./index4.js";
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 "./index10.js";
2
- import { getFramework as m } from "./index11.js";
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,5 +1,5 @@
1
1
  import { useRef as t, useEffect as o } from "react";
2
- import { Analytics as r } from "./index6.js";
2
+ import { Analytics as r } from "./analytics.js";
3
3
  function s(e) {
4
4
  const n = t(!1);
5
5
  o(() => {
@@ -1,5 +1,5 @@
1
1
  import { useRef as r, useEffect as t } from "react";
2
- import { Analytics as n } from "./index6.js";
2
+ import { Analytics as n } from "./analytics.js";
3
3
  function s(e) {
4
4
  const o = r(!1);
5
5
  t(() => {
@@ -1,4 +1,4 @@
1
- import { __module as a } from "./index17.js";
1
+ import { __module as a } from "../../_virtual/crypt.js";
2
2
  var h;
3
3
  function c() {
4
4
  return h ? a.exports : (h = 1, function() {
@@ -1,9 +1,3 @@
1
- /*!
2
- * Determine if an object is a Buffer
3
- *
4
- * @author Feross Aboukhadijeh <https://feross.org>
5
- * @license MIT
6
- */
7
1
  var f, e;
8
2
  function t() {
9
3
  if (e) return f;
@@ -1,7 +1,7 @@
1
- import { __module as h } from "./index13.js";
2
- import { __require as S } from "./index14.js";
3
- import { __require as q } from "./index15.js";
4
- import { __require as w } from "./index16.js";
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 "./index5.js";
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.96",
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-api-client": "^0.0.96",
10
- "@coinbase/cdp-core": "^0.0.96",
11
- "@coinbase/cdp-hooks": "^0.0.96"
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-api-client": "0.0.96",
21
- "@coinbase/cdp-core": "0.0.96",
22
- "@coinbase/cdp-hooks": "0.0.96"
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 --config ../../vite.config.base.ts",
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",
@@ -1,7 +0,0 @@
1
- import { getDefaultExportFromCjs as r } from "./index18.js";
2
- import { __require as o } from "./index12.js";
3
- var t = o();
4
- const a = /* @__PURE__ */ r(t);
5
- export {
6
- a as default
7
- };
File without changes
File without changes