Skip to content

Commit

Permalink
Merge pull request #102 from Web3Auth/alpha
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
ieow authored Mar 18, 2024
2 parents 5013d80 + 67256b4 commit 020e147
Show file tree
Hide file tree
Showing 14 changed files with 1,604 additions and 1,025 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

# todo: for local testing still tkey-mpc merge
*.tgz
24 changes: 8 additions & 16 deletions demo/redirect-flow-example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion demo/redirect-flow-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.2",
"@types/jsonwebtoken": "^9.0.6",
"@types/node": "^16.18.48",
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7",
Expand Down
19 changes: 18 additions & 1 deletion demo/redirect-flow-example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const uiConsole = (...args: any[]): void => {
console.log(...args);
};

const selectedNetwork = WEB3AUTH_NETWORK.MAINNET;
const selectedNetwork = WEB3AUTH_NETWORK.DEVNET;
// performance options
// const options = {
// manualSync: true,
Expand Down Expand Up @@ -302,6 +302,13 @@ function App() {
return chainId;
};

const setTSSWalletIndex = async (index=0) => {
await coreKitInstance.setTssWalletIndex(index);
// log new account details
await getAccounts();
}


const getAccounts = async () => {
if (!web3) {
uiConsole("web3 not initialized yet");
Expand Down Expand Up @@ -622,6 +629,16 @@ function App() {
Get Accounts
</button>

<button onClick={() => setTSSWalletIndex(1)} className="card">
Switch to wallet index: 1
</button>
<button onClick={() => setTSSWalletIndex(2)} className="card">
Switch to wallet index: 2
</button>
<button onClick={() => setTSSWalletIndex(0)} className="card">
Switch to wallet index: 0/default
</button>

<button onClick={getBalance} className="card">
Get Balance
</button>
Expand Down
Loading

0 comments on commit 020e147

Please sign in to comment.