move all defi functionality to page and separate controller
This commit is contained in:
@@ -9,6 +9,7 @@ use crate::controllers::flow::FlowController;
|
||||
use crate::controllers::contract::ContractController;
|
||||
use crate::controllers::asset::AssetController;
|
||||
use crate::controllers::marketplace::MarketplaceController;
|
||||
use crate::controllers::defi::DefiController;
|
||||
use crate::middleware::JwtAuth;
|
||||
use crate::SESSION_KEY;
|
||||
|
||||
@@ -120,6 +121,18 @@ pub fn configure_routes(cfg: &mut web::ServiceConfig) {
|
||||
.route("/{id}/purchase", web::post().to(MarketplaceController::purchase_listing))
|
||||
.route("/{id}/cancel", web::post().to(MarketplaceController::cancel_listing))
|
||||
)
|
||||
|
||||
// DeFi routes
|
||||
.service(
|
||||
web::scope("/defi")
|
||||
.route("", web::get().to(DefiController::index))
|
||||
.route("/lending", web::post().to(DefiController::create_lending))
|
||||
.route("/borrowing", web::post().to(DefiController::create_borrowing))
|
||||
.route("/liquidity", web::post().to(DefiController::add_liquidity))
|
||||
.route("/staking", web::post().to(DefiController::create_staking))
|
||||
.route("/swap", web::post().to(DefiController::swap_tokens))
|
||||
.route("/collateral", web::post().to(DefiController::create_collateral))
|
||||
)
|
||||
);
|
||||
|
||||
// Keep the /protected scope for any future routes that should be under that path
|
||||
|
Reference in New Issue
Block a user