mirror of
https://github.com/RoboSats/taptrade-core.git
synced 2025-07-24 19:53:19 +00:00
coordinator wallet
This commit is contained in:
@ -25,6 +25,9 @@ async fn receive_order(
|
|||||||
// order.field2
|
// order.field2
|
||||||
// )
|
// )
|
||||||
|
|
||||||
|
// insert offer into sql database
|
||||||
|
// generate locking address for bond
|
||||||
|
|
||||||
println!("Coordinator received new offer: {:?}", order);
|
println!("Coordinator received new offer: {:?}", order);
|
||||||
Ok(Json(BondRequirementResponse {
|
Ok(Json(BondRequirementResponse {
|
||||||
bond_address: bond_address,
|
bond_address: bond_address,
|
||||||
|
@ -2,6 +2,8 @@ mod communication;
|
|||||||
mod coordinator;
|
mod coordinator;
|
||||||
|
|
||||||
use anyhow::{anyhow, Error, Result};
|
use anyhow::{anyhow, Error, Result};
|
||||||
|
use bdk::database::MemoryDatabase;
|
||||||
|
use bdk::Wallet;
|
||||||
use communication::api_server;
|
use communication::api_server;
|
||||||
use dotenv::dotenv;
|
use dotenv::dotenv;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
@ -12,6 +14,7 @@ use std::sync::Arc;
|
|||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct Coordinator {
|
pub struct Coordinator {
|
||||||
pub db_pool: Arc<Pool<Sqlite>>,
|
pub db_pool: Arc<Pool<Sqlite>>,
|
||||||
|
pub wallet: Arc<Wallet<MemoryDatabase>>, // using sqlite for Wallet?
|
||||||
}
|
}
|
||||||
|
|
||||||
// populate .env with values before starting
|
// populate .env with values before starting
|
||||||
@ -27,6 +30,7 @@ async fn main() -> Result<()> {
|
|||||||
|
|
||||||
let coordinator = Coordinator {
|
let coordinator = Coordinator {
|
||||||
db_pool: shared_db_pool,
|
db_pool: shared_db_pool,
|
||||||
|
wallet: // impl wallet
|
||||||
};
|
};
|
||||||
|
|
||||||
api_server(coordinator).await?;
|
api_server(coordinator).await?;
|
||||||
|
Reference in New Issue
Block a user