assess_custom_fee

Function assess_custom_fee 

Source
pub fn assess_custom_fee<S: Into<String>>(
    amount: Coin,
    name: Option<S>,
    from: Addr,
    recipient: Option<Addr>,
) -> Result<CosmosMsg<ProvenanceMsg>, StdError>
Expand description

Create a message that will assess a custom fee

ยงExample

use cosmwasm_std::{Addr, Coin, Response, StdError};
use provwasm_std::{assess_custom_fee, MsgFeesMsgParams, ProvenanceMsg};

fn try_assess_custom_fee(amount: Coin, name: Option<String>, from: Addr, recipient: Option<Addr>) -> Result<Response<ProvenanceMsg>, StdError>{
    let msg = assess_custom_fee(amount, name, from, recipient)?;
    let res = Response::new().add_message(msg);
    Ok(res)
}