Wallet

Trait Wallet 

Source
pub trait Wallet<T: WalletStore + Send + Sync, C> {
Show 23 methods // Required methods fn create(info: WalletInfo<T>, config: C) -> Result<Self, Error> where Self: Sized; fn create_simulator(info: WalletInfo<T>, config: C) -> Result<Self, Error> where Self: Sized; fn name(&self) -> &str; fn sync<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn is_synced(&self) -> bool; fn wallet_info(&self) -> &WalletInfo<T>; fn wallet_store(&self) -> Arc<Mutex<T>>; fn create_spend_bundle<'life0, 'life1, 'async_trait>( &'life0 self, payments: Vec<AmountWithPuzzleHash>, input_coins: &'life1 [CoinRecord], change_puzzle_hash: Option<Bytes32>, allow_excess: bool, fee: i64, origin_id: Option<Bytes32>, solution_transformer: Option<Box<dyn Fn(Program) -> Program + Send + Sync + 'static>>, ) -> Pin<Box<dyn Future<Output = Result<SpendBundle, Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; // Provided methods fn require_derivation_paths(&self) -> bool { ... } fn puzzle_hashes<'life0, 'async_trait>( &'life0 self, start_index: usize, count: usize, hardened: bool, ) -> Pin<Box<dyn Future<Output = Result<Vec<Bytes32>, Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn puzzle_for_pk(&self, public_key: Bytes48) -> Result<Program, Error> { ... } fn puzzle_hash_for_pk(&self, public_key: Bytes48) -> Result<Bytes32, Error> { ... } fn make_solution( &self, primaries: &[AmountWithPuzzleHash], min_time: u64, coin_announcements: Option<HashSet<Bytes32>>, coin_announcements_to_assert: Option<HashSet<Bytes32>>, puzzle_announcements: Option<HashSet<Vec<u8>>>, puzzle_announcements_to_assert: Option<HashSet<Bytes32>>, fee: u64, ) -> Result<Program, Error> { ... } fn compute_memos( &self, spend_bundle: &SpendBundle, ) -> Result<HashMap<Bytes32, Vec<Vec<u8>>>, Error> { ... } fn puzzle_for_puzzle_hash<'life0, 'life1, 'async_trait>( &'life0 self, puz_hash: &'life1 Bytes32, ) -> Pin<Box<dyn Future<Output = Result<Program, Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn get_new_puzzle<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Program, Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn get_puzzle_hash<'life0, 'async_trait>( &'life0 self, new: bool, ) -> Pin<Box<dyn Future<Output = Result<Bytes32, Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn get_new_puzzlehash<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Bytes32, Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn convert_puzzle_hash<'life0, 'async_trait>( &'life0 self, puzzle_hash: Bytes32, ) -> Pin<Box<dyn Future<Output = Bytes32> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn generate_simple_signed_transaction<'life0, 'async_trait>( &'life0 self, mojos: u64, fee_mojos: u64, to_address: Bytes32, ) -> Pin<Box<dyn Future<Output = Result<TransactionRecord, Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn generate_simple_unsigned_transaction<'life0, 'async_trait>( &'life0 self, mojos: u64, fee_mojos: u64, to_address: Bytes32, ) -> Pin<Box<dyn Future<Output = Result<Vec<CoinSpend>, Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn generate_signed_transaction<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'async_trait>( &'life0 self, amount: u64, puzzle_hash: &'life1 Bytes32, fee: u64, origin_id: Option<Bytes32>, coins: Option<Vec<Coin>>, primaries: Option<&'life2 [AmountWithPuzzleHash]>, ignore_max_send_amount: bool, coin_announcements_to_consume: Option<&'life3 [Announcement]>, puzzle_announcements_to_consume: Option<&'life4 [Announcement]>, memos: Option<Vec<Vec<u8>>>, negative_change_allowed: bool, min_coin_amount: Option<u64>, max_coin_amount: Option<u64>, exclude_coin_amounts: Option<&'life5 [u64]>, exclude_coins: Option<&'life6 [Coin]>, reuse_puzhash: Option<bool>, ) -> Pin<Box<dyn Future<Output = Result<TransactionRecord, Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: 'async_trait, 'life6: 'async_trait { ... } fn generate_unsigned_transaction<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'async_trait>( &'life0 self, amount: u64, puzzle_hash: &'life1 Bytes32, fee: u64, origin_id: Option<Bytes32>, coins: Option<Vec<Coin>>, primaries: Option<&'life2 [AmountWithPuzzleHash]>, ignore_max_send_amount: bool, coin_announcements_to_consume: Option<&'life3 [Announcement]>, puzzle_announcements_to_consume: Option<&'life4 [Announcement]>, memos: Option<Vec<Vec<u8>>>, negative_change_allowed: bool, min_coin_amount: Option<u64>, max_coin_amount: Option<u64>, exclude_coin_amounts: Option<&'life5 [u64]>, exclude_coins: Option<&'life6 [Coin]>, reuse_puzhash: Option<bool>, ) -> Pin<Box<dyn Future<Output = Result<Vec<CoinSpend>, Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: 'async_trait, 'life6: 'async_trait { ... }
}

