pub struct InterBtcParachain {
    pub native_currency_id: CurrencyId,
    pub relay_chain_currency_id: CurrencyId,
    pub wrapped_currency_id: CurrencyId,
    /* private fields */
}

Fields§

§native_currency_id: CurrencyId§relay_chain_currency_id: CurrencyId§wrapped_currency_id: CurrencyId

Implementations§

source§

impl InterBtcParachain

source

pub async fn new<P: RpcClientT>( rpc_client: P, signer: InterBtcSigner, shutdown_tx: ShutdownSender ) -> Result<Self, Error>

source

pub async fn from_url( url: &str, signer: InterBtcSigner, shutdown_tx: ShutdownSender ) -> Result<Self, Error>

source

pub async fn from_url_with_retry( url: &str, signer: InterBtcSigner, connection_timeout: Duration, shutdown_tx: ShutdownSender ) -> Result<Self, Error>

source

pub async fn from_url_and_config_with_retry( url: &str, signer: InterBtcSigner, max_concurrent_requests: Option<usize>, max_notifs_per_subscription: Option<usize>, connection_timeout: Duration, shutdown_tx: ShutdownSender ) -> Result<Self, Error>

source

pub async fn get_finalized_block_hash(&self) -> Result<H256, Error>

source

pub async fn on_block<F, R>(&self, on_block: F) -> Result<(), Error>where F: Fn(InterBtcHeader) -> R, R: Future<Output = Result<(), Error>>,

Subscribe to new parachain blocks.

source

pub async fn wait_for_block(&self, height: u32) -> Result<(), Error>

Wait for the block at the given height Note: will always wait at least one block.

source

pub async fn delay_for_blocks(&self, delay: u32) -> Result<(), Error>

Sleep for delay parachain blocks

source

pub async fn on_event_error<E: Fn(Error)>( &self, on_error: E ) -> Result<(), Error>

Subscription service that should listen forever, only returns if the initial subscription cannot be established. Calls on_error when an error event has been received, or when an event has been received that failed to be decoded into a raw event.

Arguments
  • on_error - callback for decoding errors, is not allowed to take too long
source

pub async fn on_event<T, F, R, E>( &self, on_event: F, on_error: E ) -> Result<(), Error>where T: StaticEvent + Debug, F: FnMut(T) -> R, R: Future<Output = ()>, E: Fn(Error),

Subscription service that should listen forever, only returns if the initial subscription cannot be established. This function uses two concurrent tasks: one for the event listener, and one that calls the given callback. This allows the callback to take a long time to complete without breaking the rpc communication, which could otherwise happen. Still, since the queue of callbacks is processed sequentially, some care should be taken that the queue does not overflow. on_error is called when the event has successfully been decoded into a raw_event, but failed to decode into an event of type T

Arguments
  • on_event - callback for events, is allowed to sometimes take a longer time
  • on_error - callback for decoding error, is not allowed to take too long
source

pub async fn store_assets_metadata(&self) -> Result<(), Error>

source

pub async fn store_lend_tokens(&self) -> Result<(), Error>

source

pub async fn listen_for_registered_assets(&self) -> Result<(), Error>

Cache registered assets and updates

source

pub async fn listen_for_lending_markets(&self) -> Result<(), Error>

Cache new markets and updates

source

pub async fn listen_for_fee_rate_changes(&self) -> Result<(), Error>

Listen to fee_rate changes and broadcast new values on the fee_rate_update_tx channel

Trait Implementations§

source§

impl BtcRelayPallet for InterBtcParachain

source§

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

Get the hash of the current best tip.

source§

fn get_best_block_height<'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 current best known height.

source§

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

Get the block hash for the main chain at the specified height.

Arguments
  • height - chain height
source§

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

Get the corresponding block header for the given hash.

Arguments
  • hash - little endian block hash
source§

fn get_bitcoin_confirmations<'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 global security parameter k for stable Bitcoin transactions

source§

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

Get the global security parameter for stable parachain confirmations

source§

