Update sp_backend to sp_client

This commit is contained in:
Sosthene00 2024-04-17 21:53:29 +02:00
parent 8f6918748d
commit 1ac419edb7
7 changed files with 36 additions and 36 deletions

View File

@ -8,7 +8,7 @@ name = "sdk_client"
crate-type = ["cdylib"] crate-type = ["cdylib"]
[dependencies] [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" anyhow = "1.0"
serde = { version = "1.0.188", features = ["derive"] } serde = { version = "1.0.188", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"

View File

@ -1,7 +1,7 @@
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use serde_json::{json, Value}; use serde_json::{json, Value};
use sp_backend::bitcoin::PublicKey; use sp_client::bitcoin::PublicKey;
//use sp_backend::silentpayments::sending::SilentPaymentAddress; //use sp_client::silentpayments::sending::SilentPaymentAddress;
use std::marker::Copy; use std::marker::Copy;
use tsify::Tsify; use tsify::Tsify;
use wasm_bindgen::prelude::*; use wasm_bindgen::prelude::*;

View File

@ -10,23 +10,23 @@ use anyhow::Error as AnyhowError;
use sdk_common::crypto::AnkSharedSecret; use sdk_common::crypto::AnkSharedSecret;
use serde_json::Error as SerdeJsonError; use serde_json::Error as SerdeJsonError;
use shamir::SecretData; use shamir::SecretData;
use sp_backend::bitcoin::consensus::{deserialize, serialize}; use sp_client::bitcoin::consensus::{deserialize, serialize};
use sp_backend::bitcoin::hex::{parse, DisplayHex, FromHex, HexToBytesError}; use sp_client::bitcoin::hex::{parse, DisplayHex, FromHex, HexToBytesError};
use sp_backend::bitcoin::secp256k1::ecdh::SharedSecret; use sp_client::bitcoin::secp256k1::ecdh::SharedSecret;
use sp_backend::bitcoin::secp256k1::{PublicKey, SecretKey}; use sp_client::bitcoin::secp256k1::{PublicKey, SecretKey};
use sp_backend::bitcoin::{OutPoint, Transaction, Txid}; use sp_client::bitcoin::{OutPoint, Transaction, Txid};
use sp_backend::silentpayments::Error as SpError; use sp_client::silentpayments::Error as SpError;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use sp_backend::silentpayments::sending::SilentPaymentAddress; use sp_client::silentpayments::sending::SilentPaymentAddress;
use tsify::Tsify; use tsify::Tsify;
use wasm_bindgen::convert::FromWasmAbi; use wasm_bindgen::convert::FromWasmAbi;
use wasm_bindgen::prelude::*; use wasm_bindgen::prelude::*;
use sdk_common::network::{AnkFlag, AnkNetworkMsg, NewTxMessage}; use sdk_common::network::{AnkFlag, AnkNetworkMsg, NewTxMessage};
use sp_backend::spclient::{derive_keys_from_seed, OutputList, OwnedOutput, SpClient}; use sp_client::spclient::{derive_keys_from_seed, OutputList, OwnedOutput, SpClient};
use sp_backend::spclient::{SpWallet, SpendKey}; use sp_client::spclient::{SpWallet, SpendKey};
use crate::images; use crate::images;
use crate::silentpayments::{check_transaction, create_transaction_for_address}; use crate::silentpayments::{check_transaction, create_transaction_for_address};
@ -75,16 +75,16 @@ impl From<HexToBytesError> for ApiError {
} }
} }
impl From<sp_backend::bitcoin::secp256k1::Error> for ApiError { impl From<sp_client::bitcoin::secp256k1::Error> for ApiError {
fn from(value: sp_backend::bitcoin::secp256k1::Error) -> Self { fn from(value: sp_client::bitcoin::secp256k1::Error) -> Self {
ApiError { ApiError {
message: value.to_string(), message: value.to_string(),
} }
} }
} }
impl From<sp_backend::bitcoin::consensus::encode::Error> for ApiError { impl From<sp_client::bitcoin::consensus::encode::Error> for ApiError {
fn from(value: sp_backend::bitcoin::consensus::encode::Error) -> Self { fn from(value: sp_client::bitcoin::consensus::encode::Error) -> Self {
ApiError { ApiError {
message: value.to_string(), message: value.to_string(),
} }

View File

@ -1,7 +1,7 @@
use anyhow::{Error, Result}; use anyhow::{Error, Result};
use img_parts::{jpeg::Jpeg, Bytes, ImageEXIF}; use img_parts::{jpeg::Jpeg, Bytes, ImageEXIF};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use sp_backend::bitcoin::secp256k1::SecretKey; use sp_client::bitcoin::secp256k1::SecretKey;
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BackUpImage(Vec<u8>); pub struct BackUpImage(Vec<u8>);

View File

@ -2,7 +2,7 @@ use std::fmt::DebugStruct;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use serde_json::{json, Value}; use serde_json::{json, Value};
use sp_backend::silentpayments::sending::SilentPaymentAddress; use sp_client::silentpayments::sending::SilentPaymentAddress;
use tsify::Tsify; use tsify::Tsify;
use wasm_bindgen::prelude::*; use wasm_bindgen::prelude::*;

View File

@ -3,13 +3,13 @@ use std::collections::HashMap;
use anyhow::{Error, Result}; use anyhow::{Error, Result};
use rand::Rng; use rand::Rng;
use sp_backend::bitcoin::policy::DUST_RELAY_TX_FEE; use sp_client::bitcoin::policy::DUST_RELAY_TX_FEE;
use sp_backend::bitcoin::secp256k1::ecdh::SharedSecret; use sp_client::bitcoin::secp256k1::ecdh::SharedSecret;
use sp_backend::bitcoin::{block, Amount, OutPoint}; use sp_client::bitcoin::{block, Amount, OutPoint};
use sp_backend::silentpayments::sending::SilentPaymentAddress; use sp_client::silentpayments::sending::SilentPaymentAddress;
use sp_backend::silentpayments::utils::receiving::calculate_shared_secret; use sp_client::silentpayments::utils::receiving::calculate_shared_secret;
use sp_backend::spclient::{OutputList, OwnedOutput, Recipient, SpClient}; use sp_client::spclient::{OutputList, OwnedOutput, Recipient, SpClient};
use sp_backend::{ use sp_client::{
bitcoin::{ bitcoin::{
secp256k1::{PublicKey, Scalar, XOnlyPublicKey}, secp256k1::{PublicKey, Scalar, XOnlyPublicKey},
Transaction, Transaction,

View File

@ -2,12 +2,12 @@ use anyhow::{Error, Result};
use rand::{self, thread_rng, Rng, RngCore}; use rand::{self, thread_rng, Rng, RngCore};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use serde_json::{json, Value}; use serde_json::{json, Value};
use sp_backend::bitcoin::hashes::Hash; use sp_client::bitcoin::hashes::Hash;
use sp_backend::bitcoin::hashes::HashEngine; use sp_client::bitcoin::hashes::HashEngine;
use sp_backend::bitcoin::hex::{DisplayHex, FromHex}; use sp_client::bitcoin::hex::{DisplayHex, FromHex};
use sp_backend::bitcoin::secp256k1::SecretKey; use sp_client::bitcoin::secp256k1::SecretKey;
use sp_backend::bitcoin::secp256k1::ThirtyTwoByteHash; use sp_client::bitcoin::secp256k1::ThirtyTwoByteHash;
use sp_backend::spclient::SpClient; use sp_client::spclient::SpClient;
use tsify::Tsify; use tsify::Tsify;
use wasm_bindgen::prelude::*; use wasm_bindgen::prelude::*;
@ -18,11 +18,11 @@ use std::io::{Cursor, Read, Write};
use std::str::FromStr; use std::str::FromStr;
use std::sync::{Mutex, MutexGuard, OnceLock}; use std::sync::{Mutex, MutexGuard, OnceLock};
use sp_backend::bitcoin::secp256k1::constants::SECRET_KEY_SIZE; use sp_client::bitcoin::secp256k1::constants::SECRET_KEY_SIZE;
use sp_backend::silentpayments::bitcoin_hashes::sha256; use sp_client::silentpayments::bitcoin_hashes::sha256;
use sp_backend::silentpayments::sending::SilentPaymentAddress; use sp_client::silentpayments::sending::SilentPaymentAddress;
use sp_backend::spclient::SpendKey; use sp_client::spclient::SpendKey;
use sp_backend::spclient::{OutputList, SpWallet}; use sp_client::spclient::{OutputList, SpWallet};
use crate::peers::Peer; use crate::peers::Peer;
use crate::user; use crate::user;