Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: soft nonce wallets #92

Closed
wants to merge 12 commits into from
3 changes: 2 additions & 1 deletion .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*

*.tgz
# todo: for local testing still tkey-mpc merge
# *.tgz
25 changes: 18 additions & 7 deletions demo/redirect-flow-example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,7 @@ const uiConsole = (...args: any[]): void => {
console.log(...args);
};

const selectedNetwork = WEB3AUTH_NETWORK.MAINNET;
// performance options
// const options = {
// manualSync: true,
// prefetchTssPub: 2,
// setupProvdiverOnInit: false,
// }
const selectedNetwork = WEB3AUTH_NETWORK.DEVNET;

const coreKitInstance = new Web3AuthMPCCoreKit(
{
Expand Down Expand Up @@ -302,6 +296,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 +623,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
Loading