Skip to content

Commit

Permalink
-wip- reference adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaurello committed Jan 13, 2025
1 parent 28b63ae commit 7c9d0b4
Show file tree
Hide file tree
Showing 2 changed files with 568 additions and 6 deletions.
25 changes: 21 additions & 4 deletions mkdocs/docs/reference/mrl.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@ This SDK aims to simplify this process, abstracting away the complexities of int

To use it, chains are configured following an iterface which contains all the necessary information to perform the transfers.

In this section we'll provide a detailed reference of the concepts and more complex types, interfaces and methods.
This sdk uses the [XCM-SDK types and concepts as base](../reference/xcm.md). In this section we'll provide a detailed reference for the most important concepts, types, interfaces and methods related to the MRL SDK.

---

## Transfer types
<!-- TODO fix redaccion -->
To understand how to use the MRL SDK, we can identify three different types of transfers, which ultimately don't affect the way the SDK is used, but depending on the type of transfer, the logic behind each one is going to be different.

Always refer to the [MRL Documentation](https://docs.moonbeam.network/builders/interoperability/mrl/){target=\_blank} for a full explanation of the process, but here is a brief overview of what happens in each type of transfers, which will help you understand how the SDK works.

---

### From EVM chains to parachains. {: #from-evm-chains-to-parachains }
<!-- TODO mjm references -->
Here the source chain is an [EVM chain]() and the destination chain either a [Parachain]() or an [EVMParachain]().
Expand All @@ -27,6 +31,8 @@ Here the source chain is an [EVM chain]() and the destination chain either a [Pa
2. Next, to complete the transfer in Moonbeam, it must be executed, either manually or automatically by a relayer from the GMP provider. This execution consists of calling the [GMP precompile](https://docs.moonbeam.network/builders/ethereum/precompiles/interoperability/gmp/){target=\_blank}, which triggers the next step.
3. An XCM message is sent from Moonbeam to the destination chain, containing the assets that were sent from the source chain.

---

### From parachains to EVM chains. {: #from-parachains-to-evm-chains }

Here the source chain is a [Parachain]() or an [EVMParachain]() and the destination chain an [EVM chain]().
Expand All @@ -40,6 +46,8 @@ Here the source chain is a [Parachain]() or an [EVMParachain]() and the destinat
2. Now that the computed origin account has the assets, the remote execution message is executed in Moonbeam, which will send the assets to the destination chain through a GMP provider. It is the same first step described in the [From EVM chains to parachains](#from-evm-chains-to-parachains) section, but in reverse.
3. The transaction must be executed in the destination chain, either manually or automatically by a relayer.

---

### Between Moon Chain and EVM chains. {: #from-moonchain-to-evm-chains }
This is the simplest type of transfer, as it only involves moving assets between Moonbeam and an EVM chain.

Expand All @@ -48,18 +56,18 @@ This is the simplest type of transfer, as it only involves moving assets between

For this type of transfer there is no need for a polkadot signer.

---
## MRL Asset Routes
<!-- TODO mjm reference Chain objects and Asset Amounts -->
Routes are defined in the [MRL Configs](https://github.com/moonbeam-foundation/xcm-sdk/blob/main/packages/config/src/mrl-configs/ethereum.ts){target=\_blank} file. Each route is an object that contains the source and destination chains, the assets to be transferred, and the fees.

---

## Transfer Data

<div class="grid" markdown>
<div markdown>




### Transfer Data Object
Defines the complete transfer data for transferring an asset, including asset balances, source and destination chain information, and a new concept exlusive to MRL which is the [moon chain](#moonchain)

Expand All @@ -81,6 +89,7 @@ Defines the complete transfer data for transferring an asset, including asset ba


```js title="Example"
// USDC from Ethereum to Hydration
{
destination: {
chain: _Parachain {
Expand Down Expand Up @@ -635,6 +644,8 @@ Defines the complete transfer data for transferring an asset, including asset ba
</div>
</div>

---

### MoonChain

We call Moon Chain to the intermediary chain that is used to transfer the assets between the Polkadot ecosystem and the external chains. For `Mainnet` Moonbeam is the moon chain, and for `Testnet` it is `Moonbase Alpha`.
Expand All @@ -643,6 +654,7 @@ We call Moon Chain to the intermediary chain that is used to transfer the assets
- In [parachain to EVM cases](#from-parachains-to-evm-chains) the moon chain receives the XCM message and executes the remote execution message, and in the [transfer data](#transfer-data-object) it contains the information of the computed origin account.
- In [Moon Chain to EVM cases](#from-moonchain-to-evm-chains) is either the source or the destination of the transfer, and in the [transfer data](#transfer-data-object) it contains the information of the sender's address.

---

<div class="grid" markdown>
<div markdown>
Expand Down Expand Up @@ -699,3 +711,8 @@ await transferData.transfer(

</div>
</div>

### TODO relayer fee


### TODO MRL method
Loading

0 comments on commit 7c9d0b4

Please sign in to comment.