Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/fassets/developer-guides/2-fassets-fxrp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The following TypeScript script demonstrates how to retrieve the FXRP address:
The script:

1. Connects to the `AssetManager` contract using the [`IAssetManager`](/fassets/reference/IAssetManager) interface.
2. Calls the [`fAsset()`](/fassets/reference/IAssetManager#fasset) function to get the FXRP token address.
2. Calls the [`fAsset`](/fassets/reference/IAssetManager#fasset) function to get the FXRP token address.
3. Logs the address to the console.

### Run the Script
Expand Down
18 changes: 9 additions & 9 deletions docs/fassets/developer-guides/5-fassets-minting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The minting process is a multi-step process that involves the following steps:

## Reserve Collateral

The following code demonstrates how to reserve collateral by calling the [`reserveCollateral()`](/fassets/reference/IAssetManager#reservecollateral) function on the AssetManager contract.
The following code demonstrates how to reserve collateral by calling the [`reserveCollateral`](/fassets/reference/IAssetManager#reservecollateral) function on the AssetManager contract.

<CodeBlock language="typescript" title="scripts/fassets/reserveCollateral.ts">
{FAssetsReserveCollateral}
Expand All @@ -55,11 +55,11 @@ The following code demonstrates how to reserve collateral by calling the [`reser
2. Retrieve and filter agents with enough free collateral and select the agent with the lowest fee and normal status.
3. Parse [`CollateralReserved`](/fassets/reference/IAssetManagerEvents#collateralreserved) event.
4. Start the minting reservation process at the script's entry point.
5. Call `findBestAgent()` with the required number of lots.
6. Fetch agent metadata from [`getAgentInfo()`](/fassets/reference/IAssetManager#getagentinfo) to get the agent's `feeBIPS`, which is used to calculate the collateral reservation fee.
7. Calculate the collateral reservation fee by calling [`collateralReservationFee()`](/fassets/reference/IAssetManager#collateralreservationfee).
8. Reserve collateral from agent by calling [`reserveCollateral()`](/fassets/reference/IAssetManager#reservecollateral)
9. Call `assetMintingDecimals()` to determine the XRP token's decimal precision.
5. Call `findBestAgent` with the required number of lots.
6. Fetch agent metadata from [`getAgentInfo`](/fassets/reference/IAssetManager#getagentinfo) to get the agent's `feeBIPS`, which is used to calculate the collateral reservation fee.
7. Calculate the collateral reservation fee by calling [`collateralReservationFee`](/fassets/reference/IAssetManager#collateralreservationfee).
8. Reserve collateral from agent by calling [`reserveCollateral`](/fassets/reference/IAssetManager#reservecollateral)
9. Call `assetMintingDecimals` to determine the XRP token's decimal precision.
10. Parse the [`CollateralReserved`](/fassets/reference/IAssetManagerEvents#collateralreserved) event.
11. Calculate the total XRP value required for payment.

Expand Down Expand Up @@ -89,7 +89,7 @@ Use the [FDC Payment](/fdc/guides/hardhat/payment) script to validate the XRP pa

## Execute Minting

Once the XRP payment is validated, you can retrieve the FDC proof from the [Data Availability Layer](/fdc/overview#data-availability-layer) and call the [`executeMinting()`](/fassets/reference/IAssetManager#executeminting) function on the AssetManager contract.
Once the XRP payment is validated, you can retrieve the FDC proof from the [Data Availability Layer](/fdc/overview#data-availability-layer) and call the [`executeMinting`](/fassets/reference/IAssetManager#executeminting) function on the AssetManager contract.

This script demonstrates how to retrieve the FDC proof and execute minting.

Expand All @@ -108,8 +108,8 @@ This script demonstrates how to retrieve the FDC proof and execute minting.
6. Create a function to get the proof from the FDC.
It sends a POST request to the [Flare Data Availability Layer](/fdc/overview#data-availability-layer) and returns a Merkle proof and attestation response from FDC.
7. Retrieve the FDC proof from the Data Availability Layer.
8. Call the [`executeMinting()`](/fassets/reference/IAssetManager#executeminting) function on the AssetManager contract and send a transaction to the Flare network to convert the attested XRP payment into FXRP (minting).
9. On a successful transaction call `parseExecutemintingEvents()` to extract and log events [`RedemptionTicketCreated`](/fassets/reference/IAssetManagerEvents#redemptionticketcreated) and [`MintingExecuted`](/fassets/reference/IAssetManagerEvents#mintingexecuted).
8. Call the [`executeMinting`](/fassets/reference/IAssetManager#executeminting) function on the AssetManager contract and send a transaction to the Flare network to convert the attested XRP payment into FXRP (minting).
9. On a successful transaction call `parseExecutemintingEvents` to extract and log events [`RedemptionTicketCreated`](/fassets/reference/IAssetManagerEvents#redemptionticketcreated) and [`MintingExecuted`](/fassets/reference/IAssetManagerEvents#mintingexecuted).

## Next Steps

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
:::tip[Exploring Additional Parameters]

The FAssets asset manager exposes key parameters like collateral ratios, minting fees, and liquidation thresholds via the `getSettings()` function.
The FAssets asset manager exposes key parameters like collateral ratios, minting fees, and liquidation thresholds via the `getSettings` function.
See the [FAssets Operational Parameters](/fassets/operational-parameters/#asset-manager-operational-parameters) for details.

:::