This commit is contained in:
parent
08c8770942
commit
fca75cceec
@ -10,9 +10,9 @@ use ethers::types::{Address, U256};
|
||||
use std::str::FromStr;
|
||||
use cfg_if::cfg_if;
|
||||
|
||||
use crate::hero_vault::{keypair, symmetric, ethereum, kvs};
|
||||
use crate::hero_vault::kvs::{KVStore, DefaultStore};
|
||||
use crate::hero_vault::ethereum::prepare_function_arguments;
|
||||
use crate::vault::{keypair, symmetric, ethereum, kvs};
|
||||
use crate::vault::kvs::{KVStore, DefaultStore};
|
||||
use crate::vault::ethereum::prepare_function_arguments;
|
||||
|
||||
// Global Tokio runtime for blocking async operations
|
||||
static RUNTIME: Lazy<Mutex<Runtime>> = Lazy::new(|| {
|
||||
|
@ -157,4 +157,4 @@ The module supports multiple Ethereum networks, including:
|
||||
|
||||
## Examples
|
||||
|
||||
For examples of how to use the Hero Vault module, see the `examples/hero_vault` directory.
|
||||
For examples of how to use the Hero Vault module, see the `examples/vault` directory.
|
||||
|
@ -189,7 +189,7 @@ The module uses the `CryptoError` type for handling errors that can occur during
|
||||
|
||||
## Examples
|
||||
|
||||
For examples of how to use the Ethereum module, see the `examples/hero_vault` directory, particularly:
|
||||
For examples of how to use the Ethereum module, see the `examples/vault` directory, particularly:
|
||||
|
||||
- `contract_example.rhai` - Demonstrates loading a contract ABI and interacting with smart contracts
|
||||
- `agung_simple_transfer.rhai` - Shows how to perform a simple ETH transfer on the Agung network
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
use ethers::prelude::*;
|
||||
|
||||
use crate::hero_vault::error::CryptoError;
|
||||
use crate::vault::error::CryptoError;
|
||||
use super::networks;
|
||||
|
||||
/// Creates a provider for a specific network.
|
||||
|
@ -9,8 +9,8 @@ use tokio::runtime::Runtime;
|
||||
use ethers::types::Address;
|
||||
use std::str::FromStr;
|
||||
|
||||
use crate::hero_vault::error::CryptoError;
|
||||
use crate::hero_vault::kvs::{self, KVStore, DefaultStore};
|
||||
use crate::vault::error::CryptoError;
|
||||
use crate::vault::kvs::{self, KVStore, DefaultStore};
|
||||
use super::wallet::EthereumWallet;
|
||||
use super::networks;
|
||||
|
||||
@ -190,7 +190,7 @@ fn load_wallets() -> Vec<EthereumWallet> {
|
||||
/// Creates an Ethereum wallet from the currently selected keypair.
|
||||
pub fn create_ethereum_wallet() -> Result<EthereumWallet, CryptoError> {
|
||||
// Get the currently selected keypair
|
||||
let keypair = crate::hero_vault::keypair::get_selected_keypair()?;
|
||||
let keypair = crate::vault::keypair::get_selected_keypair()?;
|
||||
|
||||
// Create an Ethereum wallet from the keypair
|
||||
let wallet = EthereumWallet::from_keypair(&keypair)?;
|
||||
@ -206,7 +206,7 @@ pub fn create_ethereum_wallet() -> Result<EthereumWallet, CryptoError> {
|
||||
/// Creates an Ethereum wallet from a name and the currently selected keypair.
|
||||
pub fn create_ethereum_wallet_from_name(name: &str) -> Result<EthereumWallet, CryptoError> {
|
||||
// Get the currently selected keypair
|
||||
let keypair = crate::hero_vault::keypair::get_selected_keypair()?;
|
||||
let keypair = crate::vault::keypair::get_selected_keypair()?;
|
||||
|
||||
// Create an Ethereum wallet from the name and keypair
|
||||
let wallet = EthereumWallet::from_name_and_keypair(name, &keypair)?;
|
||||
|
@ -220,14 +220,14 @@ To include the Hero Vault Keypair module in your Rust project, add the following
|
||||
|
||||
```toml
|
||||
[dependencies]
|
||||
hero_vault = "0.1.0" # Replace with the actual version
|
||||
vault = "0.1.0" # Replace with the actual version
|
||||
```
|
||||
|
||||
Then, you can import and use the module in your Rust code:
|
||||
|
||||
```rust
|
||||
use hero_vault::vault::keypair::{KeySpace, KeyPair};
|
||||
use hero_vault::vault::error::CryptoError;
|
||||
use vault::vault::keypair::{KeySpace, KeyPair};
|
||||
use vault::vault::error::CryptoError;
|
||||
```
|
||||
|
||||
## Testing
|
||||
@ -263,7 +263,7 @@ The module uses the `CryptoError` type for handling errors that can occur during
|
||||
|
||||
## Examples
|
||||
|
||||
For examples of how to use the Keypair module, see the `examples/hero_vault` directory, particularly:
|
||||
For examples of how to use the Keypair module, see the `examples/vault` directory, particularly:
|
||||
|
||||
- `example.rhai` - Basic example demonstrating key management and signing
|
||||
- `advanced_example.rhai` - Advanced example with error handling
|
||||
|
@ -143,7 +143,7 @@ The module uses the `CryptoError` type for handling errors that can occur during
|
||||
|
||||
## Examples
|
||||
|
||||
For examples of how to use the KVS module, see the `examples/hero_vault` directory. While there may not be specific examples for the KVS module, the general pattern of usage is similar to the key space management examples.
|
||||
For examples of how to use the KVS module, see the `examples/vault` directory. While there may not be specific examples for the KVS module, the general pattern of usage is similar to the key space management examples.
|
||||
|
||||
A basic usage example:
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
//! IndexedDB-backed key-value store implementation for WebAssembly.
|
||||
|
||||
use crate::hero_vault::kvs::error::{KvsError, Result};
|
||||
use crate::vault::kvs::error::{KvsError, Result};
|
||||
use serde::{de::DeserializeOwned, Serialize};
|
||||
use std::sync::{Arc, Mutex};
|
||||
use cfg_if::cfg_if;
|
||||
|
@ -1,7 +1,7 @@
|
||||
//! Key space management functionality for KVStore
|
||||
|
||||
use crate::hero_vault::kvs::{KVStore, Result};
|
||||
use crate::hero_vault::{keypair, symmetric};
|
||||
use crate::vault::kvs::{KVStore, Result};
|
||||
use crate::vault::{keypair, symmetric};
|
||||
use std::path::PathBuf;
|
||||
|
||||
const KEY_SPACE_STORE_NAME: &str = "key-spaces";
|
||||
|
@ -1,6 +1,6 @@
|
||||
//! SlateDB-backed key-value store implementation.
|
||||
|
||||
use crate::hero_vault::kvs::error::{KvsError, Result};
|
||||
use crate::vault::kvs::error::{KvsError, Result};
|
||||
use std::path::PathBuf;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use serde::{de::DeserializeOwned, Serialize};
|
||||
|
@ -92,7 +92,7 @@ The module uses the `CryptoError` type for handling errors that can occur during
|
||||
|
||||
## Examples
|
||||
|
||||
For examples of how to use the Symmetric Encryption module, see the `examples/hero_vault` directory, particularly:
|
||||
For examples of how to use the Symmetric Encryption module, see the `examples/vault` directory, particularly:
|
||||
|
||||
- `example.rhai` - Basic example demonstrating symmetric encryption
|
||||
- `advanced_example.rhai` - Advanced example with error handling
|
||||
|
Loading…
Reference in New Issue
Block a user