@privy-io/expo 0.5.3 → 0.5.4

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.js CHANGED
@@ -1,4 +1,4 @@
1
- var e=require("@privy-io/js-sdk-core"),t=require("react"),s=require("react-native"),a=require("react-native-webview"),r=require("expo-application"),i=require("expo-linking"),n=require("expo-secure-store"),o=require("react-fast-compare");function l(e,t){return Object.keys(t).forEach(function(s){"default"===s||"__esModule"===s||e.hasOwnProperty(s)||Object.defineProperty(e,s,{enumerable:!0,get:function(){return t[s]}})}),e}function u(e,t,s,a){Object.defineProperty(e,t,{get:s,set:a,enumerable:!0,configurable:!0})}function c(e){return e&&e.__esModule?e.default:e}u(module.exports,"SecureStorageAdapter",()=>k),u(module.exports,"useOAuthFlow",()=>v);var d={};u(d,"PrivyContext",()=>S),u(d,"PrivyProvider",()=>E);var p={};p=JSON.parse('{"name":"@privy-io/expo","version":"0.5.3","description":"Expo client for the Privy Auth API","keywords":["authentication","authorization","identity","privacy","privy","user data","react-native","expo","web3"],"license":"Apache-2.0","source":"./src/index.ts","main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"require":"./dist/index.js","import":"./dist/index.mjs","types":"./dist/index.d.ts"}},"targets":{"main":{"isLibrary":true,"sourceMap":false,"optimize":true},"module":{"isLibrary":true,"sourceMap":false,"optimize":true}},"files":["dist/**/*","LICENSE","README.md"],"scripts":{"build":"npx parcel build --no-cache","clean":"rm -rf dist .turbo","dev":"npx parcel watch -p 4234","test":"jest --testMatch \\"**/test/**/*.test.ts\\"","test:ci":"npm run test","lint":"eslint \\"src/**/*.{ts,tsx,js,jsx}\\" && npx tsc --noEmit","format":"eslint \\"src/**/*.{ts,tsx,js,jsx}\\" --fix"},"peerDependencies":{"react":"*","react-native":"*","react-native-webview":"*","expo-constants":"*","expo-linking":"*","expo-secure-store":"*","expo-application":"*"},"dependencies":{"@privy-io/js-sdk-core":"0.11.3","react-fast-compare":"^3.2.2"},"devDependencies":{"@privy-io/eslint-config-custom":"*","@privy-io/parcel-config":"*","@privy-io/tsconfig":"*","@tsconfig/node16-strictest-esm":"^1.0.3","parcel":"2.10.1","typescript":"^4.9.5"},"author":"privy.io","publishConfig":{"access":"public"}}');const h=({client:e,isClientReady:s,isWebViewReady:r,setIsWebViewReady:i})=>{let n=(0,t.useRef)(null);(0,t.useEffect)(()=>{r&&n.current&&e.setMessagePoster(n.current)},[r,e]);let o=(0,t.useCallback)(async t=>{let{data:s}=t.nativeEvent,a=e.embeddedWallet.getMessageHandler();a?.(JSON.parse(s))},[e]);// Ensure we only render the webview once the client is initialized
1
+ var e=require("@privy-io/js-sdk-core"),t=require("react"),s=require("react-native"),a=require("react-native-webview"),r=require("expo-application"),i=require("expo-linking"),n=require("expo-secure-store"),o=require("react-fast-compare");function l(e,t){return Object.keys(t).forEach(function(s){"default"===s||"__esModule"===s||e.hasOwnProperty(s)||Object.defineProperty(e,s,{enumerable:!0,get:function(){return t[s]}})}),e}function u(e,t,s,a){Object.defineProperty(e,t,{get:s,set:a,enumerable:!0,configurable:!0})}function c(e){return e&&e.__esModule?e.default:e}u(module.exports,"SecureStorageAdapter",()=>k),u(module.exports,"useOAuthFlow",()=>v);var d={};u(d,"PrivyContext",()=>S),u(d,"PrivyProvider",()=>E);var p={};p=JSON.parse('{"name":"@privy-io/expo","version":"0.5.4","description":"Expo client for the Privy Auth API","keywords":["authentication","authorization","identity","privacy","privy","user data","react-native","expo","web3"],"license":"Apache-2.0","source":"./src/index.ts","main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"require":"./dist/index.js","import":"./dist/index.mjs","types":"./dist/index.d.ts"}},"targets":{"main":{"isLibrary":true,"sourceMap":false,"optimize":true},"module":{"isLibrary":true,"sourceMap":false,"optimize":true}},"files":["dist/**/*","LICENSE","README.md"],"scripts":{"build":"npx parcel build --no-cache","clean":"rm -rf dist .turbo","dev":"npx parcel watch -p 4234","test":"jest --testMatch \\"**/test/**/*.test.ts\\"","test:ci":"npm run test","lint":"eslint \\"src/**/*.{ts,tsx,js,jsx}\\" && npx tsc --noEmit","format":"eslint \\"src/**/*.{ts,tsx,js,jsx}\\" --fix"},"peerDependencies":{"react":"*","react-native":"*","react-native-webview":"*","expo-constants":"*","expo-linking":"*","expo-secure-store":"*","expo-application":"*"},"dependencies":{"@privy-io/js-sdk-core":"0.11.4","react-fast-compare":"^3.2.2"},"devDependencies":{"@privy-io/eslint-config-custom":"*","@privy-io/parcel-config":"*","@privy-io/tsconfig":"*","@tsconfig/node16-strictest-esm":"^1.0.3","parcel":"2.10.1","typescript":"^4.9.5"},"author":"privy.io","publishConfig":{"access":"public"}}');const h=({client:e,isClientReady:s,isWebViewReady:r,setIsWebViewReady:i})=>{let n=(0,t.useRef)(null);(0,t.useEffect)(()=>{r&&n.current&&e.setMessagePoster(n.current)},[r,e]);let o=(0,t.useCallback)(async t=>{let{data:s}=t.nativeEvent,a=e.embeddedWallet.getMessageHandler();a?.(JSON.parse(s))},[e]);// Ensure we only render the webview once the client is initialized
2
2
  return s?c(t).createElement(c(a),{style:{flex:1},ref:n,source:{uri:e.embeddedWallet.getURL()},onLoad:()=>i(!0),onMessage:o}):null},y=({client:s,user:a,wallet:r,setWallet:i,isWebViewReady:n})=>{let o=(0,t.useMemo)(()=>(0,e.getUserEmbeddedWallet)(a),[a]),l=(0,t.useCallback)(async e=>{i({status:"creating"});try{let t=await s.embeddedWallet.create(e);i({status:"connected",provider:t})}catch(e){i({status:"error",error:"Error creating embedded wallet"})}},[s]),u=(0,t.useCallback)(async e=>{if(o){i({status:"connecting"});try{let t=await s.embeddedWallet.getProvider(o,e);i({status:"connected",provider:t})}catch(e){i({status:"needs-recovery",recover:u})}}},[s,o]);return(0,t.useEffect)(()=>{// Ensures that in the event of an expiring session or otherwise bad token,
3
3
  // the wallet returns to disconnected state along with a logged out user
4
4
  if(!a&&"disconnected"!==r.status)return i({status:"disconnected"});async function t(){// There is a user but no embedded wallet account
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import e from"@privy-io/js-sdk-core";import t,{createContext as a,useState as s,useCallback as r,useMemo as i,useRef as n,useEffect as o,useContext as c}from"react";import{View as d}from"react-native";import l from"react-native-webview";import{applicationId as u}from"expo-application";import{createURL as p,openURL as h,useURL as f,parse as y}from"expo-linking";import{getItemAsync as b,setItemAsync as g,deleteItemAsync as m}from"expo-secure-store";import v from"react-fast-compare";function $(e,t,a,s){Object.defineProperty(e,t,{get:a,set:s,enumerable:!0,configurable:!0})}var w,x={};$(x,"PrivyContext",()=>j),$(x,"PrivyProvider",()=>O);var C={};C=JSON.parse('{"name":"@privy-io/expo","version":"0.5.3","description":"Expo client for the Privy Auth API","keywords":["authentication","authorization","identity","privacy","privy","user data","react-native","expo","web3"],"license":"Apache-2.0","source":"./src/index.ts","main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"require":"./dist/index.js","import":"./dist/index.mjs","types":"./dist/index.d.ts"}},"targets":{"main":{"isLibrary":true,"sourceMap":false,"optimize":true},"module":{"isLibrary":true,"sourceMap":false,"optimize":true}},"files":["dist/**/*","LICENSE","README.md"],"scripts":{"build":"npx parcel build --no-cache","clean":"rm -rf dist .turbo","dev":"npx parcel watch -p 4234","test":"jest --testMatch \\"**/test/**/*.test.ts\\"","test:ci":"npm run test","lint":"eslint \\"src/**/*.{ts,tsx,js,jsx}\\" && npx tsc --noEmit","format":"eslint \\"src/**/*.{ts,tsx,js,jsx}\\" --fix"},"peerDependencies":{"react":"*","react-native":"*","react-native-webview":"*","expo-constants":"*","expo-linking":"*","expo-secure-store":"*","expo-application":"*"},"dependencies":{"@privy-io/js-sdk-core":"0.11.3","react-fast-compare":"^3.2.2"},"devDependencies":{"@privy-io/eslint-config-custom":"*","@privy-io/parcel-config":"*","@privy-io/tsconfig":"*","@tsconfig/node16-strictest-esm":"^1.0.3","parcel":"2.10.1","typescript":"^4.9.5"},"author":"privy.io","publishConfig":{"access":"public"}}');let W=({client:e,isClientReady:a,isWebViewReady:s,setIsWebViewReady:i})=>{let c=n(null);o(()=>{s&&c.current&&e.setMessagePoster(c.current)},[s,e]);let d=r(async t=>{let{data:a}=t.nativeEvent,s=e.embeddedWallet.getMessageHandler();s?.(JSON.parse(a))},[e]);// Ensure we only render the webview once the client is initialized
1
+ import e from"@privy-io/js-sdk-core";import t,{createContext as a,useState as s,useCallback as r,useMemo as i,useRef as n,useEffect as o,useContext as c}from"react";import{View as d}from"react-native";import l from"react-native-webview";import{applicationId as u}from"expo-application";import{createURL as p,openURL as h,useURL as f,parse as y}from"expo-linking";import{getItemAsync as b,setItemAsync as g,deleteItemAsync as m}from"expo-secure-store";import v from"react-fast-compare";function $(e,t,a,s){Object.defineProperty(e,t,{get:a,set:s,enumerable:!0,configurable:!0})}var w,x={};$(x,"PrivyContext",()=>j),$(x,"PrivyProvider",()=>O);var C={};C=JSON.parse('{"name":"@privy-io/expo","version":"0.5.4","description":"Expo client for the Privy Auth API","keywords":["authentication","authorization","identity","privacy","privy","user data","react-native","expo","web3"],"license":"Apache-2.0","source":"./src/index.ts","main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"require":"./dist/index.js","import":"./dist/index.mjs","types":"./dist/index.d.ts"}},"targets":{"main":{"isLibrary":true,"sourceMap":false,"optimize":true},"module":{"isLibrary":true,"sourceMap":false,"optimize":true}},"files":["dist/**/*","LICENSE","README.md"],"scripts":{"build":"npx parcel build --no-cache","clean":"rm -rf dist .turbo","dev":"npx parcel watch -p 4234","test":"jest --testMatch \\"**/test/**/*.test.ts\\"","test:ci":"npm run test","lint":"eslint \\"src/**/*.{ts,tsx,js,jsx}\\" && npx tsc --noEmit","format":"eslint \\"src/**/*.{ts,tsx,js,jsx}\\" --fix"},"peerDependencies":{"react":"*","react-native":"*","react-native-webview":"*","expo-constants":"*","expo-linking":"*","expo-secure-store":"*","expo-application":"*"},"dependencies":{"@privy-io/js-sdk-core":"0.11.4","react-fast-compare":"^3.2.2"},"devDependencies":{"@privy-io/eslint-config-custom":"*","@privy-io/parcel-config":"*","@privy-io/tsconfig":"*","@tsconfig/node16-strictest-esm":"^1.0.3","parcel":"2.10.1","typescript":"^4.9.5"},"author":"privy.io","publishConfig":{"access":"public"}}');let W=({client:e,isClientReady:a,isWebViewReady:s,setIsWebViewReady:i})=>{let c=n(null);o(()=>{s&&c.current&&e.setMessagePoster(c.current)},[s,e]);let d=r(async t=>{let{data:a}=t.nativeEvent,s=e.embeddedWallet.getMessageHandler();s?.(JSON.parse(a))},[e]);// Ensure we only render the webview once the client is initialized
2
2
  return a?t.createElement(l,{style:{flex:1},ref:c,source:{uri:e.embeddedWallet.getURL()},onLoad:()=>i(!0),onMessage:d}):null},E=({client:e,user:t,wallet:a,setWallet:s,isWebViewReady:n})=>{let c=i(()=>$diYGi$getUserEmbeddedWallet(t),[t]),d=r(async t=>{s({status:"creating"});try{let a=await e.embeddedWallet.create(t);s({status:"connected",provider:a})}catch(e){s({status:"error",error:"Error creating embedded wallet"})}},[e]),l=r(async t=>{if(c){s({status:"connecting"});try{let a=await e.embeddedWallet.getProvider(c,t);s({status:"connected",provider:a})}catch(e){s({status:"needs-recovery",recover:l})}}},[e,c]);return o(()=>{// Ensures that in the event of an expiring session or otherwise bad token,
3
3
  // the wallet returns to disconnected state along with a logged out user
4
4
  if(!t&&"disconnected"!==a.status)return s({status:"disconnected"});async function r(){// There is a user but no embedded wallet account
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@privy-io/expo",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "description": "Expo client for the Privy Auth API",
5
5
  "keywords": [
6
6
  "authentication",
@@ -61,7 +61,7 @@
61
61
  "expo-application": "*"
62
62
  },
63
63
  "dependencies": {
64
- "@privy-io/js-sdk-core": "0.11.3",
64
+ "@privy-io/js-sdk-core": "0.11.4",
65
65
  "react-fast-compare": "^3.2.2"
66
66
  },
67
67
  "devDependencies": {