Skip to content

Commit

Permalink
specify that chain keys are allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaurello committed Jan 23, 2025
1 parent 76e8769 commit 562d7df
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
12 changes: 8 additions & 4 deletions mkdocs/docs/example-usage/mrl.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,23 +159,27 @@ The chained methods will provide data on the assets and chains along the way, bu
const { sources, setSource } = mrlInstance;
```

2. Call the `setSource` function and pass in the source chain to define the source chain for the transfer
2. Call the `setSource` function and pass in the source chain object or chain key to define the source chain for the transfer

```js
import { ethereum } from '@moonbeam-network/xcm-config';

// Using the object
const { destinations, setDestination } = mrlInstance.setSource(ethereum);

// Using the key
const { destinations, setDestination } = mrlInstance.setSource('ethereum');
```

3. Call the `setDestination` function and pass in the destination chain to define the destination chain for the transfer
3. Call the `setDestination` function and pass in the destination chain object or chain key to define the destination chain for the transfer

```js
import { ethereum } from '@moonbeam-network/xcm-config';
import { hydration } from '@moonbeam-network/xcm-config';

const { assets, setAsset } = mrlInstance.setDestination(hydration);
```

4. Call the `setAsset` function and pass in the asset to define the asset to be transferred
4. Call the `setAsset` function and pass in the asset object or asset key to define the asset to be transferred

```js
import { usdc } from '@moonbeam-network/xcm-config';
Expand Down
13 changes: 9 additions & 4 deletions mkdocs/docs/example-usage/xcm.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,26 +293,31 @@ The chained methods will provide data on the assets and chains along the way, bu
```js
import { dot } from '@moonbeam-network/xcm-config';

// Using the key
// Using the object
const { sources, setSource } = setAsset(dot);

// Using the key
const { sources, setSource } = setAsset('dot');
```

This will return a list of the supported source chains for this asset and the [`setSource`](../reference/xcm.md#the-sdk-method) function, which is used to define the source chain to transfer the asset from

3. Call the `setSource` function and pass in the chain object (which includes the key, name, and chain type). For example:
3. Call the `setSource` function and pass in the chain key or chain object (which includes the key, name, and chain type). For example:

```js
import { polkadot } from '@moonbeam-network/xcm-config';

// Using the object
const { destinations, setDestination } = setSource(polkadot);
```

This will return a list of the supported destination chains where there is an open XCM channel from the source chain for the given asset and the [`setDestination`](../reference/xcm.md#the-sdk-method) function, which is used to define the destination chain to transfer the asset to.

4. Call the `setDestination` function and pass in the the chain object (which includes the key, name, and chain type). For example:
4. Call the `setDestination` function and pass in the the chain key or chain object (which includes the key, name, and chain type). For example:

```js
const { setAddresses } = setDestination(moonbeam);
// Using the key
const { setAddresses } = setDestination('moonbeam');
```

This will return the [`setAddresses`](../reference/xcm.md#the-sdk-method) function, which is used to define the source and destination addresses.
Expand Down

0 comments on commit 562d7df

Please sign in to comment.