Required Methods§

Source

fn create(info: WalletInfo<T>, config: C) -> Result<Self, Error>
where Self: Sized,

Source

fn create_simulator(info: WalletInfo<T>, config: C) -> Result<Self, Error>
where Self: Sized,

Source

fn name(&self) -> &str

Source

fn sync<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn is_synced(&self) -> bool

Source

fn wallet_info(&self) -> &WalletInfo<T>

Source

fn wallet_store(&self) -> Arc<Mutex<T>>

Source

fn create_spend_bundle<'life0, 'life1, 'async_trait>( &'life0 self, payments: Vec<AmountWithPuzzleHash>, input_coins: &'life1 [CoinRecord], change_puzzle_hash: Option<Bytes32>, allow_excess: bool, fee: i64, origin_id: Option<Bytes32>, solution_transformer: Option<Box<dyn Fn(Program) -> Program + Send + Sync + 'static>>, ) -> Pin<Box<dyn Future<Output = Result<SpendBundle, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provided Methods§

Source

fn require_derivation_paths(&self) -> bool

Source

fn puzzle_hashes<'life0, 'async_trait>( &'life0 self, start_index: usize, count: usize, hardened: bool, ) -> Pin<Box<dyn Future<Output = Result<Vec<Bytes32>, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn puzzle_for_pk(&self, public_key: Bytes48) -> Result<Program, Error>

Source

fn puzzle_hash_for_pk(&self, public_key: Bytes48) -> Result<Bytes32, Error>

Source

fn make_solution( &self, primaries: &[AmountWithPuzzleHash], min_time: u64, coin_announcements: Option<HashSet<Bytes32>>, coin_announcements_to_assert: Option<HashSet<Bytes32>>, puzzle_announcements: Option<HashSet<Vec<u8>>>, puzzle_announcements_to_assert: Option<HashSet<Bytes32>>, fee: u64, ) -> Result<Program, Error>

Source

fn compute_memos( &self, spend_bundle: &SpendBundle, ) -> Result<HashMap<Bytes32, Vec<Vec<u8>>>, Error>

Source

fn puzzle_for_puzzle_hash<'life0, 'life1, 'async_trait>( &'life0 self, puz_hash: &'life1 Bytes32, ) -> Pin<Box<dyn Future<Output = Result<Program, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_new_puzzle<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Program, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn get_puzzle_hash<'life0, 'async_trait>( &'life0 self, new: bool, ) -> Pin<Box<dyn Future<Output = Result<Bytes32, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn get_new_puzzlehash<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Bytes32, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn convert_puzzle_hash<'life0, 'async_trait>( &'life0 self, puzzle_hash: Bytes32, ) -> Pin<Box<dyn Future<Output = Bytes32> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn generate_simple_signed_transaction<'life0, 'async_trait>( &'life0 self, mojos: u64, fee_mojos: u64, to_address: Bytes32, ) -> Pin<Box<dyn Future<Output = Result<TransactionRecord, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn generate_simple_unsigned_transaction<'life0, 'async_trait>( &'life0 self, mojos: u64, fee_mojos: u64, to_address: Bytes32, ) -> Pin<Box<dyn Future<Output = Result<Vec<CoinSpend>, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn generate_signed_transaction<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'async_trait>( &'life0 self, amount: u64, puzzle_hash: &'life1 Bytes32, fee: u64, origin_id: Option<Bytes32>, coins: Option<Vec<Coin>>, primaries: Option<&'life2 [AmountWithPuzzleHash]>, ignore_max_send_amount: bool, coin_announcements_to_consume: Option<&'life3 [Announcement]>, puzzle_announcements_to_consume: Option<&'life4 [Announcement]>, memos: Option<Vec<Vec<u8>>>, negative_change_allowed: bool, min_coin_amount: Option<u64>, max_coin_amount: Option<u64>, exclude_coin_amounts: Option<&'life5 [u64]>, exclude_coins: Option<&'life6 [Coin]>, reuse_puzhash: Option<bool>, ) -> Pin<Box<dyn Future<Output = Result<TransactionRecord, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: 'async_trait, 'life6: 'async_trait,

Source

fn generate_unsigned_transaction<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'async_trait>( &'life0 self, amount: u64, puzzle_hash: &'life1 Bytes32, fee: u64, origin_id: Option<Bytes32>, coins: Option<Vec<Coin>>, primaries: Option<&'life2 [AmountWithPuzzleHash]>, ignore_max_send_amount: bool, coin_announcements_to_consume: Option<&'life3 [Announcement]>, puzzle_announcements_to_consume: Option<&'life4 [Announcement]>, memos: Option<Vec<Vec<u8>>>, negative_change_allowed: bool, min_coin_amount: Option<u64>, max_coin_amount: Option<u64>, exclude_coin_amounts: Option<&'life5 [u64]>, exclude_coins: Option<&'life6 [Coin]>, reuse_puzhash: Option<bool>, ) -> Pin<Box<dyn Future<Output = Result<Vec<CoinSpend>, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: 'async_trait, 'life6: 'async_trait,

Implementors§