# Extend the SDK

Besides, users can also customize their own wallet provider in an easier way. The `BTCProvider` class provides default implementations for most Bitcoin interfaces. What users need to do is compare the interfaces of the target wallet with the default implementations of `BTCProvider`. The `CosmosProvider` class provides default implementations for most Cosmos interfaces. What users need to do is compare the interfaces of the target wallet with the default implementations of `CosmosProvider`.&#x20;

```javascript
import {
  BTCProvider,
  CosmosProvider,
  TomoChain
} from '@tomo-inc/tomo-wallet-provider'

class XYZWallet extends BTCProvider {
  constructor(chains: TomoChain[]) {
    // @ts-ignore
    const bitcoinNetworkProvider = window?.xyzWallet

    if (!bitcoinNetworkProvider) {
      throw new Error('XYZ Wallet not found')
    }
    super(chains, bitcoinNetworkProvider)
  }

  connectWallet = async (): Promise<this> => {
    const accounts = await this.bitcoinNetworkProvider?.requestAccounts()

    const address = accounts[0]
    const publicKeyHex = await this.getPublicKeyHex()

    if (!address || !publicKeyHex) {
      throw new Error('Could not connect to XYZ Wallet')
    }
    return this
  }
}

class ABCWallet extends CosmosProvider {
  constructor(chains: TomoChain[]) {
    // @ts-ignore
    const cosmosProvider = window?.abcCosmos

    if (!cosmosProvider) {
      throw new Error('ABC Wallet not found')
    }
    super(chains, cosmosProvider)
  }
}
```

Then you can use it in the wallet context provider

```javascript
<TomoContextProvider
  additionalWallets={[
    {
      id: 'xyz',
      name: 'XYZ BTC Wallet',
      chainType: 'bitcoin',
      connectProvider: XYZWallet, // XYZWallet should extends BTCProvider
      type: 'extension',
      img: 'https://your wallet logo.svg'
    }, {
      id: 'abc',
      name: 'ABC Cosmos Wallet',
      chainType: 'cosmos',
      connectProvider: ABCWallet, // ABCWallet should extends CosmosProvider
      type: 'extension',
      img: 'https://your wallet logo.svg'
    },
  ]}
>
</TomoContextProvider>
```


---

# 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.tomo.inc/tomo-sdk/tomo-enterprise-sdk/for-babylon/integrate-extension-wallet/extend-the-sdk.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.
