Crosschain Transaction
You can perform a crosschain transaction via the DEMOS network with the help of the DEMOS sdk.
Here is how you can send tokens on Sepolia testnet via DEMOS using the sdk:
0. Imports
The following imports will be needed to create the transaction.
1. Creating the EVM payload
You can create the payload for Sepolia via the crosschain module of the sdk as follows:
The evm_tx
will be a signed transaction to move 0.000000001 Sepolia ETH from the connected wallet to0xda3ea78Af43E6B1c63A08cD0058973F14e5556b0
.
2. Converting the payload into an XMScript
The xmscript
will be embedded into a DEMOS transaction and sent to the DEMOS network in the upcoming sections.
3. Creating a DEMOS identity
A DEMOS identity is needed to sign the outgoing DEMOS transaction.
4. Converting the XMScript to a DEMOS transaction
You can convert the xmscript
into a DEMOS transaction by calling prepareXMPayload
and passing the xmscript
and identity.keypair
.
The tx
will be a signed DEMOS transaction containing the Sepolia tx.
5. Broadcasting to a DEMOS node
You can now broadcast the transaction using the demos
object as shown.
Last updated