pub trait ReplacePallet {
    // Required methods
    fn request_replace<'life0, 'life1, 'async_trait>(
        &'life0 self,
        vault_id: &'life1 VaultId,
        amount: u128
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn withdraw_replace<'life0, 'life1, 'async_trait>(
        &'life0 self,
        vault_id: &'life1 VaultId,
        amount: u128
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn accept_replace<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        new_vault: &'life1 VaultId,
        old_vault: &'life2 VaultId,
        amount_btc: u128,
        collateral: u128,
        btc_address: BtcAddress
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn execute_replace<'life0, 'life1, 'async_trait>(
        &'life0 self,
        replace_id: H256,
        raw_proof: &'life1 RawTransactionProof
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn cancel_replace<'life0, 'async_trait>(
        &'life0 self,
        replace_id: H256
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_new_vault_replace_requests<'life0, 'async_trait>(
        &'life0 self,
        account_id: AccountId
    ) -> Pin<Box<dyn Future<Output = Result<Vec<(H256, InterBtcReplaceRequest)>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_old_vault_replace_requests<'life0, 'async_trait>(
        &'life0 self,
        account_id: AccountId
    ) -> Pin<Box<dyn Future<Output = Result<Vec<(H256, InterBtcReplaceRequest)>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_replace_period<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_replace_request<'life0, 'async_trait>(
        &'life0 self,
        replace_id: H256
    ) -> Pin<Box<dyn Future<Output = Result<InterBtcReplaceRequest, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_replace_dust_amount<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<u128, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

source

fn request_replace<'life0, 'life1, 'async_trait>( &'life0 self, vault_id: &'life1 VaultId, amount: u128 ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Request the replacement of a new vault ownership

Arguments
  • &self - sender of the transaction
  • amount - amount of [Wrapped]
source

fn withdraw_replace<'life0, 'life1, 'async_trait>( &'life0 self, vault_id: &'life1 VaultId, amount: u128 ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Withdraw a request of vault replacement

Arguments
  • &self - sender of the transaction: the old vault
  • amount - the amount of [Wrapped] to replace
source

fn accept_replace<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, new_vault: &'life1 VaultId, old_vault: &'life2 VaultId, amount_btc: u128, collateral: u128, btc_address: BtcAddress ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Accept request of vault replacement

Arguments
  • &self - the initiator of the transaction: the new vault
  • old_vault - the vault to replace
  • amount_btc - the amount of [Wrapped] to replace
  • collateral - the collateral for replacement
  • btc_address - the address to send funds to
source

fn execute_replace<'life0, 'life1, 'async_trait>( &'life0 self, replace_id: H256, raw_proof: &'life1 RawTransactionProof ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Execute vault replacement

Arguments
  • &self - sender of the transaction: the old vault
  • replace_id - the ID of the replacement request
  • raw_proof - raw tx and proofs of coinbase and user tx
source

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

Cancel vault replacement

Arguments
  • &self - sender of the transaction: the new vault
  • replace_id - the ID of the replacement request
source

fn get_new_vault_replace_requests<'life0, 'async_trait>( &'life0 self, account_id: AccountId ) -> Pin<Box<dyn Future<Output = Result<Vec<(H256, InterBtcReplaceRequest)>, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Get all replace requests accepted by the given vault

source

fn get_old_vault_replace_requests<'life0, 'async_trait>( &'life0 self, account_id: AccountId ) -> Pin<Box<dyn Future<Output = Result<Vec<(H256, InterBtcReplaceRequest)>, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Get all replace requests made by the given vault

source

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

Get the time difference in number of blocks between when a replace request is created and required completion time by a vault

source

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

Get a replace request from storage

source

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

Gets the minimum btc amount for replace requests

Implementors§