@explorins/pers-sdk-react-native 2.2.0-alpha.9 → 2.2.0
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/__tests__/PersSDKProvider.test.d.ts +2 -0
- package/dist/__tests__/PersSDKProvider.test.d.ts.map +1 -0
- package/dist/__tests__/PersSDKProvider.test.js +290 -0
- package/dist/__tests__/__mocks__/pers-sdk-core.d.ts +42 -0
- package/dist/__tests__/__mocks__/pers-sdk-core.d.ts.map +1 -0
- package/dist/__tests__/__mocks__/pers-sdk-core.js +48 -0
- package/dist/__tests__/__mocks__/pers-shared.d.ts +15 -0
- package/dist/__tests__/__mocks__/pers-shared.d.ts.map +1 -0
- package/dist/__tests__/__mocks__/pers-shared.js +2 -0
- package/dist/__tests__/setup.d.ts +2 -0
- package/dist/__tests__/setup.d.ts.map +1 -0
- package/dist/__tests__/setup.js +35 -0
- package/dist/hooks/useRedemptions.d.ts.map +1 -1
- package/dist/index.js +481 -51
- package/dist/index.js.map +1 -1
- package/dist/providers/PersSDKProvider.js +1 -1
- package/package.json +199 -189
- package/src/__tests__/PersSDKProvider.test.tsx +420 -0
- package/src/__tests__/__mocks__/pers-sdk-core.ts +83 -0
- package/src/__tests__/__mocks__/pers-shared.ts +17 -0
- package/src/__tests__/setup.ts +40 -0
- package/src/hooks/useRedemptions.ts +1 -1
- package/src/providers/PersSDKProvider.tsx +1 -1
|
@@ -102,7 +102,7 @@ export const PersSDKProvider = ({ children, config }) => {
|
|
|
102
102
|
setIsAuthenticated(true);
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
if (event.type === 'logout_success' || event.type === 'session_restoration_failed'
|
|
105
|
+
if (event.type === 'logout_success' || event.type === 'session_restoration_failed') {
|
|
106
106
|
setUser(null);
|
|
107
107
|
setIsAuthenticated(false);
|
|
108
108
|
}
|
package/package.json
CHANGED
|
@@ -1,189 +1,199 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@explorins/pers-sdk-react-native",
|
|
3
|
-
"version": "2.2.0
|
|
4
|
-
"description": "React Native SDK for PERS Platform - Tourism Loyalty System with Blockchain Transaction Signing and WebAuthn Authentication",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build": "tsc && rollup -c --bundleConfigAsCjs",
|
|
9
|
-
"build:watch": "rollup -c --bundleConfigAsCjs --watch",
|
|
10
|
-
"dev": "tsc --watch",
|
|
11
|
-
"clean": "rimraf dist",
|
|
12
|
-
"docs": "typedoc",
|
|
13
|
-
"docs:dev": "typedoc --watch",
|
|
14
|
-
"docs:json": "typedoc --json docs/api.json",
|
|
15
|
-
"docs:serve": "npx http-server docs -p 8080",
|
|
16
|
-
"prepublishOnly": "npm run clean && npm run build",
|
|
17
|
-
"publish-version": "npm run clean && npm run build && npm version patch && npm publish",
|
|
18
|
-
"publish-with-docs": "npm run clean && npm run build && npm run docs && npm version patch && npm publish",
|
|
19
|
-
"yalc:publish": "npm version patch --no-git-tag-version && npm run build && yalc publish",
|
|
20
|
-
"yalc:push": "npm version patch --no-git-tag-version && npm run build && yalc push"
|
|
21
|
-
},
|
|
22
|
-
"keywords": [
|
|
23
|
-
"pers",
|
|
24
|
-
"sdk",
|
|
25
|
-
"react-native",
|
|
26
|
-
"tourism",
|
|
27
|
-
"loyalty",
|
|
28
|
-
"blockchain",
|
|
29
|
-
"web3",
|
|
30
|
-
"webauthn",
|
|
31
|
-
"transaction-signing",
|
|
32
|
-
"rewards",
|
|
33
|
-
"authentication",
|
|
34
|
-
"biometrics",
|
|
35
|
-
"secure-storage"
|
|
36
|
-
],
|
|
37
|
-
"author": "eXplorins",
|
|
38
|
-
"license": "MIT",
|
|
39
|
-
"dependencies": {
|
|
40
|
-
"@explorins/pers-sdk": "^2.1.
|
|
41
|
-
"@explorins/pers-signer": "^1.0.34",
|
|
42
|
-
"buffer": "^6.0.3",
|
|
43
|
-
"ethers": "^6.15.0",
|
|
44
|
-
"react-native-url-polyfill": "^2.0.0"
|
|
45
|
-
},
|
|
46
|
-
"browser": {
|
|
47
|
-
"crypto": false,
|
|
48
|
-
"url": false,
|
|
49
|
-
"http": false,
|
|
50
|
-
"https": false,
|
|
51
|
-
"zlib": false,
|
|
52
|
-
"stream": false,
|
|
53
|
-
"assert": false,
|
|
54
|
-
"path": false,
|
|
55
|
-
"fs": false,
|
|
56
|
-
"os": false,
|
|
57
|
-
"readable-stream": false,
|
|
58
|
-
"util": false,
|
|
59
|
-
"events": false,
|
|
60
|
-
"net": false,
|
|
61
|
-
"tls": false,
|
|
62
|
-
"child_process": false,
|
|
63
|
-
"pngjs": false,
|
|
64
|
-
"pngjs/lib/bitmapper": false,
|
|
65
|
-
"pngjs/lib/parser-async": false,
|
|
66
|
-
"pngjs/lib/parser-sync": false,
|
|
67
|
-
"./bitmapper": false,
|
|
68
|
-
"hash-base": false,
|
|
69
|
-
"@ethereumjs/common": false,
|
|
70
|
-
"@ethereumjs/tx": false,
|
|
71
|
-
"@ethereumjs/util": false,
|
|
72
|
-
"stream-browserify": false,
|
|
73
|
-
"crypto-browserify": false,
|
|
74
|
-
"inherits": false,
|
|
75
|
-
"safe-buffer": false,
|
|
76
|
-
"string_decoder": false,
|
|
77
|
-
"process-nextick-args": false,
|
|
78
|
-
"isarray": false,
|
|
79
|
-
"core-util-is": false,
|
|
80
|
-
"util-deprecate": false,
|
|
81
|
-
"ethereum-cryptography": false,
|
|
82
|
-
"keccak": false,
|
|
83
|
-
"secp256k1": false,
|
|
84
|
-
"scrypt-js": false,
|
|
85
|
-
"bech32": false,
|
|
86
|
-
"ws": false,
|
|
87
|
-
"xhr2-cookies": false,
|
|
88
|
-
"aes-js": false,
|
|
89
|
-
"@ethersproject/sha2": false,
|
|
90
|
-
"@ethersproject/pbkdf2": false,
|
|
91
|
-
"@ethersproject/scrypt": false
|
|
92
|
-
},
|
|
93
|
-
"peerDependencies": {
|
|
94
|
-
"@react-native-async-storage/async-storage": ">=1.15.0",
|
|
95
|
-
"react": ">=16.8.0",
|
|
96
|
-
"react-native": ">=0.60.0",
|
|
97
|
-
"react-native-get-random-values": ">=1.8.0",
|
|
98
|
-
"react-native-keychain": ">=8.0.0",
|
|
99
|
-
"react-native-passkey": ">=3.0.0",
|
|
100
|
-
"react-native-quick-crypto": ">=0.7.5"
|
|
101
|
-
},
|
|
102
|
-
"peerDependenciesMeta": {
|
|
103
|
-
"@react-native-async-storage/async-storage": {
|
|
104
|
-
"optional": false
|
|
105
|
-
},
|
|
106
|
-
"react-native-get-random-values": {
|
|
107
|
-
"optional": false
|
|
108
|
-
},
|
|
109
|
-
"react-native-keychain": {
|
|
110
|
-
"optional": true
|
|
111
|
-
},
|
|
112
|
-
"react-native-passkey": {
|
|
113
|
-
"optional": true
|
|
114
|
-
},
|
|
115
|
-
"react-native-quick-crypto": {
|
|
116
|
-
"optional": false
|
|
117
|
-
},
|
|
118
|
-
"react-native-url-polyfill": {
|
|
119
|
-
"optional": true
|
|
120
|
-
},
|
|
121
|
-
"react-native-polyfill-globals": {
|
|
122
|
-
"optional": true
|
|
123
|
-
},
|
|
124
|
-
"web-streams-polyfill": {
|
|
125
|
-
"optional": true
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
"overrides": {
|
|
129
|
-
"readable-stream": false,
|
|
130
|
-
"@ethereumjs/common": false,
|
|
131
|
-
"@ethereumjs/util": false,
|
|
132
|
-
"@ethereumjs/rlp": false,
|
|
133
|
-
"@ethereumjs/tx": false,
|
|
134
|
-
"stream": false,
|
|
135
|
-
"util": false,
|
|
136
|
-
"events": false,
|
|
137
|
-
"crypto": false,
|
|
138
|
-
"fs": false,
|
|
139
|
-
"path": false,
|
|
140
|
-
"os": false,
|
|
141
|
-
"net": false,
|
|
142
|
-
"tls": false,
|
|
143
|
-
"child_process": false,
|
|
144
|
-
"hash-base": false,
|
|
145
|
-
"inherits": false,
|
|
146
|
-
"safe-buffer": false,
|
|
147
|
-
"string_decoder": false,
|
|
148
|
-
"process-nextick-args": false,
|
|
149
|
-
"isarray": false,
|
|
150
|
-
"core-util-is": false,
|
|
151
|
-
"util-deprecate": false,
|
|
152
|
-
"ethereum-cryptography": false,
|
|
153
|
-
"keccak": false,
|
|
154
|
-
"secp256k1": false,
|
|
155
|
-
"scrypt-js": false,
|
|
156
|
-
"bech32": false,
|
|
157
|
-
"ws": false,
|
|
158
|
-
"xhr2-cookies": false,
|
|
159
|
-
"aes-js": false,
|
|
160
|
-
"@ethersproject/sha2": false,
|
|
161
|
-
"@ethersproject/pbkdf2": false,
|
|
162
|
-
"@ethersproject/scrypt": false
|
|
163
|
-
},
|
|
164
|
-
"devDependencies": {
|
|
165
|
-
"@explorins/pers-shared": "^2.1.128",
|
|
166
|
-
"@react-native-async-storage/async-storage": "^3.0.2",
|
|
167
|
-
"@rollup/plugin-commonjs": "^25.0.7",
|
|
168
|
-
"@rollup/plugin-json": "^6.1.0",
|
|
169
|
-
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
170
|
-
"@
|
|
171
|
-
"@
|
|
172
|
-
"
|
|
173
|
-
"
|
|
174
|
-
"
|
|
175
|
-
"
|
|
176
|
-
"
|
|
177
|
-
"
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
"
|
|
181
|
-
"
|
|
182
|
-
"
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
"
|
|
186
|
-
"
|
|
187
|
-
"
|
|
188
|
-
}
|
|
189
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@explorins/pers-sdk-react-native",
|
|
3
|
+
"version": "2.2.0",
|
|
4
|
+
"description": "React Native SDK for PERS Platform - Tourism Loyalty System with Blockchain Transaction Signing and WebAuthn Authentication",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc && rollup -c --bundleConfigAsCjs",
|
|
9
|
+
"build:watch": "rollup -c --bundleConfigAsCjs --watch",
|
|
10
|
+
"dev": "tsc --watch",
|
|
11
|
+
"clean": "rimraf dist",
|
|
12
|
+
"docs": "typedoc",
|
|
13
|
+
"docs:dev": "typedoc --watch",
|
|
14
|
+
"docs:json": "typedoc --json docs/api.json",
|
|
15
|
+
"docs:serve": "npx http-server docs -p 8080",
|
|
16
|
+
"prepublishOnly": "npm run clean && npm run build",
|
|
17
|
+
"publish-version": "npm run clean && npm run build && npm version patch && npm publish",
|
|
18
|
+
"publish-with-docs": "npm run clean && npm run build && npm run docs && npm version patch && npm publish",
|
|
19
|
+
"yalc:publish": "npm version patch --no-git-tag-version && npm run build && yalc publish",
|
|
20
|
+
"yalc:push": "npm version patch --no-git-tag-version && npm run build && yalc push"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"pers",
|
|
24
|
+
"sdk",
|
|
25
|
+
"react-native",
|
|
26
|
+
"tourism",
|
|
27
|
+
"loyalty",
|
|
28
|
+
"blockchain",
|
|
29
|
+
"web3",
|
|
30
|
+
"webauthn",
|
|
31
|
+
"transaction-signing",
|
|
32
|
+
"rewards",
|
|
33
|
+
"authentication",
|
|
34
|
+
"biometrics",
|
|
35
|
+
"secure-storage"
|
|
36
|
+
],
|
|
37
|
+
"author": "eXplorins",
|
|
38
|
+
"license": "MIT",
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@explorins/pers-sdk": "^2.1.33",
|
|
41
|
+
"@explorins/pers-signer": "^1.0.34",
|
|
42
|
+
"buffer": "^6.0.3",
|
|
43
|
+
"ethers": "^6.15.0",
|
|
44
|
+
"react-native-url-polyfill": "^2.0.0"
|
|
45
|
+
},
|
|
46
|
+
"browser": {
|
|
47
|
+
"crypto": false,
|
|
48
|
+
"url": false,
|
|
49
|
+
"http": false,
|
|
50
|
+
"https": false,
|
|
51
|
+
"zlib": false,
|
|
52
|
+
"stream": false,
|
|
53
|
+
"assert": false,
|
|
54
|
+
"path": false,
|
|
55
|
+
"fs": false,
|
|
56
|
+
"os": false,
|
|
57
|
+
"readable-stream": false,
|
|
58
|
+
"util": false,
|
|
59
|
+
"events": false,
|
|
60
|
+
"net": false,
|
|
61
|
+
"tls": false,
|
|
62
|
+
"child_process": false,
|
|
63
|
+
"pngjs": false,
|
|
64
|
+
"pngjs/lib/bitmapper": false,
|
|
65
|
+
"pngjs/lib/parser-async": false,
|
|
66
|
+
"pngjs/lib/parser-sync": false,
|
|
67
|
+
"./bitmapper": false,
|
|
68
|
+
"hash-base": false,
|
|
69
|
+
"@ethereumjs/common": false,
|
|
70
|
+
"@ethereumjs/tx": false,
|
|
71
|
+
"@ethereumjs/util": false,
|
|
72
|
+
"stream-browserify": false,
|
|
73
|
+
"crypto-browserify": false,
|
|
74
|
+
"inherits": false,
|
|
75
|
+
"safe-buffer": false,
|
|
76
|
+
"string_decoder": false,
|
|
77
|
+
"process-nextick-args": false,
|
|
78
|
+
"isarray": false,
|
|
79
|
+
"core-util-is": false,
|
|
80
|
+
"util-deprecate": false,
|
|
81
|
+
"ethereum-cryptography": false,
|
|
82
|
+
"keccak": false,
|
|
83
|
+
"secp256k1": false,
|
|
84
|
+
"scrypt-js": false,
|
|
85
|
+
"bech32": false,
|
|
86
|
+
"ws": false,
|
|
87
|
+
"xhr2-cookies": false,
|
|
88
|
+
"aes-js": false,
|
|
89
|
+
"@ethersproject/sha2": false,
|
|
90
|
+
"@ethersproject/pbkdf2": false,
|
|
91
|
+
"@ethersproject/scrypt": false
|
|
92
|
+
},
|
|
93
|
+
"peerDependencies": {
|
|
94
|
+
"@react-native-async-storage/async-storage": ">=1.15.0",
|
|
95
|
+
"react": ">=16.8.0",
|
|
96
|
+
"react-native": ">=0.60.0",
|
|
97
|
+
"react-native-get-random-values": ">=1.8.0",
|
|
98
|
+
"react-native-keychain": ">=8.0.0",
|
|
99
|
+
"react-native-passkey": ">=3.0.0",
|
|
100
|
+
"react-native-quick-crypto": ">=0.7.5"
|
|
101
|
+
},
|
|
102
|
+
"peerDependenciesMeta": {
|
|
103
|
+
"@react-native-async-storage/async-storage": {
|
|
104
|
+
"optional": false
|
|
105
|
+
},
|
|
106
|
+
"react-native-get-random-values": {
|
|
107
|
+
"optional": false
|
|
108
|
+
},
|
|
109
|
+
"react-native-keychain": {
|
|
110
|
+
"optional": true
|
|
111
|
+
},
|
|
112
|
+
"react-native-passkey": {
|
|
113
|
+
"optional": true
|
|
114
|
+
},
|
|
115
|
+
"react-native-quick-crypto": {
|
|
116
|
+
"optional": false
|
|
117
|
+
},
|
|
118
|
+
"react-native-url-polyfill": {
|
|
119
|
+
"optional": true
|
|
120
|
+
},
|
|
121
|
+
"react-native-polyfill-globals": {
|
|
122
|
+
"optional": true
|
|
123
|
+
},
|
|
124
|
+
"web-streams-polyfill": {
|
|
125
|
+
"optional": true
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"overrides": {
|
|
129
|
+
"readable-stream": false,
|
|
130
|
+
"@ethereumjs/common": false,
|
|
131
|
+
"@ethereumjs/util": false,
|
|
132
|
+
"@ethereumjs/rlp": false,
|
|
133
|
+
"@ethereumjs/tx": false,
|
|
134
|
+
"stream": false,
|
|
135
|
+
"util": false,
|
|
136
|
+
"events": false,
|
|
137
|
+
"crypto": false,
|
|
138
|
+
"fs": false,
|
|
139
|
+
"path": false,
|
|
140
|
+
"os": false,
|
|
141
|
+
"net": false,
|
|
142
|
+
"tls": false,
|
|
143
|
+
"child_process": false,
|
|
144
|
+
"hash-base": false,
|
|
145
|
+
"inherits": false,
|
|
146
|
+
"safe-buffer": false,
|
|
147
|
+
"string_decoder": false,
|
|
148
|
+
"process-nextick-args": false,
|
|
149
|
+
"isarray": false,
|
|
150
|
+
"core-util-is": false,
|
|
151
|
+
"util-deprecate": false,
|
|
152
|
+
"ethereum-cryptography": false,
|
|
153
|
+
"keccak": false,
|
|
154
|
+
"secp256k1": false,
|
|
155
|
+
"scrypt-js": false,
|
|
156
|
+
"bech32": false,
|
|
157
|
+
"ws": false,
|
|
158
|
+
"xhr2-cookies": false,
|
|
159
|
+
"aes-js": false,
|
|
160
|
+
"@ethersproject/sha2": false,
|
|
161
|
+
"@ethersproject/pbkdf2": false,
|
|
162
|
+
"@ethersproject/scrypt": false
|
|
163
|
+
},
|
|
164
|
+
"devDependencies": {
|
|
165
|
+
"@explorins/pers-shared": "^2.1.128",
|
|
166
|
+
"@react-native-async-storage/async-storage": "^3.0.2",
|
|
167
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
168
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
169
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
170
|
+
"@testing-library/dom": "^10.4.1",
|
|
171
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
172
|
+
"@testing-library/react": "^16.3.2",
|
|
173
|
+
"@types/jest": "^30.0.0",
|
|
174
|
+
"@types/react": "^19.1.1",
|
|
175
|
+
"@types/react-native": "^0.72.8",
|
|
176
|
+
"jest": "^30.3.0",
|
|
177
|
+
"jest-environment-jsdom": "^30.3.0",
|
|
178
|
+
"react": "^19.2.5",
|
|
179
|
+
"react-dom": "^19.2.5",
|
|
180
|
+
"react-native": "^0.85.3",
|
|
181
|
+
"rimraf": "^5.0.0",
|
|
182
|
+
"rollup": "^4.0.0",
|
|
183
|
+
"rollup-plugin-typescript2": "^0.36.0",
|
|
184
|
+
"ts-jest": "^29.4.9",
|
|
185
|
+
"typedoc": "^0.25.13",
|
|
186
|
+
"typedoc-plugin-markdown": "^3.17.1",
|
|
187
|
+
"typescript": "^5.2.0"
|
|
188
|
+
},
|
|
189
|
+
"files": [
|
|
190
|
+
"dist/**/*",
|
|
191
|
+
"src/**/*",
|
|
192
|
+
"README.md"
|
|
193
|
+
],
|
|
194
|
+
"repository": {
|
|
195
|
+
"type": "git",
|
|
196
|
+
"url": "git+https://github.com/eXplorins/pers-sdk.git",
|
|
197
|
+
"directory": "packages/pers-sdk-react-native"
|
|
198
|
+
}
|
|
199
|
+
}
|