NAC_Blockchain/nac-sdk/src/lib.rs

68 lines
1.8 KiB
Rust
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*!
# NAC SDK v2.0 - Native Rust Implementation
NAC (NewAssetChain) SDK是为RWA真实世界资产区块链设计的原生Rust SDK。
## 核心特性
- ✅ **NAC原生设计**完全遵循NAC核心原则不使用以太坡标准
- ✅ **高性能**Rust实现零成本抽象
- ✅ **类型安全**:强类型系统,编译时错误检查
- ✅ **NRPC3.0协议**支持NAC原生RPC协议
- ✅ **Blake3哈希**使用Blake3作为统一哈希算法
- ✅ **宪法层验证**内置Constitutional Receipt验证
- ✅ **WASM支持**可编译为WASM在浏览器中运行
*/
// 重新导出NAC_UDM的核心类型
pub use nac_udm::primitives::*;
pub use nac_udm::l1_protocol::acc::*;
// 使用具体导入避免RiskLevel冲突
pub use nac_udm::l1_protocol::gnacs::{AssetCategory, Jurisdiction, ComplianceLevel, GNACSCode};
pub use nac_udm::l1_protocol::cbpp::ConstitutionalReceipt;
// 模块声明
pub mod client;
pub mod crypto;
pub mod protocols;
pub mod types;
pub mod utils;
pub mod error;
// pub mod advanced; // Phase 10高级功能待与NRPC3Client集成
// 重新导出常用类型和函数
pub use client::NRPC3Client;
pub use crypto::{Blake3Hasher, AssetDNA, GNACSEncoder};
pub use protocols::ACC20;
// 待实现的协议将在Phase 7完成
// pub use protocols::{ACC721, ACC1155, XTZH};
// - ACC721: NAC原生NFT协议
// - ACC1155: NAC多代币标准
// - XTZH: 稳定币协议
pub use error::{NACError, Result};
/// NAC SDK版本
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
/// NAC SDK名称
pub const NAME: &str = env!("CARGO_PKG_NAME");
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_version() {
assert_eq!(VERSION, "2.0.0");
}
#[test]
fn test_name() {
assert_eq!(NAME, "nac-sdk");
}
}
// 导出适配器模块
pub mod adapters;