Function provwasm_std::withdraw_coins[][src]

pub fn withdraw_coins<S: Into<String>, H: Into<Addr>>(
    marker_denom: S,
    amount: u128,
    denom: S,
    recipient: H
) -> StdResult<CosmosMsg<ProvenanceMsg>>

Create a message that will withdraw coins from a marker account to a recipient account.

Example

// Imports required
use cosmwasm_std::{Addr, Response, StdResult};
use provwasm_std::{withdraw_coins, ProvenanceMsg};

// Create and dispatch a message that will withdraw coins from a marker.
fn try_withdraw_coins(
    marker_denom: String,
    amount: u128,
    denom: String,
    recipient: Addr,
) -> StdResult<Response<ProvenanceMsg>> {
    let msg = withdraw_coins(&marker_denom, amount, &denom, recipient)?;
    let mut res = Response::new();
    res.add_message(msg);
    Ok(res)
}