Skip to content

Commit 38ac5bc

Browse files
Merge pull request #78 from Web3Auth/feat/ts-5
Upgrade
2 parents 5bfc340 + 1ebc0ce commit 38ac5bc

File tree

20 files changed

+8272
-9200
lines changed

20 files changed

+8272
-9200
lines changed

.eslintrc.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
require("@rushstack/eslint-patch/modern-module-resolution");
2+
3+
module.exports = {
4+
root: true,
5+
extends: ["@toruslabs/eslint-config-typescript"],
6+
parser: "@typescript-eslint/parser",
7+
ignorePatterns: ["*.config.js", "demo/*", ".eslintrc.js"],
8+
parserOptions: {
9+
sourceType: "module",
10+
ecmaVersion: 2022,
11+
project: "./tsconfig.json",
12+
},
13+
rules: {
14+
camelcase: 0,
15+
},
16+
};

.eslintrc.json

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

.prettierrc.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# .prettierrc or .prettierrc.yaml
22
printWidth: 150
33
singleQuote: false
4-
semi: true
4+
semi: true
5+
trailingComma: es5

demo/rn-bare-example/App.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import * as WebBrowser from '@toruslabs/react-native-web-browser';
1212
import EncryptedStorage from 'react-native-encrypted-storage';
1313
import Web3Auth, {
1414
LOGIN_PROVIDER,
15-
OPENLOGIN_NETWORK,
1615
IWeb3Auth,
1716
OpenloginUserInfo,
1817
} from '@web3auth/react-native-sdk';
@@ -54,8 +53,9 @@ export default function App() {
5453
setKey(web3auth.privKey);
5554
uiConsole('Logged In');
5655
}
57-
} catch (e: any) {
58-
setConsole(e.message);
56+
} catch (e: unknown) {
57+
console.log(e, (e as Error).stack);
58+
setConsole((e as Error).message);
5959
}
6060
};
6161

@@ -79,17 +79,18 @@ export default function App() {
7979
const init = async () => {
8080
const auth = new Web3Auth(WebBrowser, EncryptedStorage, {
8181
clientId,
82-
network: OPENLOGIN_NETWORK.TESTNET, // or other networks
82+
network: 'testnet', // or other networks
8383
useCoreKitKey: false,
8484
loginConfig: {},
85+
enableLogging: true,
86+
buildEnv: 'development',
8587
});
8688
setWeb3Auth(auth);
8789
await auth.init();
8890
if (auth?.privKey) {
8991
uiConsole('Re logged in');
9092
setUserInfo(auth.userInfo());
9193
setKey(auth.privKey);
92-
window.console.log(auth.privKey);
9394
}
9495
};
9596
init();

0 commit comments

Comments
 (0)