# The Mesh team presents: An Aiken library to make devs' day-to-day lives 🌤️easier" series (part 2)

**URL:** <https://forum.cardano.org/t/the-mesh-team-presents-an-aiken-library-to-make-devs-day-to-day-lives-easier-series-part-2/133482>\
**Category:** Smart Contracts\
**Tags:** mesh, gimbalabs\
**Created:** [26 June 2024 13:28 UTC](https://forum.cardano.org/t/the-mesh-team-presents-an-aiken-library-to-make-devs-day-to-day-lives-easier-series-part-2/133482 "2024-06-26T13:28:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sebastian\_Pabon](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/sebastian_pabon/32/86686_2.png) [@Sebastian\_Pabon](https://forum.cardano.org/u/Sebastian_Pabon)\
**Post date:** [26 June 2024 13:28 UTC](https://forum.cardano.org/t/the-mesh-team-presents-an-aiken-library-to-make-devs-day-to-day-lives-easier-series-part-2/133482/1 "2024-06-26T13:28:57Z")

</div>

![smart-contract-transactions](https://us1.discourse-cdn.com/flex023/uploads/cardano/original/3X/8/e/8e86a43c9be6ea94e1cb65851a327eb862c06d38.png)

## In the second part of this series, we will delve into the endpoints of the Marketplace contract. This contract is part of a suite of Aiken smart contracts built to redefine reusability and developer engagement, setting a new standard in the field.

* * *

✅Contract: **Marketplace** (try it: link to the main tweet)

Today: Contract 🛎 **Endpoints** (List Asset, Buy Asset, Update Listing, Cancel Listing)

* * *

🛎Endpoint: _List Asset_

What does it make possible to list assets in the Marketplace for sale?: The `listAsset()` function.

The function accepts the following parameters:

asset (string) - the asset’s unit to be listed price (number) - the listing price in Lovelace

```auto
const tx = await contract.listAsset('d9312da562da182b02322fd8acb536f37eb9d29fba7c49dc172555274d657368546f6b656e', 10000000);
const signedTx = await wallet.signTx(tx);
const txHash = await wallet.submitTx(signedTx);

```

* * *

🛎Endpoint: _Buy Asset_

What does it make possible to purchase a listed asset from the marketplace?: The `purchaseAsset()` function.

The function accepts the following parameters:

utxo (UTxO) - unspent transaction output in the script

```auto
const utxo = await contract.getUtxoByTxHash(txHashToSearchFor);
const tx = await contract.purchaseAsset(utxo);
const signedTx = await wallet.signTx(tx, true);
const txHash = await wallet.submitTx(signedTx);

```

* * *

🛎Endpoint: _Update Listing_

What allows a seller to update the price of its merchandise in the marketplace?: The `relistAsset()` function

The function accepts the following parameters:

utxo (UTxO) - unspent transaction output in the script newListPrice (number) - the new listing price in Lovelace

```auto
const utxo = await contract.getUtxoByTxHash(txHashToSearchFor);
const tx = await contract.relistAsset(utxo, 20000000);
const signedTx = await wallet.signTx(tx, true);
const txHash = await wallet.submitTx(signedTx);

```

* * *

🛎Endpoint: _Cancel Listing_

What allows sellers to cancel their listing at any time and receive their product back?: The `delistAsset()` function.

The function accepts the following parameters:

utxo (UTxO) - unspent transaction output in the script

```auto
const utxo = await contract.getUtxoByTxHash(txHashToSearchFor);
const tx = await contract.delistAsset(utxo);
const signedTx = await wallet.signTx(tx, true);
const txHash = await wallet.submitTx(signedTx);

```

* * *

Would you like to test drive this code? Go to [Marketplace](https://meshjs.dev/smart-contracts/marketplace)

 ![desc](https://us1.discourse-cdn.com/flex023/uploads/cardano/original/3X/1/2/12c44b8ff621a9321b17bebf5faa10072a873e24.png)

### _Mesh: making life 🌤easier for developers_

In part 3: a new contract - **the Vesting contract**.
