diff --git a/crates/sp_client/Cargo.toml b/crates/sp_client/Cargo.toml index 1a725bc..2155567 100644 --- a/crates/sp_client/Cargo.toml +++ b/crates/sp_client/Cargo.toml @@ -8,7 +8,7 @@ name = "sdk_client" crate-type = ["cdylib"] [dependencies] -sp_backend = { git = "https://github.com/Sosthene00/sp-backend", branch = "sp_client" } +sp_client= { git = "https://github.com/Sosthene00/sp-client", branch = "sp_client" } anyhow = "1.0" serde = { version = "1.0.188", features = ["derive"] } serde_json = "1.0" diff --git a/crates/sp_client/src/Prd_list.rs b/crates/sp_client/src/Prd_list.rs index e8e8185..9ed63d0 100644 --- a/crates/sp_client/src/Prd_list.rs +++ b/crates/sp_client/src/Prd_list.rs @@ -1,7 +1,7 @@ use serde::{Deserialize, Serialize}; use serde_json::{json, Value}; -use sp_backend::bitcoin::PublicKey; -//use sp_backend::silentpayments::sending::SilentPaymentAddress; +use sp_client::bitcoin::PublicKey; +//use sp_client::silentpayments::sending::SilentPaymentAddress; use std::marker::Copy; use tsify::Tsify; use wasm_bindgen::prelude::*; diff --git a/crates/sp_client/src/api.rs b/crates/sp_client/src/api.rs index 3182318..213a6b0 100644 --- a/crates/sp_client/src/api.rs +++ b/crates/sp_client/src/api.rs @@ -10,23 +10,23 @@ use anyhow::Error as AnyhowError; use sdk_common::crypto::AnkSharedSecret; use serde_json::Error as SerdeJsonError; use shamir::SecretData; -use sp_backend::bitcoin::consensus::{deserialize, serialize}; -use sp_backend::bitcoin::hex::{parse, DisplayHex, FromHex, HexToBytesError}; -use sp_backend::bitcoin::secp256k1::ecdh::SharedSecret; -use sp_backend::bitcoin::secp256k1::{PublicKey, SecretKey}; -use sp_backend::bitcoin::{OutPoint, Transaction, Txid}; -use sp_backend::silentpayments::Error as SpError; +use sp_client::bitcoin::consensus::{deserialize, serialize}; +use sp_client::bitcoin::hex::{parse, DisplayHex, FromHex, HexToBytesError}; +use sp_client::bitcoin::secp256k1::ecdh::SharedSecret; +use sp_client::bitcoin::secp256k1::{PublicKey, SecretKey}; +use sp_client::bitcoin::{OutPoint, Transaction, Txid}; +use sp_client::silentpayments::Error as SpError; use serde::{Deserialize, Serialize}; -use sp_backend::silentpayments::sending::SilentPaymentAddress; +use sp_client::silentpayments::sending::SilentPaymentAddress; use tsify::Tsify; use wasm_bindgen::convert::FromWasmAbi; use wasm_bindgen::prelude::*; use sdk_common::network::{AnkFlag, AnkNetworkMsg, NewTxMessage}; -use sp_backend::spclient::{derive_keys_from_seed, OutputList, OwnedOutput, SpClient}; -use sp_backend::spclient::{SpWallet, SpendKey}; +use sp_client::spclient::{derive_keys_from_seed, OutputList, OwnedOutput, SpClient}; +use sp_client::spclient::{SpWallet, SpendKey}; use crate::images; use crate::silentpayments::{check_transaction, create_transaction_for_address}; @@ -75,16 +75,16 @@ impl From for ApiError { } } -impl From for ApiError { - fn from(value: sp_backend::bitcoin::secp256k1::Error) -> Self { +impl From for ApiError { + fn from(value: sp_client::bitcoin::secp256k1::Error) -> Self { ApiError { message: value.to_string(), } } } -impl From for ApiError { - fn from(value: sp_backend::bitcoin::consensus::encode::Error) -> Self { +impl From for ApiError { + fn from(value: sp_client::bitcoin::consensus::encode::Error) -> Self { ApiError { message: value.to_string(), } diff --git a/crates/sp_client/src/images.rs b/crates/sp_client/src/images.rs index f0e11ee..f0e0698 100644 --- a/crates/sp_client/src/images.rs +++ b/crates/sp_client/src/images.rs @@ -1,7 +1,7 @@ use anyhow::{Error, Result}; use img_parts::{jpeg::Jpeg, Bytes, ImageEXIF}; use serde::{Deserialize, Serialize}; -use sp_backend::bitcoin::secp256k1::SecretKey; +use sp_client::bitcoin::secp256k1::SecretKey; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct BackUpImage(Vec); diff --git a/crates/sp_client/src/process.rs b/crates/sp_client/src/process.rs index 2e6af74..36e1c47 100644 --- a/crates/sp_client/src/process.rs +++ b/crates/sp_client/src/process.rs @@ -2,7 +2,7 @@ use std::fmt::DebugStruct; use serde::{Deserialize, Serialize}; use serde_json::{json, Value}; -use sp_backend::silentpayments::sending::SilentPaymentAddress; +use sp_client::silentpayments::sending::SilentPaymentAddress; use tsify::Tsify; use wasm_bindgen::prelude::*; diff --git a/crates/sp_client/src/silentpayments.rs b/crates/sp_client/src/silentpayments.rs index cee9658..a82f99e 100644 --- a/crates/sp_client/src/silentpayments.rs +++ b/crates/sp_client/src/silentpayments.rs @@ -3,13 +3,13 @@ use std::collections::HashMap; use anyhow::{Error, Result}; use rand::Rng; -use sp_backend::bitcoin::policy::DUST_RELAY_TX_FEE; -use sp_backend::bitcoin::secp256k1::ecdh::SharedSecret; -use sp_backend::bitcoin::{block, Amount, OutPoint}; -use sp_backend::silentpayments::sending::SilentPaymentAddress; -use sp_backend::silentpayments::utils::receiving::calculate_shared_secret; -use sp_backend::spclient::{OutputList, OwnedOutput, Recipient, SpClient}; -use sp_backend::{ +use sp_client::bitcoin::policy::DUST_RELAY_TX_FEE; +use sp_client::bitcoin::secp256k1::ecdh::SharedSecret; +use sp_client::bitcoin::{block, Amount, OutPoint}; +use sp_client::silentpayments::sending::SilentPaymentAddress; +use sp_client::silentpayments::utils::receiving::calculate_shared_secret; +use sp_client::spclient::{OutputList, OwnedOutput, Recipient, SpClient}; +use sp_client::{ bitcoin::{ secp256k1::{PublicKey, Scalar, XOnlyPublicKey}, Transaction, diff --git a/crates/sp_client/src/user.rs b/crates/sp_client/src/user.rs index d1720c1..30a0119 100644 --- a/crates/sp_client/src/user.rs +++ b/crates/sp_client/src/user.rs @@ -2,12 +2,12 @@ use anyhow::{Error, Result}; use rand::{self, thread_rng, Rng, RngCore}; use serde::{Deserialize, Serialize}; use serde_json::{json, Value}; -use sp_backend::bitcoin::hashes::Hash; -use sp_backend::bitcoin::hashes::HashEngine; -use sp_backend::bitcoin::hex::{DisplayHex, FromHex}; -use sp_backend::bitcoin::secp256k1::SecretKey; -use sp_backend::bitcoin::secp256k1::ThirtyTwoByteHash; -use sp_backend::spclient::SpClient; +use sp_client::bitcoin::hashes::Hash; +use sp_client::bitcoin::hashes::HashEngine; +use sp_client::bitcoin::hex::{DisplayHex, FromHex}; +use sp_client::bitcoin::secp256k1::SecretKey; +use sp_client::bitcoin::secp256k1::ThirtyTwoByteHash; +use sp_client::spclient::SpClient; use tsify::Tsify; use wasm_bindgen::prelude::*; @@ -18,11 +18,11 @@ use std::io::{Cursor, Read, Write}; use std::str::FromStr; use std::sync::{Mutex, MutexGuard, OnceLock}; -use sp_backend::bitcoin::secp256k1::constants::SECRET_KEY_SIZE; -use sp_backend::silentpayments::bitcoin_hashes::sha256; -use sp_backend::silentpayments::sending::SilentPaymentAddress; -use sp_backend::spclient::SpendKey; -use sp_backend::spclient::{OutputList, SpWallet}; +use sp_client::bitcoin::secp256k1::constants::SECRET_KEY_SIZE; +use sp_client::silentpayments::bitcoin_hashes::sha256; +use sp_client::silentpayments::sending::SilentPaymentAddress; +use sp_client::spclient::SpendKey; +use sp_client::spclient::{OutputList, SpWallet}; use crate::peers::Peer; use crate::user;