-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: refactor crates and module structure
- Loading branch information
1 parent
8f4fc47
commit 929f5ca
Showing
20 changed files
with
1,435 additions
and
197 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,54 @@ | ||
[package] | ||
name = "bp-wallet" | ||
[workspace] | ||
members = ["std", "invoice", "psbt", "esplora", "."] | ||
exclude = ["legacy", "convert"] | ||
|
||
[workspace.package] | ||
version = "0.11.0" | ||
description = "Modern, minimalistic & standard-compliant cold wallet library" | ||
keywords = ["bitcoin", "wallet", "descriptor-wallet", "psbt", "taproot"] | ||
categories = ["cryptography::cryptocurrencies"] | ||
readme = "README.md" | ||
authors = ["Dr Maxim Orlovsky <orlovsky@lnp-bp.org>"] | ||
homepage = "https://lnp-bp.org" | ||
repository = "https://github.com/BP-WG/bp-wallet" | ||
rust-version = "1.60" # Due to rust-amplify | ||
edition = "2021" | ||
license = "Apache-2.0" | ||
|
||
[lib] | ||
name = "bp" | ||
|
||
[dependencies] | ||
[workspace.dependencies] | ||
amplify = "4.0.0" | ||
bitcoin_hashes = "0.12.0" | ||
bech32 = "0.9.1" | ||
bp-primitives = "0.10.6" | ||
serde_crate = { package = "serde", version = "1", features = ["derive"], optional = true } | ||
serde_crate = { package = "serde", version = "1", features = ["derive"] } | ||
|
||
[package] | ||
name = "bp-wallet" | ||
version = { workspace = true } | ||
description = "Modern, minimalistic & standard-compliant cold wallet library" | ||
keywords = { workspace = true } | ||
categories = { workspace = true } | ||
readme = "README.md" | ||
authors = { workspace = true } | ||
homepage = { workspace = true } | ||
repository = { workspace = true } | ||
rust-version = { workspace = true } | ||
edition = { workspace = true } | ||
license = { workspace = true } | ||
|
||
[lib] | ||
name = "bp" | ||
|
||
[[bin]] | ||
name = "bp" | ||
|
||
[dependencies] | ||
amplify = { workspace = true } | ||
bp-std = { path = "std" } | ||
serde_crate = { workspace = true, optional = true } | ||
|
||
[features] | ||
default = [] | ||
all = ["serde"] | ||
serde = ["serde_crate", "bp-primitives/serde"] | ||
serde = ["serde_crate", "bp-std/serde"] | ||
|
||
[patch.crates-io] | ||
bp-primitives = { git = "https://github.com/BP-WG/bp-core", branch = "primitives" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[package] | ||
name = "bp-invoice" | ||
version = { workspace = true } | ||
description = "Invoces with Bitcoin protocol" | ||
keywords = { workspace = true } | ||
categories = { workspace = true } | ||
readme = "../README.md" | ||
authors = { workspace = true } | ||
homepage = { workspace = true } | ||
repository = { workspace = true } | ||
rust-version = { workspace = true } | ||
edition = { workspace = true } | ||
license = { workspace = true } | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
pub fn add(left: usize, right: usize) -> usize { | ||
left + right | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
|
||
#[test] | ||
fn it_works() { | ||
let result = add(2, 2); | ||
assert_eq!(result, 4); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[package] | ||
name = "psbt" | ||
version = { workspace = true } | ||
description = "Modern, minimalistic & standard-compliant PSBT library" | ||
keywords = { workspace = true } | ||
categories = { workspace = true } | ||
readme = "../README.md" | ||
authors = { workspace = true } | ||
homepage = { workspace = true } | ||
repository = { workspace = true } | ||
rust-version = { workspace = true } | ||
edition = { workspace = true } | ||
license = { workspace = true } | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
pub fn add(left: usize, right: usize) -> usize { | ||
left + right | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
|
||
#[test] | ||
fn it_works() { | ||
let result = add(2, 2); | ||
assert_eq!(result, 4); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +0,0 @@ | ||
// Modern, minimalistic & standard-compliant cold wallet library. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
// Written in 2020-2023 by | ||
// Dr Maxim Orlovsky <orlovsky@lnp-bp.org> | ||
// | ||
// Copyright (C) 2020-2023 LNP/BP Standards Association. All rights reserved. | ||
// Copyright (C) 2020-2023 Dr Maxim Orlovsky. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#[macro_use] | ||
extern crate amplify; | ||
#[cfg(feature = "serde")] | ||
#[macro_use] | ||
extern crate serde_crate as serde; | ||
pub extern crate bitcoin_hashes as hashes; | ||
|
||
mod base58; | ||
mod index; | ||
mod path; | ||
mod key; | ||
mod xpub; | ||
mod descriptors; | ||
mod address; | ||
mod derive; | ||
mod chain; | ||
mod wallet; | ||
|
||
pub use address::{ | ||
Address, AddressNetwork, AddressParseError, AddressPayload, AddressType, PubkeyHash, | ||
ScriptHash, WPubkeyHash, WScriptHash, | ||
}; | ||
pub use bc::{secp256k1, *}; | ||
pub use chain::{AddrInfo, BlockInfo, MiningInfo, TxInInfo, TxInfo, TxOutInfo, TxStatus, UtxoInfo}; | ||
pub use derive::{Derive, DeriveCompr, DeriveXOnly}; | ||
pub use descriptors::TrKey; | ||
pub use index::{ | ||
DerivationIndex, HardenedIndex, Idx, IndexError, IndexParseError, NormalIndex, | ||
HARDENED_INDEX_BOUNDARY, | ||
}; | ||
pub use key::{ComprPubkey, LegacyPubkey, TaprootPubkey, UncomprPubkey}; | ||
pub use path::{DerivationParseError, DerivationPath}; | ||
pub use wallet::{Wallet, WalletCache, WalletData, WalletDescr}; | ||
pub use xpub::{Xpub, XpubDescriptor, XpubFp, XpubId, XpubMeta}; | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[package] | ||
name = "bp-std" | ||
version = { workspace = true } | ||
description = "Modern, minimalistic & standard-compliant cold wallet library" | ||
keywords = { workspace = true } | ||
categories = { workspace = true } | ||
readme = "../README.md" | ||
authors = { workspace = true } | ||
homepage = { workspace = true } | ||
repository = { workspace = true } | ||
rust-version = { workspace = true } | ||
edition = { workspace = true } | ||
license = { workspace = true } | ||
|
||
[lib] | ||
name = "bp" | ||
|
||
[dependencies] | ||
amplify = { workspace = true } | ||
bitcoin_hashes = "0.12.0" | ||
bech32 = { workspace = true } | ||
bp-primitives = { workspace = true } | ||
serde_crate = { workspace = true, optional = true } | ||
|
||
[features] | ||
default = [] | ||
all = ["serde"] | ||
serde = ["serde_crate", "bp-primitives/serde"] |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// Modern, minimalistic & standard-compliant cold wallet library. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
// Written in 2020-2023 by | ||
// Dr Maxim Orlovsky <orlovsky@lnp-bp.org> | ||
// | ||
// Copyright (C) 2020-2023 LNP/BP Standards Association. All rights reserved. | ||
// Copyright (C) 2020-2023 Dr Maxim Orlovsky. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#[macro_use] | ||
extern crate amplify; | ||
#[cfg(feature = "serde")] | ||
#[macro_use] | ||
extern crate serde_crate as serde; | ||
pub extern crate bitcoin_hashes as hashes; | ||
|
||
mod base58; | ||
mod index; | ||
mod path; | ||
mod key; | ||
mod xpub; | ||
mod descriptors; | ||
mod address; | ||
mod derive; | ||
mod chain; | ||
mod wallet; | ||
|
||
pub use address::{ | ||
Address, AddressNetwork, AddressParseError, AddressPayload, AddressType, PubkeyHash, | ||
ScriptHash, WPubkeyHash, WScriptHash, | ||
}; | ||
pub use bc::{secp256k1, *}; | ||
pub use chain::{AddrInfo, BlockInfo, MiningInfo, TxInInfo, TxInfo, TxOutInfo, TxStatus, UtxoInfo}; | ||
pub use derive::{Derive, DeriveCompr, DeriveXOnly}; | ||
pub use descriptors::TrKey; | ||
pub use index::{ | ||
DerivationIndex, HardenedIndex, Idx, IndexError, IndexParseError, NormalIndex, | ||
HARDENED_INDEX_BOUNDARY, | ||
}; | ||
pub use key::{ComprPubkey, LegacyPubkey, TaprootPubkey, UncomprPubkey}; | ||
pub use path::{DerivationParseError, DerivationPath}; | ||
pub use wallet::{Wallet, WalletCache, WalletData, WalletDescr}; | ||
pub use xpub::{Xpub, XpubDescriptor, XpubFp, XpubId, XpubMeta}; |
File renamed without changes.
File renamed without changes.
File renamed without changes.