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
MAYAChain does NOT currently support BTC Taproot. User funds will be lost if sent to or from a taproot address!
Inbound transactions should not be delayed for any reason else there is risk funds will be sent to an unreachable address. Use standard transactions, check the Inbound_Address
before sending and use the recommended gas rate
to ensure transactions are confirmed in the next block to the latest Inbound_Address
.
Memo limited to 80 bytes on BTC. Use abbreviated options and MAYANames where possible.
Do not use HD wallets that forward the change to a new address, because MAYAChain IDs the user as the address in VIN0. The user must keep their VIN0 address funded for refunds.
Override randomised VOUT ordering; MAYAChain requires specific output ordering.
EVM Chains
ETH is 0x0000000000000000000000000000000000000000
ETH is sent and received as an internal transaction. Your wallet may not be set to read internal balances and transactions
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.
MsgDeposit
must also be broadcasted when swapping from Synths.
Code Examples (Javascript)
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
andpbts
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.
Using @cosmjs build/broadcast the TX.
Last updated