Sending Transactions

This page goes over how to build an inbound MAYAChain transaction for each chain type.

Confirm you have:

You are ready to make the transaction and swap via MAYAChain.

UTXO Chains

Memo limited to 80 bytes on BTC. Use abbreviated options and MAYANames where possible.

EVM Chains

ETH is 0x0000000000000000000000000000000000000000

COSMOS Chains

MAYAChain

To initiate a $CACAO-> $ASSET swap a MsgDeposit must be broadcasted to the MAYAChain blockchain. The MsgDeposit does not have a destination address, and has the following properties. The full definition can be found here.

If you are using Javascript, CosmJS is the recommended package to build and broadcast custom message types. Here is a walkthrough.

Code Examples (Javascript)

  1. Generate codec files. To build/broadcast native transactions in Javascript/Typescript, the protobuf files need to be generated into js types. The below script uses pbjs and pbts to generate the types using the relevant files from the MAYANode repo. Alternatively, the .js and .d.ts files can be downloaded directly from the XChainJS repo.

  1. Using @cosmjs build/broadcast the TX.

Last updated

Was this helpful?