Skip to content
Merged

Wc #80

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,6 @@ function main() {
const open = spawn(async () => {
webSocket?.removeEventListener("open", open);

await glue.activateChain({
chainId: "0x" + chainId.toString(16),
rpcUrl: rpcUrl.href,
});

let requestAccountsPromise: unknown = null;
const unsubscribe = glue.on("requestaccounts", (event) => {
unsubscribe();
Expand All @@ -304,6 +299,15 @@ function main() {
});
});

if (baseProvider instanceof EthereumProvider) {
await baseProvider.connect();
}

await glue.activateChain({
chainId: "0x" + chainId.toString(16),
rpcUrl: rpcUrl.href,
});

await unboundWallet.wallet.requestAddresses();
unsubscribe();
if (requestAccountsPromise instanceof Promise) {
Expand Down Expand Up @@ -385,7 +389,6 @@ function main() {

rpcMap: rpcMap,
});
spawn(async () => await provider.connect())();

await run(provider);
}),
Expand Down
Loading