From 21978de9911ebd5d2e9ccd8a5211562a4c60a844 Mon Sep 17 00:00:00 2001 From: creating2morrow Date: Mon, 29 May 2023 06:14:01 -0400 Subject: [PATCH] nevmes-market intial commit --- Cargo.lock | 12 + Cargo.toml | 1 + nevmes-core/src/args.rs | 3 + nevmes-core/src/models.rs | 202 ++- nevmes-core/src/monero.rs | 35 +- nevmes-core/src/reqres.rs | 308 +--- nevmes-core/src/utils.rs | 15 + nevmes-market/.gitignore | 7 + nevmes-market/Cargo.lock | 2660 +++++++++++++++++++++++++++++++ nevmes-market/Cargo.toml | 12 + nevmes-market/LICENSE | 21 + nevmes-market/README.md | 64 + nevmes-market/curl.md | 75 + nevmes-market/src/controller.rs | 110 ++ nevmes-market/src/dispute.rs | 31 + nevmes-market/src/lib.rs | 6 + nevmes-market/src/main.rs | 22 + nevmes-market/src/order.rs | 111 ++ nevmes-market/src/product.rs | 86 + scripts/build_all_and_run.sh | 1 + scripts/build_release.sh | 2 + scripts/cleanall.sh | 1 + scripts/fmtall.sh | 1 + src/controller.rs | 45 +- src/main.rs | 2 + 25 files changed, 3446 insertions(+), 387 deletions(-) create mode 100755 nevmes-market/.gitignore create mode 100755 nevmes-market/Cargo.lock create mode 100755 nevmes-market/Cargo.toml create mode 100644 nevmes-market/LICENSE create mode 100755 nevmes-market/README.md create mode 100644 nevmes-market/curl.md create mode 100644 nevmes-market/src/controller.rs create mode 100644 nevmes-market/src/dispute.rs create mode 100755 nevmes-market/src/lib.rs create mode 100755 nevmes-market/src/main.rs create mode 100644 nevmes-market/src/order.rs create mode 100644 nevmes-market/src/product.rs diff --git a/Cargo.lock b/Cargo.lock index 8939283..92573c4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1934,6 +1934,7 @@ dependencies = [ "nevmes_contact", "nevmes_core", "nevmes_gui", + "nevmes_market", "nevmes_message", "rocket", ] @@ -2007,6 +2008,17 @@ dependencies = [ "wasm-bindgen-futures", ] +[[package]] +name = "nevmes_market" +version = "0.5.0-alpha" +dependencies = [ + "chrono", + "env_logger", + "log 0.4.17", + "nevmes_core", + "rocket", +] + [[package]] name = "nevmes_message" version = "0.5.0-alpha" diff --git a/Cargo.toml b/Cargo.toml index 9b85a9c..8668b1b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,5 +11,6 @@ nevmes_auth = { path = "./nevmes-auth" } nevmes_contact = { path = "./nevmes-contact" } nevmes_core = { path = "./nevmes-core" } nevmes_gui = { path = "./nevmes-gui" } +nevmes_market = { path = "./nevmes-market" } nevmes_message = { path = "./nevmes-message" } rocket = { version = "0.5.0-rc.2", features = ["json"] } diff --git a/nevmes-core/src/args.rs b/nevmes-core/src/args.rs index 4938112..fe98487 100644 --- a/nevmes-core/src/args.rs +++ b/nevmes-core/src/args.rs @@ -89,6 +89,9 @@ pub struct Args { /// Messaging sending port #[arg(long, help = "Set app message sending port", default_value = "9045")] pub message_port: u16, + /// Marketplace admin port + #[arg(long, help = "Set app marketplace admin port", default_value = "9046")] + pub marketplace_port: u16, /// Auto trust contact gpg keys (DISABLED) #[arg( long, diff --git a/nevmes-core/src/models.rs b/nevmes-core/src/models.rs index ee2fed5..6f776d4 100644 --- a/nevmes-core/src/models.rs +++ b/nevmes-core/src/models.rs @@ -175,7 +175,7 @@ impl Message { } } -#[derive(Debug, Deserialize)] +#[derive(Debug, Deserialize, Serialize)] #[serde(crate = "rocket::serde")] pub struct User { pub uid: String, @@ -217,13 +217,13 @@ impl User { } } -#[derive(Debug, Deserialize)] +#[derive(Debug, Deserialize, Serialize)] #[serde(crate = "rocket::serde")] pub struct Product { pub pid: String, - pub vid: String, - pub in_stock: bool, pub description: String, + pub image: Vec, + pub in_stock: bool, pub name: String, pub price: i64, pub qty: i64, @@ -233,8 +233,8 @@ impl Default for Product { fn default() -> Self { Product { pid: utils::empty_string(), - vid: utils::empty_string(), description: utils::empty_string(), + image: Vec::new(), in_stock: false, name: utils::empty_string(), price: 0, @@ -245,16 +245,17 @@ impl Default for Product { impl Product { pub fn to_db(p: &Product) -> String { + let image: String = hex::encode(&p.image); format!( "{}:{}:{}:{}:{}:{}", - p.vid, p.description, p.in_stock, p.name, p.price, p.qty + p.description, image, p.in_stock, p.name, p.price, p.qty ) } pub fn from_db(k: String, v: String) -> Product { let values = v.split(":"); let mut v: Vec = values.map(|s| String::from(s)).collect(); - let vid = v.remove(0); let description = v.remove(0); + let image = hex::decode(v.remove(0)).unwrap_or(Vec::new()); let in_stock = match v.remove(0).parse::() { Ok(b) => b, Err(_) => false, @@ -270,8 +271,8 @@ impl Product { }; Product { pid: k, - vid, description, + image, in_stock, name, price, @@ -281,6 +282,7 @@ impl Product { pub fn update( p: Product, description: String, + image: Vec, in_stock: bool, name: String, price: i64, @@ -288,8 +290,8 @@ impl Product { ) -> Product { Product { pid: p.pid, - vid: p.vid, description, + image, in_stock, name, price, @@ -298,74 +300,200 @@ impl Product { } } -// TODO: add mediator fields - -#[derive(Debug)] +#[derive(Debug, Deserialize, Serialize)] +#[serde(crate = "rocket::serde")] pub struct Order { pub orid: String, - pub c_id: String, - pub p_id: String, - pub v_id: String, - pub xmr_address: String, - pub cust_msig_info: String, - pub cust_msig_txset: String, + /// Order customer id is their .b32.i2p address + pub cid: String, + pub pid: String, pub cust_kex_1: String, pub cust_kex_2: String, pub cust_kex_3: String, + pub cust_msig_make: String, + pub cust_msig_prepare: String, + pub cust_msig_txset: String, pub date: i64, pub deliver_date: i64, - pub ship_date: i64, pub hash: String, - pub msig_prepare: String, - pub msig_make: String, - pub msig_kex_1: String, - pub msig_kex_2: String, - pub msig_kex_3: String, + pub mediator_kex_1: String, + pub mediator_kex_2: String, + pub mediator_kex_3: String, + pub mediator_msig_make: String, + pub mediator_msig_prepare: String, + pub ship_date: i64, + /// This is the final destination for the payment pub subaddress: String, pub status: String, pub quantity: i64, pub vend_kex_1: String, pub vend_kex_2: String, pub vend_kex_3: String, - pub vend_msig_info: String, + pub vend_msig_make: String, + pub vend_msig_prepare: String, pub vend_msig_txset: String, + pub xmr_address: String, } impl Default for Order { fn default() -> Self { Order { orid: utils::empty_string(), - c_id: utils::empty_string(), - p_id: utils::empty_string(), - v_id: utils::empty_string(), + cid: utils::empty_string(), + pid: utils::empty_string(), xmr_address: utils::empty_string(), - cust_msig_info: utils::empty_string(), - cust_msig_txset: utils::empty_string(), cust_kex_1: utils::empty_string(), cust_kex_2: utils::empty_string(), cust_kex_3: utils::empty_string(), + cust_msig_make: utils::empty_string(), + cust_msig_prepare: utils::empty_string(), + cust_msig_txset: utils::empty_string(), date: 0, deliver_date: 0, ship_date: 0, hash: utils::empty_string(), - msig_prepare: utils::empty_string(), - msig_make: utils::empty_string(), - msig_kex_1: utils::empty_string(), - msig_kex_2: utils::empty_string(), - msig_kex_3: utils::empty_string(), + mediator_kex_1: utils::empty_string(), + mediator_kex_2: utils::empty_string(), + mediator_kex_3: utils::empty_string(), + mediator_msig_make: utils::empty_string(), + mediator_msig_prepare: utils::empty_string(), subaddress: utils::empty_string(), status: utils::empty_string(), quantity: 0, vend_kex_1: utils::empty_string(), vend_kex_2: utils::empty_string(), vend_kex_3: utils::empty_string(), - vend_msig_info: utils::empty_string(), + vend_msig_make: utils::empty_string(), + vend_msig_prepare: utils::empty_string(), vend_msig_txset: utils::empty_string(), } } } -#[derive(Debug, Deserialize)] +impl Order { + pub fn to_db(o: &Order) -> String { + format!( + "{}:{}:{}:{}:{}:{}:{}:{}:{}:{}:{}:{}:{}:{}:{}:{}:{}:{}:{}:{}:{}:{}:{}:{}:{}:{}:{}", + o.cid, o.pid, o.cust_kex_1, o.cust_kex_2, o.cust_kex_3, o.cust_msig_make, + o.cust_msig_prepare, o.cust_msig_txset, o.date, o.deliver_date, + o.hash, o.mediator_msig_make, o.mediator_msig_prepare, o.mediator_kex_1, + o.mediator_kex_2, o.mediator_kex_3, o.ship_date, o.subaddress, o.status, + o.quantity, o.vend_kex_1, o.vend_kex_2, o.vend_kex_3, o.vend_msig_make, + o.vend_msig_prepare, o.vend_msig_txset, o.xmr_address, + ) + } + pub fn from_db(k: String, v: String) -> Order { + let values = v.split(":"); + let mut v: Vec = values.map(|s| String::from(s)).collect(); + let orid = k; + let cid = v.remove(0); + let pid = v.remove(0); + let cust_kex_1 = v.remove(0); + let cust_kex_2 = v.remove(0); + let cust_kex_3 = v.remove(0); + let cust_msig_make = v.remove(0); + let cust_msig_prepare = v.remove(0); + let cust_msig_txset = v.remove(0); + let date = match v.remove(0).parse::() { + Ok(d) => d, + Err(_) => 0, + }; + let deliver_date = match v.remove(0).parse::() { + Ok(d) => d, + Err(_) => 0, + }; + let hash = v.remove(0); + let mediator_msig_make = v.remove(0); + let mediator_msig_prepare = v.remove(0); + let mediator_kex_1 = v.remove(0); + let mediator_kex_2 = v.remove(0); + let mediator_kex_3 = v.remove(0); + let ship_date = match v.remove(0).parse::() { + Ok(d) => d, + Err(_) => 0, + }; + let subaddress = v.remove(0); + let status = v.remove(0); + let quantity = match v.remove(0).parse::() { + Ok(d) => d, + Err(_) => 0, + }; + let vend_kex_1 = v.remove(0); + let vend_kex_2 = v.remove(0); + let vend_kex_3 = v.remove(0); + let vend_msig_make = v.remove(0); + let vend_msig_prepare = v.remove(0); + let vend_msig_txset = v.remove(0); + let xmr_address = v.remove(0); + Order { + orid, + cid, + pid, + cust_kex_1, + cust_kex_2, + cust_kex_3, + cust_msig_make, + cust_msig_prepare, + cust_msig_txset, + date, + deliver_date, + hash, + mediator_kex_1, + mediator_kex_2, + mediator_kex_3, + mediator_msig_make, + mediator_msig_prepare, + ship_date, + subaddress, + status, + quantity, + vend_kex_1, + vend_kex_2, + vend_kex_3, + vend_msig_make, + vend_msig_prepare, + vend_msig_txset, + xmr_address, + } + } + pub fn update( + orid: String, + o: Order, + ) -> Order { + Order { + orid, + cid: String::from(&o.cid), + pid: String::from(&o.pid), + cust_kex_1: String::from(&o.cust_kex_1), + cust_kex_2: String::from(&o.cust_kex_2), + cust_kex_3: String::from(&o.cust_kex_3), + cust_msig_make: String::from(&o.cust_msig_make), + cust_msig_prepare: String::from(&o.cust_msig_make), + cust_msig_txset: String::from(&o.cust_msig_txset), + date: o.date, + deliver_date: o.deliver_date, + hash: String::from(&o.hash), + mediator_kex_1: String::from(&o.mediator_kex_1), + mediator_kex_2: String::from(&o.mediator_kex_2), + mediator_kex_3: String::from(&o.mediator_kex_3), + mediator_msig_make: String::from(&o.mediator_msig_make), + mediator_msig_prepare: String::from(&o.mediator_msig_prepare), + ship_date: o.ship_date, + subaddress: String::from(&o.subaddress), + status: String::from(&o.status), + quantity: o.quantity, + vend_kex_1: String::from(&o.vend_kex_1), + vend_kex_2: String::from(&o.vend_kex_2), + vend_kex_3: String::from(&o.vend_kex_3), + vend_msig_make: String::from(&o.vend_msig_make), + vend_msig_prepare: String::from(&o.vend_msig_prepare), + vend_msig_txset: String::from(&o.vend_msig_txset), + xmr_address: String::from(&o.xmr_address), + } + } +} + +#[derive(Debug, Deserialize, Serialize)] #[serde(crate = "rocket::serde")] pub struct Dispute { pub did: String, diff --git a/nevmes-core/src/monero.rs b/nevmes-core/src/monero.rs index ec16d75..46f2fb5 100644 --- a/nevmes-core/src/monero.rs +++ b/nevmes-core/src/monero.rs @@ -598,39 +598,6 @@ pub async fn make_wallet(info: Vec) -> reqres::XmrRpcMakeResponse { } } -/// Performs the xmr rpc 'finalize_multisig' method -pub async fn finalize_wallet(info: Vec) -> reqres::XmrRpcFinalizeResponse { - info!("executing {}", RpcFields::Finalize.value()); - let client = reqwest::Client::new(); - let host = get_rpc_host(); - let params = reqres::XmrRpcFinalizeParams { - multisig_info: info, - }; - let req = reqres::XmrRpcFinalizeRequest { - jsonrpc: RpcFields::JsonRpcVersion.value(), - id: RpcFields::Id.value(), - method: RpcFields::Finalize.value(), - params, - }; - let login: RpcLogin = get_rpc_creds(); - match client - .post(host) - .json(&req) - .send_with_digest_auth(&login.username, &login.credential) - .await - { - Ok(response) => { - let res = response.json::().await; - debug!("{} response: {:?}", RpcFields::Finalize.value(), res); - match res { - Ok(res) => res, - _ => Default::default(), - } - } - Err(_) => Default::default(), - } -} - /// Performs the xmr rpc 'export_multisig_info' method pub async fn export_multisig_info() -> reqres::XmrRpcExportResponse { info!("executing {}", RpcFields::Export.value()); @@ -725,7 +692,7 @@ pub async fn sign_multisig(tx_data_hex: String) -> reqres::XmrRpcSignMultisigRes /// Performs the xmr rpc 'exchange_multisig_keys' method pub async fn exchange_multisig_keys( force_update_use_with_caution: bool, - multisig_info: String, + multisig_info: Vec, password: String, ) -> reqres::XmrRpcExchangeMultisigKeysResponse { info!("executing: {}", RpcFields::ExchangeMultisigKeys.value()); diff --git a/nevmes-core/src/reqres.rs b/nevmes-core/src/reqres.rs index 279e8ef..8c63a54 100644 --- a/nevmes-core/src/reqres.rs +++ b/nevmes-core/src/reqres.rs @@ -1,4 +1,4 @@ -use crate::{utils, models}; +use crate::utils; use serde::{ Deserialize, Serialize, @@ -62,7 +62,7 @@ pub struct XmrRpcSignMultisigParams { #[derive(Deserialize, Serialize, Debug)] pub struct XmrRpcExchangeMultisigKeysParams { pub force_update_use_with_caution: bool, - pub multisig_info: String, + pub multisig_info: Vec, pub password: String, } @@ -1080,307 +1080,3 @@ impl Default for ErrorResponse { } } } - -#[derive(Serialize, Deserialize)] -#[serde(crate = "rocket::serde")] -pub struct GetCustomerResponse { - pub address: String, - pub cid: String, - pub name: String, - pub pgp: String, -} - -impl Default for GetCustomerResponse { - fn default() -> Self { - GetCustomerResponse { - address: utils::empty_string(), - cid: utils::empty_string(), - name: utils::empty_string(), - pgp: utils::empty_string(), - } - } -} - -#[derive(Serialize, Deserialize)] -#[serde(crate = "rocket::serde")] -pub struct GetVendorResponse { - pub vid: String, - pub active: bool, - pub address: String, - pub description: String, - pub name: String, - pub pgp: String, -} - -impl Default for GetVendorResponse { - fn default() -> Self { - GetVendorResponse { - vid: utils::empty_string(), - active: false, - address: utils::empty_string(), - description: utils::empty_string(), - name: utils::empty_string(), - pgp: utils::empty_string(), - } - } -} - -#[derive(Serialize, Deserialize)] -#[serde(crate = "rocket::serde")] -pub struct GetProductResponse { - pub pid: String, - pub in_stock: bool, - pub description: String, - pub name: String, - pub price: i64, - pub qty: i64, -} - -impl Default for GetProductResponse { - fn default() -> Self { - GetProductResponse { - pid: utils::empty_string(), - in_stock: false, - description: utils::empty_string(), - name: utils::empty_string(), - price: 0, - qty: 0, - } - } -} - -#[derive(Serialize, Deserialize)] -#[serde(crate = "rocket::serde")] -pub struct GetVendorProductsResponse { - pub products: Vec, -} - -impl Default for GetVendorProductsResponse { - fn default() -> Self { - GetVendorProductsResponse { - products: Vec::new(), - } - } -} - -#[derive(Serialize, Deserialize)] -#[serde(crate = "rocket::serde")] -pub struct GetAuthResponse { - pub address: String, - pub aid: String, - pub created: i64, - pub cvid: String, - pub data: String, - pub token: String, -} - -impl Default for GetAuthResponse { - fn default() -> Self { - GetAuthResponse { - address: utils::empty_string(), - aid: utils::empty_string(), - created: 0, - cvid: utils::empty_string(), - data: utils::empty_string(), - token: utils::empty_string(), - } - } -} - -#[derive(Serialize, Deserialize)] -#[serde(crate = "rocket::serde")] -pub struct GetDisputeResponse { - pub orid: String, - pub created: i64, - pub tx_set: String, -} - -impl Default for GetDisputeResponse { - fn default() -> Self { - GetDisputeResponse { - orid: utils::empty_string(), - created: 0, - tx_set: utils::empty_string(), - } - } -} - -#[derive(Serialize, Deserialize)] -#[serde(crate = "rocket::serde")] -pub struct GetOrderResponse { - pub orid: String, - pub pid: String, - pub xmr_address: String, - pub cust_msig_info: String, - pub cust_kex_1: String, - pub cust_kex_2: String, - pub cust_kex_3: String, - pub date: i64, - pub deliver_date: i64, - pub ship_date: i64, - pub hash: String, - pub msig_prepare: String, - pub msig_make: String, - pub msig_kex_1: String, - pub msig_kex_2: String, - pub msig_kex_3: String, - pub subaddress: String, - pub status: String, - pub quantity: i64, - pub vend_kex_1: String, - pub vend_kex_2: String, - pub vend_kex_3: String, - pub vend_msig_info: String, -} - -impl Default for GetOrderResponse { - fn default() -> Self { - GetOrderResponse { - orid: utils::empty_string(), - pid: utils::empty_string(), - xmr_address: utils::empty_string(), - cust_msig_info: utils::empty_string(), - cust_kex_1: utils::empty_string(), - cust_kex_2: utils::empty_string(), - cust_kex_3: utils::empty_string(), - date: 0, - deliver_date: 0, - ship_date: 0, - hash: utils::empty_string(), - msig_prepare: utils::empty_string(), - msig_make: utils::empty_string(), - msig_kex_1: utils::empty_string(), - msig_kex_2: utils::empty_string(), - msig_kex_3: utils::empty_string(), - subaddress: utils::empty_string(), - status: utils::empty_string(), - quantity: 0, - vend_kex_1: utils::empty_string(), - vend_kex_2: utils::empty_string(), - vend_kex_3: utils::empty_string(), - vend_msig_info: utils::empty_string(), - } - } -} - -#[derive(Serialize, Deserialize)] -#[serde(crate = "rocket::serde")] -pub struct GetOrdersResponse { - pub orders: Vec, -} - -impl Default for GetOrdersResponse { - fn default() -> Self { - GetOrdersResponse { - orders: Vec::new(), - } - } -} - -// START response builders -impl GetDisputeResponse { - pub fn build(m_dispute: models::Dispute) -> Self { - GetDisputeResponse { - orid: m_dispute.orid, - created: m_dispute.created, - tx_set: m_dispute.tx_set, - } - } -} - -impl GetProductResponse { - pub fn build(m_product: models::Product) -> Self { - GetProductResponse { - pid: m_product.pid, - in_stock: m_product.in_stock, - description: m_product.description, - name: m_product.name, - price: m_product.price, - qty: m_product.qty, - } - } -} - -impl GetVendorProductsResponse { - pub fn build(m_products: Vec) -> Self { - let mut v_res: Vec = Vec::new(); - for m in m_products { - let p_res: GetProductResponse = GetProductResponse { - pid: m.pid, - in_stock: m.in_stock, - description: m.description, - name: m.name, - price: m.price, - qty: m.qty, - }; - v_res.push(p_res); - } - GetVendorProductsResponse { products: v_res } - } -} - -impl GetOrderResponse { - pub fn build(pid: String, m_order: models::Order) -> Self { - GetOrderResponse { - orid: m_order.orid, - pid, - xmr_address: m_order.xmr_address, - cust_msig_info: m_order.cust_msig_info, - cust_kex_1: m_order.cust_kex_1, - cust_kex_2: m_order.cust_kex_2, - cust_kex_3: m_order.cust_kex_3, - date: m_order.date, - deliver_date: m_order.deliver_date, - ship_date: m_order.ship_date, - hash: m_order.hash, - msig_prepare: m_order.msig_prepare, - msig_make: m_order.msig_make, - msig_kex_1: m_order.msig_kex_1, - msig_kex_2: m_order.msig_kex_2, - msig_kex_3: m_order.msig_kex_3, - subaddress: m_order.subaddress, - status: m_order.status, - quantity: m_order.quantity, - vend_kex_1: m_order.vend_kex_1, - vend_kex_2: m_order.vend_kex_2, - vend_kex_3: m_order.vend_kex_3, - vend_msig_info: m_order.vend_msig_info, - } - } -} - -impl GetOrdersResponse { - pub fn build(m_orders: Vec) -> Self { - let mut v_res: Vec = Vec::new(); - for m in m_orders { - let o_res: GetOrderResponse = GetOrderResponse { - orid: m.orid, - pid: m.p_id, - xmr_address: m.xmr_address, - cust_msig_info: m.cust_msig_info, - cust_kex_1: m.cust_kex_1, - cust_kex_2: m.cust_kex_2, - cust_kex_3: m.cust_kex_3, - date: m.date, - deliver_date: m.deliver_date, - ship_date: m.ship_date, - hash: m.hash, - msig_prepare: m.msig_prepare, - msig_make: m.msig_make, - msig_kex_1: m.msig_kex_1, - msig_kex_2: m.msig_kex_2, - msig_kex_3: m.msig_kex_3, - subaddress: m.subaddress, - status: m.status, - quantity: m.quantity, - vend_kex_1: m.vend_kex_1, - vend_kex_2: m.vend_kex_2, - vend_kex_3: m.vend_kex_3, - vend_msig_info: m.vend_msig_info, - }; - v_res.push(o_res); - } - GetOrdersResponse { orders: v_res } - } -} -// END response builders diff --git a/nevmes-core/src/utils.rs b/nevmes-core/src/utils.rs index 26e355d..c55cbd3 100644 --- a/nevmes-core/src/utils.rs +++ b/nevmes-core/src/utils.rs @@ -179,6 +179,12 @@ pub fn get_app_contact_port() -> u16 { args.contact_port } +/// app message port +pub fn get_app_market_port() -> u16 { + let args = args::Args::parse(); + args.marketplace_port +} + /// app message port pub fn get_app_message_port() -> u16 { let args = args::Args::parse(); @@ -355,6 +361,15 @@ fn start_micro_servers() { .spawn() .expect("failed to start contact server"); debug!("{:?}", c_output.stdout); + info!("starting marketplace admin server"); + let mut market_path = "nevmes-contact/target/debug/nevmes_market"; + if env == ReleaseEnvironment::Production { + market_path = "nevmes_market"; + } + let market_output = std::process::Command::new(market_path) + .spawn() + .expect("failed to start marketplace server"); + debug!("{:?}", market_output.stdout); info!("starting message server"); let mut message_path = "nevmes-message/target/debug/nevmes_message"; if env == ReleaseEnvironment::Production { diff --git a/nevmes-market/.gitignore b/nevmes-market/.gitignore new file mode 100755 index 0000000..61100c3 --- /dev/null +++ b/nevmes-market/.gitignore @@ -0,0 +1,7 @@ +/target +/core +/test-lmdb +/wallet +monero-wallet-rpc.log +notes.txt +.env \ No newline at end of file diff --git a/nevmes-market/Cargo.lock b/nevmes-market/Cargo.lock new file mode 100755 index 0000000..5bb090d --- /dev/null +++ b/nevmes-market/Cargo.lock @@ -0,0 +1,2660 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aead" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c192eb8f11fc081b0fe4259ba5af04217d4e0faddd02417310a927911abd7c8" +dependencies = [ + "crypto-common", + "generic-array", +] + +[[package]] +name = "aes" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "433cfd6710c9986c576a25ca913c39d66a6474107b406f34f91d4a8923395241" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "aes-gcm" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e1366e0c69c9f927b1fa5ce2c7bf9eafc8f9268c0b9800729e8b267612447c" +dependencies = [ + "aead", + "aes", + "cipher", + "ctr", + "ghash", + "subtle", +] + +[[package]] +name = "aho-corasick" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +dependencies = [ + "memchr", +] + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "async-stream" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dad5c83079eae9969be7fadefe640a1c566901f05ff91ab221de4b6f68d9507e" +dependencies = [ + "async-stream-impl", + "futures-core", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "async-trait" +version = "0.1.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "atomic" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b88d82667eca772c4aa12f0f1348b3ae643424c8876448f3f7bd5787032e234c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5" + +[[package]] +name = "base64" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" + +[[package]] +name = "binascii" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "383d29d513d8764dcdc42ea295d979eb99c3c9f00607b3692cf68a431f7dca72" + +[[package]] +name = "bitflags" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +dependencies = [ + "generic-array", +] + +[[package]] +name = "build-rs" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b00b8763668c99f8d9101b8a0dd82106f58265464531a79b2cef0d9a30c17dd2" + +[[package]] +name = "bumpalo" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" + +[[package]] +name = "bytes" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" + +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" + +[[package]] +name = "cfg-expr" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8790cf1286da485c72cf5fc7aeba308438800036ec67d89425924c4807268c9" +dependencies = [ + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" +dependencies = [ + "iana-time-zone", + "js-sys", + "num-integer", + "num-traits", + "time 0.1.45", + "wasm-bindgen", + "winapi", +] + +[[package]] +name = "cipher" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1873270f8f7942c191139cb8a40fd228da6c3fd2fc376d7e92d47aa14aeb59e" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "clap" +version = "4.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f13b9c79b5d1dd500d20ef541215a6423c75829ef43117e1b4d17fd8af0b5d76" +dependencies = [ + "bitflags 1.3.2", + "clap_derive", + "clap_lex", + "is-terminal", + "once_cell", + "strsim", + "termcolor", +] + +[[package]] +name = "clap_derive" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "684a277d672e91966334af371f1a7b5833f9aa00b07c84e92fbce95e00208ce8" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "783fe232adfca04f90f56201b26d79682d4cd2625e0bc7290b95123afe558ade" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + +[[package]] +name = "conv" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ff10625fd0ac447827aa30ea8b861fead473bb60aeb73af6c1c58caf0d1299" +dependencies = [ + "custom_derive", +] + +[[package]] +name = "cookie" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb" +dependencies = [ + "aes-gcm", + "base64 0.20.0", + "hkdf", + "hmac", + "percent-encoding", + "rand", + "sha2 0.10.6", + "subtle", + "time 0.3.17", + "version_check", +] + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + +[[package]] +name = "cpufeatures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "rand_core", + "typenum", +] + +[[package]] +name = "cstr-argument" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bd9c8e659a473bce955ae5c35b116af38af11a7acb0b480e01f3ed348aeb40" +dependencies = [ + "cfg-if", + "memchr", +] + +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher", +] + +[[package]] +name = "custom_derive" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef8ae57c4978a2acd8b869ce6b9ca1dfe817bff704c220209fdef2c0b75a01b9" + +[[package]] +name = "cxx" +version = "1.0.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc831ee6a32dd495436e317595e639a587aa9907bef96fe6e6abc290ab6204e9" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94331d54f1b1a8895cd81049f7eaaaef9d05a7dcb4d1fd08bf3ff0806246789d" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2", + "quote", + "scratch", + "syn", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48dcd35ba14ca9b40d6e4b4b39961f23d835dbb8eed74565ded361d93e1feb8a" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81bbeb29798b407ccd82a3324ade1a7286e0d29851475990b612670f6f5124d2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "devise" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50c7580b072f1c8476148f16e0a0d5dedddab787da98d86c5082c5e9ed8ab595" +dependencies = [ + "devise_codegen", + "devise_core", +] + +[[package]] +name = "devise_codegen" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "123c73e7a6e51b05c75fe1a1b2f4e241399ea5740ed810b0e3e6cacd9db5e7b2" +dependencies = [ + "devise_core", + "quote", +] + +[[package]] +name = "devise_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841ef46f4787d9097405cac4e70fb8644fc037b526e8c14054247c0263c400d0" +dependencies = [ + "bitflags 1.3.2", + "proc-macro2", + "proc-macro2-diagnostics", + "quote", + "syn", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +dependencies = [ + "block-buffer 0.10.3", + "crypto-common", + "subtle", +] + +[[package]] +name = "digest_auth" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa30657988b2ced88f68fe490889e739bf98d342916c33ed3100af1d6f1cbc9c" +dependencies = [ + "digest 0.9.0", + "hex", + "md-5", + "rand", + "sha2 0.9.9", +] + +[[package]] +name = "diqwest" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e5169a8000168e1ed2347ddd48be77530e1d976625008e89f9c3e4a35169d46" +dependencies = [ + "async-trait", + "digest_auth", + "reqwest", + "url", +] + +[[package]] +name = "either" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" + +[[package]] +name = "encoding_rs" +version = "0.8.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "env_logger" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +dependencies = [ + "humantime", + "is-terminal", + "log 0.4.17", + "regex", + "termcolor", +] + +[[package]] +name = "errno" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +dependencies = [ + "errno-dragonfly", + "libc", + "winapi", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "fastrand" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +dependencies = [ + "instant", +] + +[[package]] +name = "figment" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e56602b469b2201400dec66a66aec5a9b8761ee97cd1b8c96ab2483fcc16cc9" +dependencies = [ + "atomic", + "pear", + "serde", + "toml 0.5.11", + "uncased", + "version_check", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13e2792b0ff0340399d58445b88fd9770e3489eff258a4cbc1523418f12abf84" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" + +[[package]] +name = "futures-io" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" + +[[package]] +name = "futures-sink" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" + +[[package]] +name = "futures-task" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" + +[[package]] +name = "futures-util" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "gcc" +version = "0.3.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" + +[[package]] +name = "generator" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d266041a359dfa931b370ef684cceb84b166beb14f7f0421f4a6a3d0c446d12e" +dependencies = [ + "cc", + "libc", + "log 0.4.17", + "rustversion", + "windows", +] + +[[package]] +name = "generic-array" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "ghash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" +dependencies = [ + "opaque-debug", + "polyval", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "gpg-error" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89aaeddbfb92313378c58e98abadaaa34082b3855f1d455576eeeda08bd592c" +dependencies = [ + "libgpg-error-sys", +] + +[[package]] +name = "gpgme" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57539732fbe58eacdb984734b72b470ed0bca3ab7a49813271878567025ac44f" +dependencies = [ + "bitflags 1.3.2", + "cfg-if", + "conv", + "cstr-argument", + "gpg-error", + "gpgme-sys", + "libc", + "memoffset", + "once_cell", + "smallvec", + "static_assertions", +] + +[[package]] +name = "gpgme-sys" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "509223d659c06e4a26229437d6ac917723f02d31917c86c6ecd50e8369741cf7" +dependencies = [ + "build-rs", + "libc", + "libgpg-error-sys", + "system-deps", + "winreg", +] + +[[package]] +name = "h2" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hkdf" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.6", +] + +[[package]] +name = "http" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "hyper" +version = "0.14.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "winapi", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +dependencies = [ + "cxx", + "cxx-build", +] + +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "1.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +dependencies = [ + "autocfg", + "hashbrown", + "serde", +] + +[[package]] +name = "inlinable_string" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8fae54786f62fb2918dcfae3d568594e50eb9b5c25bf04371af6fe7516452fb" + +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1abeb7a0dd0f8181267ff8adc397075586500b81b28a73e8a0208b00fc170fb3" +dependencies = [ + "libc", + "windows-sys 0.45.0", +] + +[[package]] +name = "ipnet" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" + +[[package]] +name = "is-terminal" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0a45d56fe973d6db23972bf5bc46f988a4a2385deac9cc29572f09daef" +dependencies = [ + "hermit-abi 0.3.1", + "io-lifetimes", + "rustix", + "windows-sys 0.45.0", +] + +[[package]] +name = "itoa" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" + +[[package]] +name = "js-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "jwt" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6204285f77fe7d9784db3fdc449ecce1a0114927a51d5a41c4c7a292011c015f" +dependencies = [ + "base64 0.13.1", + "crypto-common", + "digest 0.10.6", + "hmac", + "serde", + "serde_json", + "sha2 0.10.6", +] + +[[package]] +name = "lazy_static" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.139" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" + +[[package]] +name = "libgpg-error-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c97079310f39c835d3bd73578379d040f779614bb331c7ffbb6630fee6420290" +dependencies = [ + "build-rs", + "system-deps", + "winreg", +] + +[[package]] +name = "liblmdb-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "feed38a3a580f60bf61aaa067b0ff4123395966839adeaf67258a9e50c4d2e49" +dependencies = [ + "gcc", + "libc", +] + +[[package]] +name = "link-cplusplus" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" +dependencies = [ + "cc", +] + +[[package]] +name = "linux-raw-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" + +[[package]] +name = "lmdb-rs" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4aefe7b433f795629ce42f35ccf7a620c38bd457238bfaa2489dafc7e36167e7" +dependencies = [ + "bitflags 0.7.0", + "libc", + "liblmdb-sys", + "log 0.3.9", +] + +[[package]] +name = "lock_api" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" +dependencies = [ + "log 0.4.17", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "loom" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls", + "serde", + "serde_json", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "md-5" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5a279bb9607f9f53c22d496eade00d138d1bdcccd07d74650387cf94942a15" +dependencies = [ + "block-buffer 0.9.0", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + +[[package]] +name = "mime" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" + +[[package]] +name = "mio" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" +dependencies = [ + "libc", + "log 0.4.17", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.42.0", +] + +[[package]] +name = "multer" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed4198ce7a4cbd2a57af78d28c6fbb57d81ac5f1d6ad79ac6c5587419cbdf22" +dependencies = [ + "bytes", + "encoding_rs", + "futures-util", + "http", + "httparse", + "log 0.4.17", + "memchr", + "mime", + "spin", + "tokio", + "tokio-util", + "version_check", +] + +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static 1.4.0", + "libc", + "log 0.4.17", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "nevmes_core" +version = "0.5.0-alpha" +dependencies = [ + "chrono", + "clap", + "diqwest", + "env_logger", + "gpgme", + "hex", + "hmac", + "jwt", + "lmdb-rs", + "log 0.4.17", + "rand", + "rand_core", + "reqwest", + "rocket", + "schedule_recv", + "serde", + "serde_json", + "sha2 0.10.6", + "tokio", +] + +[[package]] +name = "nevmes_market" +version = "0.5.0-alpha" +dependencies = [ + "chrono", + "env_logger", + "log 0.4.17", + "nevmes_core", + "rocket", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +dependencies = [ + "hermit-abi 0.2.6", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "openssl" +version = "0.10.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b102428fd03bc5edf97f62620f7298614c45cedf287c271e7ed450bbaf83f2e1" +dependencies = [ + "bitflags 1.3.2", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23bbbf7854cd45b83958ebe919f0e8e516793727652e27fda10a8384cfc790b7" +dependencies = [ + "autocfg", + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "os_str_bytes" +version = "6.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys 0.45.0", +] + +[[package]] +name = "pear" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15e44241c5e4c868e3eaa78b7c1848cadd6344ed4f54d029832d32b415a58702" +dependencies = [ + "inlinable_string", + "pear_codegen", + "yansi", +] + +[[package]] +name = "pear_codegen" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82a5ca643c2303ecb740d506539deba189e16f2754040a42901cd8105d0282d0" +dependencies = [ + "proc-macro2", + "proc-macro2-diagnostics", + "quote", + "syn", +] + +[[package]] +name = "percent-encoding" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" + +[[package]] +name = "polyval" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef234e08c11dfcb2e56f79fd70f6f2eb7f025c0ce2333e82f4f0518ecad30c6" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proc-macro2-diagnostics" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bf29726d67464d49fa6224a1d07936a8c08bb3fba727c7493f6cf1616fdaada" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "version_check", + "yansi", +] + +[[package]] +name = "quote" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "ref-cast" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c78fb8c9293bcd48ef6fce7b4ca950ceaf21210de6e105a883ee280c0f7b9ed" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f9c0c92af03644e4806106281fe2e068ac5bc0ae74a707266d06ea27bccee5f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "regex" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" + +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi", +] + +[[package]] +name = "reqwest" +version = "0.11.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21eed90ec8570952d53b772ecf8f206aa1ec9a3d76b2521c56c42973f2d91ee9" +dependencies = [ + "base64 0.21.0", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-tls", + "ipnet", + "js-sys", + "log 0.4.17", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + +[[package]] +name = "rocket" +version = "0.5.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98ead083fce4a405feb349cf09abdf64471c6077f14e0ce59364aa90d4b99317" +dependencies = [ + "async-stream", + "async-trait", + "atomic", + "atty", + "binascii", + "bytes", + "either", + "figment", + "futures", + "indexmap", + "log 0.4.17", + "memchr", + "multer", + "num_cpus", + "parking_lot", + "pin-project-lite", + "rand", + "ref-cast", + "rocket_codegen", + "rocket_http", + "serde", + "serde_json", + "state", + "tempfile", + "time 0.3.17", + "tokio", + "tokio-stream", + "tokio-util", + "ubyte", + "version_check", + "yansi", +] + +[[package]] +name = "rocket_codegen" +version = "0.5.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6aeb6bb9c61e9cd2c00d70ea267bf36f76a4cc615e5908b349c2f9d93999b47" +dependencies = [ + "devise", + "glob", + "indexmap", + "proc-macro2", + "quote", + "rocket_http", + "syn", + "unicode-xid", +] + +[[package]] +name = "rocket_http" +version = "0.5.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ded65d127954de3c12471630bf4b81a2792f065984461e65b91d0fdaafc17a2" +dependencies = [ + "cookie", + "either", + "futures", + "http", + "hyper", + "indexmap", + "log 0.4.17", + "memchr", + "pear", + "percent-encoding", + "pin-project-lite", + "ref-cast", + "serde", + "smallvec", + "stable-pattern", + "state", + "time 0.3.17", + "tokio", + "uncased", +] + +[[package]] +name = "rustix" +version = "0.36.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43abb88211988493c1abb44a70efa56ff0ce98f233b7b276146f1f3f7ba9644" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.45.0", +] + +[[package]] +name = "rustversion" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" + +[[package]] +name = "ryu" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" + +[[package]] +name = "schannel" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +dependencies = [ + "windows-sys 0.42.0", +] + +[[package]] +name = "schedule_recv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca1520cf9d3182329ceb57b9a6b37eb68fe94f5d46c0be4aa2d2a522ec3d40eb" +dependencies = [ + "lazy_static 0.2.11", +] + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "scratch" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2" + +[[package]] +name = "security-framework" +version = "2.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "serde" +version = "1.0.152" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.152" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.96" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93107647184f6027e3b7dcb2e11034cf95ffa1e3a682c67951963ac69c1c007d" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.6", +] + +[[package]] +name = "sharded-slab" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +dependencies = [ + "lazy_static 1.4.0", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "socket2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "spin" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dccf47db1b41fa1573ed27ccf5e08e3ca771cb994f776668c5ebda893b248fc" + +[[package]] +name = "stable-pattern" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4564168c00635f88eaed410d5efa8131afa8d8699a612c80c455a0ba05c21045" +dependencies = [ + "memchr", +] + +[[package]] +name = "state" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbe866e1e51e8260c9eed836a042a5e7f6726bb2b411dffeaa712e19c388f23b" +dependencies = [ + "loom", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "syn" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "system-deps" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5fa6fb9ee296c0dc2df41a656ca7948546d061958115ddb0bcaae43ad0d17d2" +dependencies = [ + "cfg-expr", + "heck", + "pkg-config", + "toml 0.7.4", + "version-compare", +] + +[[package]] +name = "target-lexicon" +version = "0.12.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd1ba337640d60c3e96bc6f0638a939b9c9a7f2c316a1598c279828b3d1dc8c5" + +[[package]] +name = "tempfile" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +dependencies = [ + "cfg-if", + "fastrand", + "libc", + "redox_syscall", + "remove_dir_all", + "winapi", +] + +[[package]] +name = "termcolor" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thread_local" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +dependencies = [ + "once_cell", +] + +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", +] + +[[package]] +name = "time" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" +dependencies = [ + "itoa", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" + +[[package]] +name = "time-macros" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2" +dependencies = [ + "time-core", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "1.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8e00990ebabbe4c14c08aca901caed183ecd5c09562a12c824bb53d3c3fd3af" +dependencies = [ + "autocfg", + "bytes", + "libc", + "memchr", + "mio", + "num_cpus", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.42.0", +] + +[[package]] +name = "tokio-macros" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "toml" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6135d499e69981f9ff0ef2167955a5333c35e36f6937d382974566b3d5b94ec" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +dependencies = [ + "lazy_static 1.4.0", + "log 0.4.17", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "ubyte" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c81f0dae7d286ad0d9366d7679a77934cfc3cf3a8d67e82669794412b2368fe6" +dependencies = [ + "serde", +] + +[[package]] +name = "uncased" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09b01702b0fd0b3fadcf98e098780badda8742d4f4a7676615cad90e8ac73622" +dependencies = [ + "serde", + "version_check", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" + +[[package]] +name = "unicode-ident" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "universal-hash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d3160b73c9a19f7e2939a2fdad446c57c1bbbbf4d919d3213ff1267a580d8b5" +dependencies = [ + "crypto-common", + "subtle", +] + +[[package]] +name = "url" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version-compare" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579a42fc0b8e0c63b76519a339be31bed574929511fa53c1a3acae26eb258f29" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log 0.4.17", + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +dependencies = [ + "bumpalo", + "log 0.4.17", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" + +[[package]] +name = "web-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1c4bd0a50ac6020f65184721f758dba47bb9fbc2133df715ec74a237b26794a" +dependencies = [ + "windows_aarch64_msvc 0.39.0", + "windows_i686_gnu 0.39.0", + "windows_i686_msvc 0.39.0", + "windows_x86_64_gnu 0.39.0", + "windows_x86_64_msvc 0.39.0", +] + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.1", + "windows_i686_gnu 0.42.1", + "windows_i686_msvc 0.42.1", + "windows_x86_64_gnu 0.42.1", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.1", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.1", + "windows_i686_gnu 0.42.1", + "windows_i686_msvc 0.42.1", + "windows_x86_64_gnu 0.42.1", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.1", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec7711666096bd4096ffa835238905bb33fb87267910e154b18b44eaabb340f2" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" + +[[package]] +name = "windows_i686_gnu" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "763fc57100a5f7042e3057e7e8d9bdd7860d330070251a73d003563a3bb49e1b" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" + +[[package]] +name = "windows_i686_msvc" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bc7cbfe58828921e10a9f446fcaaf649204dcfe6c1ddd712c5eebae6bda1106" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6868c165637d653ae1e8dc4d82c25d4f97dd6605eaa8d784b5c6e0ab2a252b65" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e4d40883ae9cae962787ca76ba76390ffa29214667a111db9e0a1ad8377e809" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" + +[[package]] +name = "winnow" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] + +[[package]] +name = "yansi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" diff --git a/nevmes-market/Cargo.toml b/nevmes-market/Cargo.toml new file mode 100755 index 0000000..4a64b1f --- /dev/null +++ b/nevmes-market/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "nevmes_market" +version = "0.5.0-alpha" +edition = "2021" +publish = false + +[dependencies] +chrono = "0.4.23" +env_logger = "0.10.0" +nevmes_core = { path = "../nevmes-core" } +log = "0.4" +rocket = { version = "0.5.0-rc.2", features = ["json"] } diff --git a/nevmes-market/LICENSE b/nevmes-market/LICENSE new file mode 100644 index 0000000..066cd31 --- /dev/null +++ b/nevmes-market/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 creating2morrow + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/nevmes-market/README.md b/nevmes-market/README.md new file mode 100755 index 0000000..e90dd43 --- /dev/null +++ b/nevmes-market/README.md @@ -0,0 +1,64 @@ +# nevmes-market + +## High-Level Order Lifecycle + +* vendor adds a new product with description and price +* customer orders product +* vendor creates order, multisig wallet and prepares it + +| | prepare | make | exchange | +|-- |-- |-- |-- | +|vend | X | | | +|cust | | | | +|med | | | | + +* customer saves prepare info from vendor, creates multisig wallet + +| | prepare | make | exchange | +|-- |-- |-- |-- | +|vend | X | | | +|cust | X | | | +|med | | | | + +* customer sends both prepare infos to mediator +* mediator creates multisig wallet, prepares and makes it + +| | prepare | make | exchange | +|-- |-- |-- |-- | +|vend | X | | | +|cust | X | | | +|med | X | X | | + +* customer makes multisig wallet and sends both outputs to vendor + +| | prepare | make | exchange | +|-- |-- |-- |-- | +|vend | X | | | +|cust | X | X | | +|med | X | X | | + +* vendor makes and calls to exchange multisig keys + +| | prepare | make | exchange | +|-- |-- |-- |-- | +|vend | X | X | X | +|cust | X | X | | +|med | X | X | | + +* customer sends output to mediator who then exchanges multisig keys + +| | prepare | make | exchange | +|-- |-- |-- |-- | +|vend | X | X | X | +|cust | X | X | X | +|med | X | X | X | + +* customer funds wallet and exports to vendor and mediator +* vendor and mediator import multisig info +* customer signs multisig txset and sends to mediator +* mediator requests tracking number from vendor +* mediator relase signed txset to vendor +* vendor signs and submits signed txset +* in case of dispute the mediator can sign multisig txset for customer refund + +Reference: https://resilience365.com/monero-multisig-how-to/ diff --git a/nevmes-market/curl.md b/nevmes-market/curl.md new file mode 100644 index 0000000..862cd0f --- /dev/null +++ b/nevmes-market/curl.md @@ -0,0 +1,75 @@ +# CURL / API docs + +```bash +# [GET] get the current monero-wallet-rpc version +curl http://127.0.0.1:8000/xmr/version + +# [POST] sign data (monero-wallet-rpc) +curl http://127.0.0.1:38083/json_rpc --digest -u user:pass -d '{"jsonrpc":"2.0","id":"0","method":"sign","params":{"data":"some data here"}}' -H 'Content-Type: application/json' + +# [POST] get addresses (monero-wallet-rpc) +curl http://127.0.0.1:38083/json_rpc --digest -u user:pass -d '{"jsonrpc":"2.0","id":"0","method":"get_address","params":{"account_index":0,"address_index":[0]}}' -H 'Content-Type: application/json' + +# [GET] login +# customer or vendor +# xmr address +# aid - auth id +# cvid - customer or vendor id (2nd api call finalizes login and creates it) +# data - random bytes to sign +# signature - generate signature with wallet private keys +curl http://127.0.0.1:8000/login/////CID + +# [GET] information +# customer or vendor +# xmr address +# customer or vendor id +curl http://127.0.0.1:8000/// -H 'token: ' + +# [PATCH] update +# customer or vendor URI +# - i32 +# - String +# - Enum => 0 - active, 1 - description, 2 - name, 3 - pgp +curl -iv -X PATCH http://127.0.0.1:8000///update -d '{"cid": "CID", "name": "", "pgp": "", "xmr_address": "" }' + +# [GET] +# create a new product +curl -iv http://127.0.0.1:8000/product//create -H 'token: ' + +# [GET] +# return all products for a vendor +curl -iv http://127.0.0.1:8000/products/ -H 'token: ' + +# [PATCH] update product +# - i32 +# - String +# - Enum => 0 - in_stock, 1 - description, 2 - name, 3 - price 4 - qty +curl -X PATCH http://127.0.0.1:8000/product//update/// -H 'token: ' + +# [GET] +# intialize an order for a customer +curl -iv http://127.0.0.1:8000/order//create/ -H 'token: ' + +# [GET] +# get all orders +# xmr address +# customer | vendor +curl -iv http://127.0.0.1:8000/orders// -H 'token: ' + +# [PATCH] +# modify order +# UpdateType::CustomerKex1 => 0, // make output from customer +# UpdateType::CustomerKex2 => 1, // use this for funding kex +# UpdateType::CustomerKex3 => 2, // might need this later? +# UpdateType::CustomerMultisigInfo => 3, // prepare output from customer +# UpdateType::Deliver => 4, // customer has received the item, released txset +# UpdateType::Hash => 5, // tx hash from funding the wallet order +# UpdateType::Ship => 6, // update ship date, app doesn't store tracking numbers +# UpdateType::Subaddress => 7, // update address for payout +# UpdateType::VendorKex1 => 8, // make output from vendor +# UpdateType::VendorKex2 => 9, // use this for funding kex +# UpdateType::VendorKex3 => 10, // might need this later? +# UpdateType::VendorMultisigInfo => 11, // prepare output from vendor +# UpdateType::Quantity => 12, // this can be updated until wallet is funded +curl -X PATCH http://127.0.0.1:8000/order//update//// -H 'token: ' +``` diff --git a/nevmes-market/src/controller.rs b/nevmes-market/src/controller.rs new file mode 100644 index 0000000..caa0531 --- /dev/null +++ b/nevmes-market/src/controller.rs @@ -0,0 +1,110 @@ +use rocket::http::Status; +use rocket::response::status::Custom; +use rocket::serde::json::Json; +use rocket::{get, patch, post}; + +use nevmes_core::*; + +use crate::{dispute, product}; + +// JSON APIs + +/// Create a product by passing vendor vid +#[post("/create", data = "")] +pub async fn create_product( + req_product: Json, + _token: auth::BearerToken, +) -> Custom> { + let m_product: models::Product = product::create(req_product); + Custom( + Status::Ok, + Json(m_product), + ) +} + +/// Update product information +#[patch("/<_address>/update", data="")] +pub async fn update_product( + _address: String, + product: Json, + _token: auth::BearerToken, +) -> Custom> { + let m_product: models::Product = product::modify(product); + Custom( + Status::Ok, + Json(m_product), + ) +} + +// /// Initialize order +// #[get("/
/create/")] +// pub async fn initialize_order( +// address: String, +// _token: auth::BearerToken, +// pid: String, +// ) -> Custom> { +// // get the cid from the address after verification +// let m_customer = customer::find(address).await; +// let temp_pid = String::from(&pid); +// let m_order: models::Order = order::create(m_customer.cid, temp_pid).await; +// Custom( +// Status::Ok, +// Json(reqres::GetOrderResponse::build(pid, m_order)), +// ) +// } + +// /// Update order information from vendor +// #[patch("/update////vendor")] +// pub async fn update_order( +// _address: String, +// oid: String, +// pid: String, +// _token: auth::BearerToken, +// data: String, +// ) -> Custom> { +// let temp_pid: String = String::from(&pid); +// let m_order: models::Order = order::modify(oid, pid, data, update_type).await; +// Custom( +// Status::Ok, +// Json(reqres::GetOrderResponse::build(temp_pid, m_order)), +// ) +// } + +// /// Get all orders +// /// by passing auth +// #[get("/
/")] +// pub async fn get_orders( +// address: String, +// corv: String, +// _token: auth::BearerToken, +// ) -> Custom> { +// let m_orders: Vec = order::find_all(address, corv).await; +// Custom(Status::Ok, Json(reqres::GetOrdersResponse::build(m_orders))) +// } + +/// Create a dispute +#[post("/create", data = "")] +pub async fn create_dispute( + dispute: Json, + _token: auth::BearerToken, +) -> Custom> { + let m_dispute: models::Dispute = dispute::create(dispute); + Custom( + Status::Ok, + Json(m_dispute), + ) +} + +/// Create a dispute +#[get("/")] +pub async fn get_dispute( + _token: auth::BearerToken, + did: String, +) -> Custom> { + let m_dispute: models::Dispute = dispute::find(&did); + Custom( + Status::Ok, + Json(m_dispute), + ) +} +// END JSON APIs diff --git a/nevmes-market/src/dispute.rs b/nevmes-market/src/dispute.rs new file mode 100644 index 0000000..b5183db --- /dev/null +++ b/nevmes-market/src/dispute.rs @@ -0,0 +1,31 @@ +use nevmes_core::{db, models::*, utils}; +use rocket::serde::json::Json; +use log::{debug, error, info}; + +/// Create a new dispute +pub fn create(d: Json) -> Dispute { + let f_did: String = format!("dispute{}", utils::generate_rnd()); + info!("create dispute: {}", &f_did); + let new_dispute = Dispute { + did: String::from(&f_did), + created: chrono::offset::Utc::now().timestamp(), + orid: String::from(&d.orid), + tx_set: String::from(&d.tx_set), + }; + debug!("insert dispute: {:?}", &d); + let s = db::Interface::open(); + let k = &d.did; + db::Interface::write(&s.env, &s.handle, k, &Dispute::to_db(&new_dispute)); + new_dispute +} + +/// Dispute lookup +pub fn find(did: &String) -> Dispute { + let s = db::Interface::open(); + let r = db::Interface::read(&s.env, &s.handle, &String::from(did)); + if r == utils::empty_string() { + error!("dispute not found"); + return Default::default() + } + Dispute::from_db(String::from(did), r) +} diff --git a/nevmes-market/src/lib.rs b/nevmes-market/src/lib.rs new file mode 100755 index 0000000..8d5cea4 --- /dev/null +++ b/nevmes-market/src/lib.rs @@ -0,0 +1,6 @@ +pub mod controller; // HTTP entry point +pub mod dispute; // Dispute repo/service layer +pub mod order; // Order repo/service layer +pub mod product; // Product repo/service layer + +// DO NOT EDIT BELOW THIS LINE diff --git a/nevmes-market/src/main.rs b/nevmes-market/src/main.rs new file mode 100755 index 0000000..3bba908 --- /dev/null +++ b/nevmes-market/src/main.rs @@ -0,0 +1,22 @@ +#[macro_use] +extern crate rocket; + +use nevmes_core::*; +use nevmes_market::*; + +// The only changes in here should be mounting new controller methods + +#[launch] +async fn rocket() -> _ { + let config = rocket::Config { + port: utils::get_app_market_port(), + ..rocket::Config::debug_default() + }; + env_logger::init(); + log::info!("nevmes-auth is online"); + rocket::custom(&config) + .mount("/dispute", routes![controller::create_dispute, controller::get_dispute]) + // .mount("/order", routes![controller::initialize_order, controller::update_order]) + // .mount("/orders", routes![controller::get_orders]) + .mount("/product", routes![controller::create_product, controller::update_product]) +} diff --git a/nevmes-market/src/order.rs b/nevmes-market/src/order.rs new file mode 100644 index 0000000..1c2e264 --- /dev/null +++ b/nevmes-market/src/order.rs @@ -0,0 +1,111 @@ +// use nevmes_core::*; +// use log::{debug, error, info}; +// use rocket::serde::json::Json; +// use crate::product; + +// enum StatusType { +// Delivered, +// MultisigMissing, +// MulitsigComplete, +// Shipped, +// } + +// impl StatusType { +// pub fn value(&self) -> String { +// match *self { +// StatusType::Delivered => String::from("Delivered"), +// StatusType::MultisigMissing => String::from("MultisigMissing"), +// StatusType::MulitsigComplete => String::from("MulitsigComplete"), +// StatusType::Shipped => String::from("Shipped"), +// } +// } +// } + + +// /// Create a skeleton for order +// pub fn create(cid: String, pid: String) -> models::Order { +// let ts = chrono::offset::Utc::now().timestamp(); +// let orid: String = format!("O{}", utils::generate_rnd()); +// let m_product: models::Product = product::find(&pid); +// let new_order = models::Order { +// orid, +// cid: String::from(&cid), +// pid: String::from(&pid), +// cust_kex_1: utils::empty_string(), +// cust_kex_2: utils::empty_string(), +// cust_kex_3: utils::empty_string(), +// cust_msig_make: utils::empty_string(), +// cust_msig_prepare: utils::empty_string(), +// cust_msig_txset: utils::empty_string(), +// date: 0, +// deliver_date: 0, +// hash: utils::empty_string(), +// mediator_kex_1: utils::empty_string(), +// mediator_kex_2: utils::empty_string(), +// mediator_kex_3: utils::empty_string(), +// mediator_msig_make: utils::empty_string(), +// mediator_msig_prepare: utils::empty_string(), +// ship_date: 0, +// subaddress: utils::empty_string(), +// status: utils::empty_string(), +// quantity: 0, +// vend_kex_1: utils::empty_string(), +// vend_kex_2: utils::empty_string(), +// vend_kex_3: utils::empty_string(), +// vend_msig_make: utils::empty_string(), +// vend_msig_prepare: utils::empty_string(), +// vend_msig_txset: utils::empty_string(), +// xmr_address: utils::empty_string(), +// }; +// debug!("insert order: {:?}", new_order); +// let m_wallet = monero::create_wallet(String::from(&orid), &utils::empty_string()).await; +// if !m_wallet { +// error!("error creating msig wallet for order {}", &orid); +// } +// debug!("insert order: {:?}", &new_order); +// let s = db::Interface::open(); +// let k = &new_order.orid; +// db::Interface::write(&s.env, &s.handle, k, &models::Order::to_db(&new_order)); +// // in order to retrieve all orders, write keys to with ol +// let list_key = format!("ol"); +// let r = db::Interface::read(&s.env, &s.handle, &String::from(&list_key)); +// if r == utils::empty_string() { +// debug!("creating order index"); +// } +// let order_list = [r, String::from(&orid)].join(","); +// debug!("writing order index {} for id: {}", order_list, list_key); +// db::Interface::write(&s.env, &s.handle, &String::from(list_key), &order_list); +// new_order +// } + + +// /// Lookup order +// pub fn find(oid: String) -> models::Order { +// let s = db::Interface::open(); +// let r = db::Interface::read(&s.env, &s.handle, &String::from(&oid)); +// if r == utils::empty_string() { +// error!("order not found"); +// return Default::default(); +// } +// models::Order::from_db(String::from(&oid), r) +// } + +// /// Lookup all orders for customer +// pub async fn find_all_customer_orders(cid: String) -> Vec { +// let i_s = db::Interface::open(); +// let i_list_key = format!("ol"); +// let i_r = db::Interface::read(&i_s.env, &i_s.handle, &String::from(i_list_key)); +// if i_r == utils::empty_string() { +// error!("order index not found"); +// } +// let i_v_oid = i_r.split(","); +// let i_v: Vec = i_v_oid.map(|s| String::from(s)).collect(); +// let mut orders: Vec = Vec::new(); +// for o in i_v { +// let order: models::Order = find(o); +// if order.orid != utils::empty_string() && order.cid == cid { +// orders.push(order); +// } +// } +// orders +// } diff --git a/nevmes-market/src/product.rs b/nevmes-market/src/product.rs new file mode 100644 index 0000000..5a2418f --- /dev/null +++ b/nevmes-market/src/product.rs @@ -0,0 +1,86 @@ +// Product repo/service layer +use nevmes_core::{db, models::*, utils}; +use log::{debug, error, info}; +use rocket::serde::json::Json; + +/// Create a new product +pub fn create(d: Json) -> Product { + let pid: String = format!("product{}", utils::generate_rnd()); + let new_product = Product { + pid: String::from(&pid), + description: String::from(&d.description), + image: d.image.iter().cloned().collect(), + in_stock: d.in_stock, + name: String::from(&d.name), + price: d.price, + qty: d.qty, + }; + debug!("insert product: {:?}", &new_product); + let s = db::Interface::open(); + let k = &new_product.pid; + db::Interface::write(&s.env, &s.handle, k, &Product::to_db(&new_product)); + // in order to retrieve all products, write keys to with pl + let list_key = format!("pl"); + let r = db::Interface::read(&s.env, &s.handle, &String::from(&list_key)); + if r == utils::empty_string() { + debug!("creating product index"); + } + let product_list = [r, String::from(&pid)].join(","); + debug!("writing product index {} for id: {}", product_list, list_key); + db::Interface::write(&s.env, &s.handle, &String::from(list_key), &product_list); + new_product +} + +/// Single Product lookup +pub fn find(pid: &String) -> Product { + let s = db::Interface::open(); + let r = db::Interface::read(&s.env, &s.handle, &String::from(pid)); + if r == utils::empty_string() { + error!("product not found"); + return Default::default(); + } + Product::from_db(String::from(pid), r) +} + +/// Product lookup for all +pub fn find_all() -> Vec { + let i_s = db::Interface::open(); + let i_list_key = format!("pl"); + let i_r = db::Interface::read(&i_s.env, &i_s.handle, &String::from(i_list_key)); + if i_r == utils::empty_string() { + error!("product index not found"); + } + let i_v_pid = i_r.split(","); + let i_v: Vec = i_v_pid.map(|s| String::from(s)).collect(); + let mut products: Vec = Vec::new(); + for p in i_v { + let product: Product = find(&p); + if product.pid != utils::empty_string() { + products.push(product); + } + } + products +} + +/// Modify product +pub fn modify(p: Json) -> Product { + info!("modify product: {}", &p.pid); + let f_prod: Product = find(&p.pid); + if f_prod.pid == utils::empty_string() { + error!("product not found"); + return Default::default(); + } + let u_prod = Product::update( + f_prod, + String::from(&p.description), + p.image.iter().cloned().collect(), + p.in_stock, + String::from(&p.description), + p.price, + p.qty, + ); + let s = db::Interface::open(); + db::Interface::delete(&s.env, &s.handle, &u_prod.pid); + db::Interface::write(&s.env, &s.handle, &u_prod.pid, &Product::to_db(&u_prod)); + return u_prod; +} diff --git a/scripts/build_all_and_run.sh b/scripts/build_all_and_run.sh index 722451d..4757646 100755 --- a/scripts/build_all_and_run.sh +++ b/scripts/build_all_and_run.sh @@ -3,5 +3,6 @@ cd nevmes-auth && cargo build cd ../nevmes-contact && cargo build cd ../nevmes-core && cargo build cd ../nevmes-gui && cargo build +cd ../nevmes-market && cargo build cd ../nevmes-message && cargo build cd ../ && RUST_LOG=debug cargo run $1 diff --git a/scripts/build_release.sh b/scripts/build_release.sh index 130df9f..0f2ce71 100755 --- a/scripts/build_release.sh +++ b/scripts/build_release.sh @@ -19,6 +19,8 @@ cd nevmes-auth && cargo build --release && cp target/release/nevmes_auth ../$LIN cd ../ cd nevmes-contact && cargo build --release && cp target/release/nevmes_contact ../$LINUX_OUTPUT_DIR cd ../ +cd nevmes-market && cargo build --release && cp target/release/nevmes_market ../$LINUX_OUTPUT_DIR +cd ../ cd nevmes-message && cargo build --release && cp target/release/nevmes_message ../$LINUX_OUTPUT_DIR cd ../ # make the bzip for linux diff --git a/scripts/cleanall.sh b/scripts/cleanall.sh index 44f7919..5c1178e 100755 --- a/scripts/cleanall.sh +++ b/scripts/cleanall.sh @@ -4,6 +4,7 @@ cd nevmes-auth && cargo clean cd ../nevmes-contact && cargo clean cd ../nevmes-core && cargo clean cd ../nevmes-gui && cargo clean +cd ../nevmes-market && cargo clean cd ../nevmes-message && cargo clean cd ../ && cargo clean rm -rf .build/ diff --git a/scripts/fmtall.sh b/scripts/fmtall.sh index 8798345..bee859c 100755 --- a/scripts/fmtall.sh +++ b/scripts/fmtall.sh @@ -4,5 +4,6 @@ cd nevmes-auth && cargo +nightly fmt cd ../nevmes-contact && cargo +nightly fmt cd ../nevmes-core && cargo +nightly fmt cd ../nevmes-gui && cargo +nightly fmt +cd ../nevmes-market && cargo +nightly fmt cd ../nevmes-message && cargo +nightly fmt cd ../ && cargo +nightly fmt diff --git a/src/controller.rs b/src/controller.rs index 49ac55a..097067a 100644 --- a/src/controller.rs +++ b/src/controller.rs @@ -6,21 +6,14 @@ use rocket::{ serde::json::Json, }; -use nevmes_core::{ - contact, - i2p, - message, - models, - monero, - proof, - reqres, -}; +use nevmes_core::*; +use nevmes_market::*; // JSON APIs exposed over i2p /// Get payment API version /// -/// Protected: false +/// Protected: true /// /// This also functions as a health check #[get("/version")] @@ -28,6 +21,21 @@ pub async fn get_version(_jwp: proof::PaymentProof) -> Custom Custom> { + let mut v: Vec = Vec::new(); + v.push("t1".to_string()); + v.push("t2".to_string()); + v.push("t3".to_string()); + let u: models::User = models::User { + uid: v.remove(0), + xmr_address: v.remove(0), + name: v.remove(0), + }; + Custom(Status::Ok, Json(u)) +} + + /// If i2p not in the state of rejecting tunnels this will return `open: true` /// /// Protected: false @@ -81,3 +89,20 @@ pub async fn gen_jwp(proof: Json) -> Custom> { let jwp = proof::create_jwp(&proof).await; Custom(Status::Ok, Json(reqres::Jwp { jwp })) } + +// NEVMES Market APIs +//----------------------------------------------- + +/// Get all products by passing vendor address +/// +/// Protected: true +#[get("/products")] +pub async fn get_products( + _jwp: proof::PaymentProof, +) -> Custom>> { + let m_products: Vec = product::find_all(); + Custom( + Status::Ok, + Json(m_products), + ) +} diff --git a/src/main.rs b/src/main.rs index 1c4ebdc..cb0db73 100644 --- a/src/main.rs +++ b/src/main.rs @@ -58,4 +58,6 @@ async fn rocket() -> _ { .mount("/share", routes![controller::share_contact_info]) .mount("/i2p", routes![controller::get_i2p_status]) .mount("/xmr/rpc", routes![controller::get_version]) + .mount("/market", routes![controller::get_products]) + .mount("/test", routes![controller::test]) }