# Integrate Nova Wallet

## Introduction

Nova Wallet is an open-source web3 wallet solution for both iOS and Android, focusing on the Polkadot ecosystem.

Our GitHub repo can be found here: <https://github.com/novasamatech>

## Polkadot JS Integration

### Integration Steps

1. Make sure that your DApp interface is adopted for mobile platforms;
2. The simplest way to integrate Nova is by using [@polkadot/extension-dapp](https://www.npmjs.com/package/@polkadot/extension-dapp) package since Nova Wallet implements the same protocol as the polkadot-js extension
3. Due to the specifics of mobile browsers, `window.injectedWeb3` might not be injected right at the start of page execution. The best practice is to either retry a few seconds later if `window.injectedWeb3` was not found or to allow user to trigger connection flow manually (e.g. by clicking on `Nova Wallet` icon)
4. Use `window.walletExtension.isNovaWallet` flag to determine that the Nova Wallet connection option is supported and allow the user to initiate it manually by choosing the option in the DApp interface. Feel free to use our [brand kit](https://drive.google.com/drive/u/3/folders/1EHrV744D43yZkVTaAChCpnt3jaZPn_DX) to display the Nova Wallet icon for connection option in the DApp interface.

### Check Integration

1. Deploy your DApp with Nova Wallet integration on your testing environment and copy the url;
2. Download latest Nova Wallet application from our [website](https://novawallet.io/);
3. Launch the app and create a watch only wallet (select the default "Nova" account) or by providing your wallet's Substrate and Ethereum addresses;
4. Open your DApp by pasting DApp url into the search field on DApps (Android)/Browser (iOS) tab;
5. Initiate connection in the DApp interface using Nova Wallet option and make sure that the wallet authorization screen appears in the Nova Wallet;
6. Accept connection in Nova Wallet and make sure that DApp interface switches to the connected state (address from the Nova Wallet displays correctly);
7. Initiate transaction from DApp interface and make sure that the transaction confirmation screen appears in Nova Wallet;
8. If you encountered any issues and want to debug website, you can do the following:
   * Contact us either [in telegram](https://t.me/novawallet) or by [by email](mailto:support@novawallet.io) to obtain debuggable build
   * Open web page you want to debug in debuggable version of Nova
   * If you are using Android, open Google Chrome on PC, go to `chrome://inspect/#devices` and connect to the debugger
   * You will be able to use standard set of devtools, such as console, DOM tree inspector and others

## Metamask Integration

### Integration Steps

1. Make sure that your DApp interface is adopted for mobile platforms;
2. Implement the [Metamask protocol](https://docs.metamask.io/guide/rpc-api.html) on DApp side to communicate with Nova wallet mobile application [web bridge](https://github.com/nova-wallet/nova-wallet-metamask-js/blob/main/index.js). Follow best practice for [Metamask on mobile](https://docs.metamask.io/guide/mobile-best-practices.html#the-provider-window-ethereum);
3. Make sure DApp properly switches chain using `wallet_addEthereumChain` and `wallet_switchEthereumChain` [protocol functions](https://docs.metamask.io/guide/rpc-api.html#table-of-contents) if Nova Wallet returns unsupported chain id;
4. Use `window.ethereum.isNovaWallet` flag to determine that Nova Wallet connection option is supported and allow user to initiate it manually by choosing the option in the DApp interface. Feel free to use our [brand kit](https://drive.google.com/drive/folders/10QbuBxVSASpUVYSGcW3e2gY4EzcR6p46) to display the Nova Wallet icon for connection option in the DApp interface.

### Check Integration

1. Deploy your DApp with Nova Wallet integration on your testing environment and copy the url;
2. Download latest Nova Wallet application from our [website](https://novawallet.io/);
3. Launch the app and create watch only wallet (select the default "Nova" account) or by providing your wallet's Substrate and Ethereum addresses;
4. Open DApp by pasting DApp url into search field on DApps (Android)/Browser (iOS) tab;
5. Initiate connection in the DApp interface using Nova Wallet option and make sure that wallet authorisation screen appears in the Nova Wallet;
6. Accept connection in the Nova Wallet and make sure that DApp interface switches to the connected state (address from the Nova Wallet displays correctly);
7. Initiate transaction from DApp interface and make sure that transaction confirmation screen appears in the Nova Wallet;
8. If you encountered any problems contact us either [in telegram](https://t.me/novawallet) or by [by email](mailto:support@novawallet.io) to obtain debuggable build


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.novawallet.io/nova-wallet-wiki/misc/developer-documentation/integrate-nova-wallet.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
