# \[Archive\] Connect to multiple chains simultaneously

**URL:** <https://builder.metamask.io/t/archive-connect-to-multiple-chains-simultaneously/2371>\
**Category:** Embedded Wallets (Web3Auth)\
**Created:** [August 22, 2022, 10:29am UTC](https://builder.metamask.io/t/archive-connect-to-multiple-chains-simultaneously/2371 "2022-08-22T10:29:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![githubdiscussions](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@githubdiscussions](https://builder.metamask.io/u/githubdiscussions)\
**Post date:** [August 22, 2022, 10:29am UTC](https://builder.metamask.io/t/archive-connect-to-multiple-chains-simultaneously/2371/1 "2022-08-22T10:29:56Z")

</div>

> **🏛 Archived Content from Web3Auth Community**
> 
> This topic was originally posted by **githubdiscussions** on 8/22/2022.  
> This content has been migrated from our previous community forum to preserve valuable discussions.

* * *

I'm using web3auth JS SDK. I have found the example of how to implement switching to different chains. But I need to have access to multiple chains at the same time (e.g. to list user assets from multiple chains). Is there a way to achieve this?

  
   
 Originally posted by: [yurayavorski](https://github.com/yurayavorski)  
   
 Check the discussion at: [https://github.com/orgs/Web3Auth/discussions/454](https://github.com/orgs/Web3Auth/discussions/454)

---

<div class="post-metadata">

**Author:** ![githubdiscussions](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@githubdiscussions](https://builder.metamask.io/u/githubdiscussions)\
**Post date:** [August 23, 2022, 3:34am UTC](https://builder.metamask.io/t/archive-connect-to-multiple-chains-simultaneously/2371/2 "2022-08-23T03:34:48Z")

</div>

You can export the key from the web3auth provider and instantiate your own provider for the different chains needed

  
   
 Originally posted by: [YZhenY](https://github.com/YZhenY)

---

<div class="post-metadata">

**Author:** ![githubdiscussions](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@githubdiscussions](https://builder.metamask.io/u/githubdiscussions)\
**Post date:** [September 15, 2022, 11:39pm UTC](https://builder.metamask.io/t/archive-connect-to-multiple-chains-simultaneously/2371/3 "2022-09-15T23:39:53Z")

</div>

Hey [@yurayavorski](https://github.com/yurayavorski)

We don't have an example for this case, but I can explain to you how the code will look like. You can use this private key provider: [https://web3auth.io/docs/sdk/web/providers/other](https://web3auth.io/docs/sdk/web/providers/other) to get the private key of the user. Now suppose I want to use it for StarkEx and Tezos. Now I will make two different functions for getting StarkEx keys and Tezos keys like these:

- StarkEx

`getStarkAccount = async (): Promise<any> => {
try {
const privateKey = await this.provider.request({ method: “private_key” });
const keyPair = starkwareCrypto.ec.keyFromPrivate(privateKey, “hex”);
const account = starkwareCrypto.ec.keyFromPublic(keyPair.getPublic(true, “hex”), “hex”);
return account;
} catch (error) {
return error;
}
};
`

`getStarkKey = async (): Promise<string | undefined> => {
try {
const account = await this.getStarkAccount();
const publicKeyX = account.pub.getX().toString(“hex”);
return publicKeyX;
} catch (error) {
return error as string;
}
};
`

- Tezos

```
getTezosKeyPair = async (): Promise<any> => {
    try {
      const privateKey = (await this.provider.request({ method: "private_key" })) as string;
      const keyPair = tezosCrypto.utils.seedToKeyPair(hex2buf(privateKey));
      return keyPair;
    } catch (error) {
      return error;
    }
  };

```

Afterwards, you can use these keys for each blockchain to make calls accordingly. You can check our [StarkEx](https://web3auth.io/docs/connect-blockchain/starkex) and [Tezos](https://web3auth.io/docs/connect-blockchain/tezos) blockchain pages to know how to make calls.

  
   
 Originally posted by: [yashovardhan](https://github.com/yashovardhan)

---

<div class="post-metadata">

**Author:** ![githubdiscussions](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@githubdiscussions](https://builder.metamask.io/u/githubdiscussions)\
**Post date:** [October 12, 2022, 1:40am UTC](https://builder.metamask.io/t/archive-connect-to-multiple-chains-simultaneously/2371/4 "2022-10-12T01:40:05Z")

</div>

Hey [@yurayavorski](https://github.com/yurayavorski)

Please see [https://github.com/Web3Auth/examples/tree/main/web-modal-sdk/multi-chain](https://github.com/Web3Auth/examples/tree/main/web-modal-sdk/multi-chain)

  
   
 Originally posted by: [shahbaz17](https://github.com/shahbaz17)