fn wait_for_block_in_relay<'life0, 'async_trait>( &'life0 self, block_hash: H256Le, _btc_confirmations: Option<BlockNumber> ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Wait until Bitcoin block is submitted to the relay

source§

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

check that the block with the given block is included in the main chain of the relay, with sufficient confirmations

source§

fn initialize_btc_relay<'life0, 'async_trait>( &'life0 self, header: RawBlockHeader, height: BitcoinBlockHeight ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Initializes the relay with the provided block header and height, should be called automatically by relayer subject to the result of is_initialized.

Arguments
  • header - raw block header
  • height - starting height
source§

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

Stores a block header in the BTC-Relay.

Arguments
  • header - raw block header
source§

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

Stores multiple block headers in the BTC-Relay.

Arguments
  • headers - raw block headers
source§

impl Clone for InterBtcParachain

source§

fn clone(&self) -> InterBtcParachain

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl CollateralBalancesPallet for InterBtcParachain

source§

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

source§

fn get_free_balance_for_id<'life0, 'async_trait>( &'life0 self, id: AccountId, currency_id: CurrencyId ) -> Pin<Box<dyn Future<Output = Result<Balance, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

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

source§

fn get_reserved_balance_for_id<'life0, 'async_trait>( &'life0 self, id: AccountId, currency_id: CurrencyId ) -> Pin<Box<dyn Future<Output = Result<Balance, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

fn transfer_to<'life0, 'life1, 'async_trait>( &'life0 self, recipient: &'life1 AccountId, amounts: Vec<(u128, CurrencyId)> ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl FeePallet for InterBtcParachain

source§

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

source§

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

source§

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

source§

impl IssuePallet for InterBtcParachain

source§

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

Request a new issue
source§

fn execute_issue<'life0, 'life1, 'async_trait>( &'life0 self, issue_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 a issue request by providing a Bitcoin transaction inclusion proof
source§

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

Cancel an ongoing issue request
source§

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

source§

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

source§

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

source§

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

source§

impl OraclePallet for InterBtcParachain

source§

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

Returns the last exchange rate in planck per satoshis, the time at which it was set and the configured max delay.

source§

fn feed_values<'life0, 'async_trait>( &'life0 self, values: Vec<(OracleKey, FixedU128)> ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Sets the current exchange rate (i.e. DOT/BTC)

Arguments
  • value - the current exchange rate
source§

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

Sets the estimated Satoshis per bytes required to get a Bitcoin transaction included in in the next block (~10 min)

Arguments
  • value - the estimated fee rate
source§

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

Gets the estimated Satoshis per bytes required to get a Bitcoin transaction included in in the next x blocks

source§

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

Converts the amount in btc to dot, based on the current set exchange rate.

source§

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

Converts the amount in dot to btc, based on the current set exchange rate.

source§

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

source§

fn on_fee_rate_change(&self) -> FeeRateUpdateReceiver

source§

impl RedeemPallet for InterBtcParachain

source§

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

Request a new redeem
source§

fn execute_redeem<'life0, 'life1, 'async_trait>( &'life0 self, redeem_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 a redeem request by providing a Bitcoin transaction inclusion proof
source§

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

Cancel an ongoing redeem request
source§

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

source§

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

Get all redeem requests requested of the given vault
source§

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

source§

impl ReplacePallet for InterBtcParachain

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 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 Read more
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 Read more
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 Read more
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 Read more
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 Read more
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
source§

impl SecurityPallet for InterBtcParachain

source§

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

Gets the current active block number of the parachain

source§

impl SudoPallet for InterBtcParachain

source§

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

Set the global security parameter for stable parachain confirmations

source§

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

Set the global security parameter k for stable Bitcoin transactions

source§

fn insert_authorized_oracle<'life0, 'async_trait>( &'life0 self, account_id: AccountId, name: String ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Adds a new authorized oracle with the given name and the signer’s AccountId

Arguments
  • account_id - The Account ID of the new oracle
  • name - The name of the new oracle
source§

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

source§

fn set_storage<'life0, 'life1, 'life2, 'async_trait, V>( &'life0 self, module: &'life1 str, key: &'life2 str, value: V ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where V: 'async_trait + Encode + Send + Sync, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source§

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

source§

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

source§

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

source§

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

source§

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

source§

impl TimestampPallet for InterBtcParachain

source§

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

Get the current time as defined by the timestamp pallet.

source§

impl UtilFuncs for InterBtcParachain

source§

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

Gets the current height of the parachain
source§

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

source§

fn get_native_currency_id(&self) -> CurrencyId

Gets the ID of the native currency.
source§

fn get_account_id(&self) -> &AccountId

Get the address of the configured signer.
source§

fn is_this_vault(&self, vault_id: &VaultId) -> bool

source§

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

source§

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

source§

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

source§

impl VaultRegistryPallet for InterBtcParachain

source§

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

Fetch a specific vault by ID.

Arguments
  • vault_id - account ID of the vault
Errors
  • VaultNotFound - if the rpc returned a default value rather than the vault we want
  • VaultLiquidated - if the vault is liquidated
source§

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

Fetch all active vaults.

source§

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

Submit extrinsic to register a vault.

Arguments
  • collateral - deposit
  • public_key - Bitcoin public key
source§

fn deposit_collateral<'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,

Locks additional collateral as a security against stealing the Bitcoin locked with it.

Arguments
  • amount - the amount of extra collateral to lock
source§

fn withdraw_collateral<'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,

Withdraws amount of the collateral from the amount locked by the vault corresponding to the origin account The collateral left after withdrawal must be more than MinimumCollateralVault and above the SecureCollateralThreshold. Collateral that is currently being used to back issued tokens remains locked until the Vault is used for a redeem request (full release can take multiple redeem requests).

Arguments
  • amount - the amount of collateral to withdraw
source§

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

Update the default BTC public key for the vault corresponding to the signer.

Arguments
  • public_key - the new public key of the vault
source§

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

Custom RPC that calculates the exact collateral required to cover the BTC amount.

Arguments
  • amount_btc - amount of btc to cover
source§

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

Get the amount of collateral required for the given vault to be at the current SecureCollateralThreshold with the current exchange rate

source§

fn set_current_client_release<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, uri: &'life1 [u8], checksum: &'life2 H256 ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

For testing purposes only. Sets the current vault client release.

Arguments
  • uri - URI to the client release binary
  • checksum - The SHA256 checksum of the client binary
source§

fn set_pending_client_release<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, uri: &'life1 [u8], checksum: &'life2 H256 ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

For testing purposes only. Sets the pending vault client release.

Arguments
  • uri - URI to the client release binary
  • checksum - The SHA256 checksum of the client binary
source§

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

source§

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

source§

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

source§

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

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CheckedConversion for T

§

fn checked_from<T>(t: T) -> Option<Self>where Self: TryFrom<T>,

Convert from a value of T into an equivalent instance of Option<Self>. Read more
§

fn checked_into<T>(self) -> Option<T>where Self: TryInto<T>,

Consume self to return Some equivalent value of Option<T>. Read more
§

impl<T> Conv for T

§

fn conv<T>(self) -> Twhere Self: Into<T>,

Converts self into T using Into<T>. Read more
source§

impl<T> DynClone for Twhere T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
§

fn fmt_octal(self) -> FmtOctal<Self>where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
§

fn fmt_pointer(self) -> FmtPointer<Self>where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
§

fn fmt_list(self) -> FmtList<Self>where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,

§

fn from_ref(outer: &Outer) -> &T

Get a reference to the inner from the outer.

§

fn from_mut(outer: &mut Outer) -> &mut T

Get a mutable reference to the inner from the outer.

§

impl<T> Pipe for Twhere T: ?Sized,

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> Rwhere Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> Rwhere Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
§

fn pipe_deref_mut<'a, T, R>(&'a mut self, func: impl FnOnce(&'a mut T) -> R) -> Rwhere Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

impl<T> SaturatedConversion for T

§

fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,

Convert from a value of T into an equivalent instance of Self. Read more
§

fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,

Consume self to return an equivalent value of T. Read more
§

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Selfwhere Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,

§

fn unchecked_into(self) -> T

The counterpart to unchecked_from.
§

impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,

§

fn unique_saturated_into(self) -> T

Consume self to return an equivalent value of T.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
§

impl<T> JsonSchemaMaybe for T

§

impl<T> MaybeSend for Twhere T: Send,