Skip to content

Commit 766e163

Browse files
Merge pull request #96 from Web3Auth/feat/config-api
Feat/config api
2 parents 3fbf070 + f54b74d commit 766e163

File tree

16 files changed

+4281
-5219
lines changed

16 files changed

+4281
-5219
lines changed
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
module.exports = {
2-
arrowParens: 'avoid',
3-
bracketSameLine: true,
4-
bracketSpacing: false,
5-
singleQuote: true,
6-
trailingComma: 'all',
2+
singleQuote: false,
3+
semi: true,
4+
trailingComma: 'es5',
5+
printWidth: 150,
76
};

demo/rn-bare-example/App.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ import {
99
TextInput,
1010
View,
1111
} from 'react-native';
12-
import {useEffect, useState} from 'react';
1312
import Web3Auth, {
1413
IWeb3Auth,
1514
LOGIN_PROVIDER,
1615
OpenloginUserInfo,
1716
} from '@web3auth/react-native-sdk';
17+
import { useEffect, useState } from 'react';
1818

19-
import {ChainNamespace} from '@web3auth/react-native-sdk';
19+
import { ChainNamespace } from '@web3auth/react-native-sdk';
2020
import EncryptedStorage from 'react-native-encrypted-storage';
2121
import RPC from './ethersRPC'; // for using ethers.js
2222

2323
const scheme = 'web3authrnbareexample'; // Or your desired app redirection scheme
2424
const resolvedRedirectUrl = `${scheme}://openlogin`;
2525
const clientId =
26-
'BHr_dKcxC0ecKn_2dZQmQeNdjPgWykMkcodEHkVvPMo71qzOV6SgtoN8KCvFdLN7bf34JOm89vWQMLFmSfIo84A';
26+
'BFuUqebV5I8Pz5F7a5A2ihW7YVmbv_OHXnHYDv6OltAD5NGr6e-ViNvde3U4BHdn6HvwfkgobhVu4VwC-OSJkik';
2727

2828
const chainConfig = {
2929
chainNamespace: ChainNamespace.EIP155,
@@ -44,7 +44,7 @@ export default function App() {
4444
const [key, setKey] = useState<string | undefined>('');
4545
const [console, setConsole] = useState<string>('');
4646
const [web3auth, setWeb3Auth] = useState<IWeb3Auth | null>(null);
47-
const [email, setEmail] = useState('yash@tor.us');
47+
const [email, setEmail] = useState('hello@tor.us');
4848

4949
const login = async () => {
5050
try {
@@ -209,7 +209,7 @@ export default function App() {
209209
const init = async () => {
210210
const auth = new Web3Auth(WebBrowser, EncryptedStorage, {
211211
clientId,
212-
network: 'testnet', // or other networks
212+
network: 'sapphire_devnet', // or other networks
213213
useCoreKitKey: false,
214214
loginConfig: {},
215215
enableLogging: true,
@@ -303,7 +303,7 @@ export default function App() {
303303
onChangeText={text => setEmail(text)}
304304
value={email}
305305
// eslint-disable-next-line react-native/no-inline-styles
306-
style={{padding: 10}}
306+
style={{ padding: 10 }}
307307
/>
308308
<Button title="Login with Web3Auth" onPress={login} />
309309
</View>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
presets: ['module:@react-native/babel-preset'],
2+
presets: ["module:@react-native/babel-preset"],
33
};

demo/rn-bare-example/globals.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

demo/rn-bare-example/globals.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { install } from "react-native-quick-crypto";
2+
3+
install();
4+
5+
// Needed so that 'stream-http' chooses the right default protocol.
6+
// @ts-ignore
7+
global.location = {
8+
protocol: "file:",
9+
};
10+
// @ts-ignore
11+
global.process.version = "v16.0.0";
12+
if (!global.process.version) {
13+
global.process = require("process");
14+
console.log({ process: global.process });
15+
}
16+
// @ts-ignore
17+
process.browser = true;
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { AppRegistry } from "react-native";
2-
import "react-native-get-random-values";
32
import "./globals";
43
import App from "./App";
54
import { name as appName } from "./app.json";
6-
AppRegistry.registerComponent(appName, () => App);
5+
AppRegistry.registerComponent(appName, () => App);

0 commit comments

Comments
 (0)