> For the complete documentation index, see [llms.txt](https://docs.mayaprotocol.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mayaprotocol.com/mayachain-dev-docs/examples/typescript-xchainjs-wip/client-packages.md).

# Client Packages

Using xchain client packages

### F**ull Multichain Wallet Example**

A wallet class has been created that instantiates every chain client and leverages the interface which greatly simplifies working with wallets and THORChain. See the below code example.

{% embed url="<https://replit.com/@thorchain/xchain-wallet#index.ts>" %}

### Client Packages breakdown

Client packages have been created for each blockchain that connects to THORChain. All clients implement xchain-crypto which acts like a super class and gives each client a common interface.

Common functions with code examples are:

### **Config and Set Up of a Wallet**

{% embed url="<https://replit.com/@thorchain/TestBed#index.ts>" %}
Some chains require address history to query balances and Txs
{% endembed %}

### **Querying**

All clients implement these functions. While most can use the same code, some have slight client differences.

* Get Explorer URL - for the specific blockchain
* Get Balance - returns the balance of an address
* Get Transactions - returns a simplified array of recent transactions for an address.
* Get Transaction Data - returns transaction information from the transaction ID/hash.

See below for a Bitcoin example. Also see [Ethereum](https://replit.com/@thorchain/xchain-ethereum#index.ts), [Binance](https://replit.com/@thorchain/xchain-binance#index.ts), [THORChain](https://replit.com/@thorchain/xchain-thorchain), [Cosmos](https://replit.com/@thorchain/xchain-cosmos#index.ts), and [Avalance ](https://replit.com/@thorchain/xchain-avax)examples.

{% embed url="<https://replit.com/@thorchain/xchain-bitcoin#index.ts>" %}
Some chains require address history to query balances and Txs
{% endembed %}

### Transactions

* Get Fees - get the transaction fee for the chain, separate from THORChain fees
* Transfer - transfer funds from one wallet to another.
* Purge - When a wallet is "locked" the private key should be purged in each client by setting it back to null.

See <http://docs.xchainjs.org/xchain-client/overview.html> for more information.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mayaprotocol.com/mayachain-dev-docs/examples/typescript-xchainjs-wip/client-packages.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
