coordinator wallet

This commit is contained in:
f321x
2024-06-24 17:19:16 +00:00
parent ad58758e99
commit 55938c9ffc
2 changed files with 7 additions and 0 deletions

View File

@ -25,6 +25,9 @@ async fn receive_order(
// order.field2
// )
// insert offer into sql database
// generate locking address for bond
println!("Coordinator received new offer: {:?}", order);
Ok(Json(BondRequirementResponse {
bond_address: bond_address,

View File

@ -2,6 +2,8 @@ mod communication;
mod coordinator;
use anyhow::{anyhow, Error, Result};
use bdk::database::MemoryDatabase;
use bdk::Wallet;
use communication::api_server;
use dotenv::dotenv;
use serde::{Deserialize, Serialize};
@ -12,6 +14,7 @@ use std::sync::Arc;
#[derive(Clone, Debug)]
pub struct Coordinator {
pub db_pool: Arc<Pool<Sqlite>>,
pub wallet: Arc<Wallet<MemoryDatabase>>, // using sqlite for Wallet?
}
// populate .env with values before starting
@ -27,6 +30,7 @@ async fn main() -> Result<()> {
let coordinator = Coordinator {
db_pool: shared_db_pool,
wallet: // impl wallet
};
api_server(coordinator).await?;