valence_market

Crates.iovalence_market
lib.rsvalence_market
version0.1.1
sourcesrc
created_at2023-10-25 11:01:49.209608
updated_at2023-11-24 15:26:47.931806
descriptionSet up a web3 marketplace in seconds
homepagehttps://a-block.io
repositoryhttps://github.com/ABlockOfficial/valence_market
max_upload_size
id1013288
size48,413
Byron (BHouwens)

documentation

https://a-block.io

README


Logo

valence_market

Pipeline Status

valence_market is a plug-in for Valence that lets you set up a web3 marketplace in seconds. Let your users buy and sell assets in a distributed marketplace, where the only fees are the ones you set, and your users are in control of their own trades.

Official documentation ยป

How to Use

valence_market provides routes that you can plug in to your base Valence node to turn it into a fully functional marketplace. It is designed to be used as a library and can be imported into your Valence project.

..

๐Ÿ”ง Installation

If you have cargo-add installed, you can simply run the following command:

cargo add valence_market

Otherwise, add the following to your Cargo.toml file:

[dependencies]
valence_market = "0.1.0"

(back to top)

..

๐Ÿ”Œ Available Routes

GET /listings

Retrieve a list of available assets that users can browse and potentially buy

..

GET /listings/:id

Retrieve a specific listing by its ID

..

POST /listings

Create a new listing. The structure for the request body will need to follow the Listing interface, which looks like:

{
    "_id": "a8f163782fb07c69f511248e",
    "title": "Asset_test",
    "description": "This is a test asset listing",
    "initial_price": 100,
    "quantity": 10
}

..

GET /orders/:id

Retrieve a list of orders that have been placed, retrieved by the listing ID

..

POST /orders

Create a new order. The structure for the request body will need to follow the Order interface, which looks like:

{
    "id": "8c6dbdaea24a234fad18eca6",
    "asset_id": "f837cb510db38d9040889e83",
    "price": 100,
    "quantity": 2,
    "is_bid": false,
    "created_at": "20 June 2023",
    "druid": "g092384435098",
    "desired_asset_id": null
}

(back to top)

..

๐Ÿšง Further Work

  • Paginate orders
  • Add cache functionality
  • Add cuckoo filter functionality
  • Separate ID from Listing and Order structs (create MongoDB wrapper struct with ID)
  • Construct initial order when new listing is created (does this form part of the listing POST call?)
  • Add tests
  • Add logging
  • Refactor and improve error messages for call failures
  • Create user functionality
  • With user functionality enabled, add user ID to listing and order structs
  • With user functionality enabled, add PUT/DELETE calls for listings and orders

(back to top)

..

Commit count: 23

cargo fmt