snowbridge_outbound_queue_runtime_api/
lib.rs

1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: 2023 Snowfork <hello@snowfork.com>
3#![cfg_attr(not(feature = "std"), no_std)]
4
5use frame_support::traits::tokens::Balance as BalanceT;
6use snowbridge_core::{
7	outbound::{Command, Fee},
8	PricingParameters,
9};
10use snowbridge_outbound_queue_merkle_tree::MerkleProof;
11
12sp_api::decl_runtime_apis! {
13	pub trait OutboundQueueApi<Balance> where Balance: BalanceT
14	{
15		/// Generate a merkle proof for a committed message identified by `leaf_index`.
16		/// The merkle root is stored in the block header as a
17		/// `sp_runtime::generic::DigestItem::Other`
18		fn prove_message(leaf_index: u64) -> Option<MerkleProof>;
19
20		/// Calculate the delivery fee for `command`
21		fn calculate_fee(command: Command, parameters: Option<PricingParameters<Balance>>) -> Fee<Balance>;
22	}
23}