Skip to content

Commit 34ced9c

Browse files
authored
Merge pull request #70 from diba-io/rgb-core-HT-api-changes
Embedded RGB fixes
2 parents 64d062f + 536c795 commit 34ced9c

15 files changed

+262
-353
lines changed

Cargo.lock

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+4-3
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,23 @@ web = []
2121

2222
[dependencies]
2323
anyhow = "1.0.44"
24+
base64 = { package = "base64-compat", version = "1.0.0" }
2425
bip39 = "1.0.1"
2526
bitcoin = "0.28.1"
2627
console_error_panic_hook = "0.1.6"
2728
descriptor-wallet = { version = "0.8.3", features = ["descriptors", "serde"] }
2829
directories = "4.0"
2930
futures = "0.3.17"
3031
getrandom = { version = "0.2.3", features = ["js"] }
31-
base64 = { package = "base64-compat", version = "1.0.0" }
32+
hex = "0.4.3"
3233
lazy_static = "1.4.0"
3334
log = "0.4.17"
3435
once_cell = "1.9.0"
3536
regex = "1"
3637
serde = "1.0.130"
3738
serde_json = "1.0.68"
3839
serde-encrypt = "0.7.0"
39-
tokio = { version = "1.20.1" }
40+
tokio = { version = "1.20.1", features = ["macros"] }
4041
pretty_env_logger = "0.4.0"
4142

4243
[target.'cfg(target_arch = "wasm32")'.dependencies]
@@ -85,4 +86,4 @@ strict_encoding = { version = "0.8.1", features = [
8586
wasm-bindgen-test = "0.3.13"
8687

8788
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
88-
tokio = { version = "1", features = ["full"] }
89+
tokio = { version = "1.20.1", features = ["full"] }

src/data/constants.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,11 @@ pub static NODE_SERVER_BASE_URL: Lazy<String> = Lazy::new(|| dot_env("NODE_SERVE
4444

4545
// Descriptor strings
4646
// For SATS
47-
pub const BTC_PATH: &str = "m/86h/1h/0h/0";
48-
pub const BTC_CHANGE_PATH: &str = "m/86h/1h/0h/1";
47+
pub const BTC_PATH: &str = "m/86h/1h/0h";
4948
// For TOKENS ---> that's provisional, it will be replace for RGB final guidelines
50-
pub const RGB_TOKENS_PATH: &str = "m/168h/20h/0h/0h";
49+
pub const RGB_ASSETS_PATH: &str = "m/168h/20h/0h";
5150
// For UDAS ---> that's provisional, it will be replace for RGB final guidelines
52-
pub const RGB_NFTS_PATH: &str = "m/168h/21h/0h/0h";
51+
pub const RGB_UDAS_PATH: &str = "m/168h/21h/0h";
5352

5453
pub static NETWORK: Lazy<RwLock<Network>> = Lazy::new(|| {
5554
RwLock::new(Network::Testnet) // TODO: Change default to mainnet

src/data/structs.rs

+20
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
use bitcoin::{util::address::Address, OutPoint, Txid};
22
use serde::{Deserialize, Serialize};
33

4+
#[derive(Serialize, Deserialize, Clone, Debug)]
5+
#[serde(rename_all = "camelCase")]
6+
pub struct VaultData {
7+
pub btc_descriptor: String,
8+
pub btc_change_descriptor: String,
9+
pub rgb_assets_descriptor: String,
10+
pub rgb_udas_descriptor: String,
11+
pub xpubkh: String,
12+
pub mnemonic: String,
13+
}
14+
15+
#[derive(Serialize, Deserialize, Clone, Debug)]
16+
pub struct FundVaultDetails {
17+
pub txid: String,
18+
pub assets: String,
19+
pub assets_change: String,
20+
pub udas: String,
21+
pub udas_change: String,
22+
}
23+
424
#[derive(Serialize, Deserialize, Debug, Clone)]
525
pub struct Issue {
626
pub id: String,

0 commit comments

Comments
 (0)