# @xchainjs/xchain-mayachain

> Custom Mayachain client and utilities used by XChainJS clients

Latest version **4.2.2** (published 2026-10-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install @xchainjs/xchain-mayachain
pnpm add @xchainjs/xchain-mayachain
yarn add @xchainjs/xchain-mayachain
bun add @xchainjs/xchain-mayachain
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.2.2 |
| Published | 2026-10-06 |
| First published | 2023-01-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 17 |
| Unpacked size | 380.4 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 133 |
| Author | MAYAChain |
| Maintainers | xchainjsadmin, thorchain_org, _stu, veado, thatstrangeguy, junkai121, sarawut11, thorswap, hodrthemediocre, polaris_9r, thorianite |
| Keywords | MAYAChain, XChain |

## Links

- npm: https://www.npmjs.com/package/@xchainjs/xchain-mayachain
- Repository: https://github.com/xchainjs/xchainjs-lib
- Issues: https://github.com/xchainjs/xchainjs-lib/issues
- npm.io page: https://npm.io/package/@xchainjs/xchain-mayachain

## Dependencies (17)

- [axios](https://npm.io/package/axios.md) 1.20.0
- [protobufjs](https://npm.io/package/protobufjs.md) 7.6.4
- [@scure/base](https://npm.io/package/@scure/base.md) ^1.2.6
- [@scure/bip32](https://npm.io/package/@scure/bip32.md) ^1.7.0
- [bignumber.js](https://npm.io/package/bignumber.js.md) ^11.0.0
- [cosmjs-types](https://npm.io/package/cosmjs-types.md) 0.10.1
- [@cosmjs/amino](https://npm.io/package/@cosmjs/amino.md) 0.37.0
- [@cosmjs/crypto](https://npm.io/package/@cosmjs/crypto.md) 0.37.0
- [@cosmjs/encoding](https://npm.io/package/@cosmjs/encoding.md) 0.37.0
- [@cosmjs/stargate](https://npm.io/package/@cosmjs/stargate.md) 0.37.0
- [@cosmjs/proto-signing](https://npm.io/package/@cosmjs/proto-signing.md) 0.37.0
- [@xchainjs/xchain-util](https://npm.io/package/@xchainjs/xchain-util.md) 2.0.7
- [@xchainjs/xchain-client](https://npm.io/package/@xchainjs/xchain-client.md) 2.0.18
- [@xchainjs/xchain-crypto](https://npm.io/package/@xchainjs/xchain-crypto.md) 1.0.8
- [@xchainjs/ledger-thorchain](https://npm.io/package/@xchainjs/ledger-thorchain.md) ^0.3.1
- [@xchainjs/xchain-cosmos-sdk](https://npm.io/package/@xchainjs/xchain-cosmos-sdk.md) 2.1.2
- [@bitcoin-js/tiny-secp256k1-asmjs](https://npm.io/package/@bitcoin-js/tiny-secp256k1-asmjs.md) ^2.2.3

## Recent versions

- 4.2.2 (latest) — 2026-10-06
- 4.2.1 — 2026-08-25
- 4.2.0 — 2026-08-06
- 4.1.7 — 2026-07-20
- 4.1.6 — 2026-06-25
- 4.1.5 — 2026-06-03
- 4.1.4 — 2026-05-14
- 4.1.3 — 2026-04-15
- 4.1.2 — 2026-03-12
- 4.1.1 — 2026-02-10
- 4.1.0 — 2025-10-13
- 4.0.1 — 2025-09-19
- 4.0.0 — 2025-08-05
- 3.0.8 — 2025-07-28
- 3.0.7 — 2025-07-23
- … 49 more at https://npm.io/package/@xchainjs/xchain-mayachain/versions

## README

# `@xchainjs/xchain-mayachain`

Mayachain Module for XChainJS Clients

## Installation

```
yarn add @xchainjs/xchain-mayachain
```

Following peer dependencies have to be installed into your project. These are not included in `@xchainjs/xchain-mayachain`.

```
yarn add @xchainjs/xchain-client @xchainjs/xchain-crypto @xchainjs/xchain-util axios
```

## Documentation

### [`xchain mayachain`](http://docs.xchainjs.org/xchain-client/xchain-mayachain/)

[`How xchain-mayachain works`](http://docs.xchainjs.org/xchain-client/xchain-mayachain/how-it-works.html)\
[`How to use xchain-mayachain`](http://docs.xchainjs.org/xchain-client/xchain-mayachain/how-to-use.html)

For more examples check out tests in `./__tests__/client.test.ts`

## Service Providers

This package uses the following service providers:

| Function                    | Service                 | Notes                                                                                 |
| --------------------------- | ----------------------- | ------------------------------------------------------------------------------------- |
| Balances                    | Cosmos RPC              | https://v1.cosmos.network/rpc/v0.45.1 (`GET /cosmos/bank/v1beta1/balances/{address}`) |
| Transaction history         | Tendermint RPC          | https://docs.tendermint.com/v0.34/rpc/#/Info/tx_search                                |
| Transaction details by hash | Cosmos RPC              | https://v1.cosmos.network/rpc/v0.45.1 (`GET /cosmos/tx/v1beta1/txs/{hash}`)           |
| Transaction broadcast       | Cosmos RPC              | https://v1.cosmos.network/rpc/v0.45.1 (`POST /cosmos/tx/v1beta1/txs`)                 |
| Explorer                    | Explorer Mayachain.info | https://explorer.mayachain.info                                                       |

Rate limits: No

## Extras

## Creating protobuffer typescript bindings

In order for this library to de/serialize proto3 structures, you can use the following to create bindings

1. `git clone https://gitlab.com/mayachain/thornode`
2. run the following (adjust the paths acordingly) to generate a typecript file for MsgDeposit
   ```bash
   yarn run pbjs -w commonjs  -t static-module  <path to repo>/thornode/proto/thorchain/v1/x/thorchain/types/msg_deposit.proto <path to repo>/thornode/proto/thorchain/v1/common/common.proto <path to repo>/thornode/proto/thorchain/v1/x/thorchain/types/msg_send.proto <path to repo>/thornode/third_party/proto/cosmos/base/v1beta1/coin.proto -o src/types/proto/MsgCompiled.js
   ```
3. run the following to generate the .d.ts file
   ```bash
   yarn run pbts src/types/proto/MsgCompiled.js -o src/types/proto/MsgCompiled.d.ts
   ```

Alternatively, you can run the convenience script: `genMsgs.sh`, which will overwrite the proto/js files in types/proto. This should only be done and checked in if changes were made to the upstream Msg in the MAYANode repo.

---
_Source: https://npm.io/package/@xchainjs/xchain-mayachain · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
