get_tx_payment

Macro get_tx_payment 

Source
macro_rules! get_tx_payment {
    ($number:expr) => { ... };
}
Expand description

Get the asset_id or amount of the attached payment in the transaction

§Param

The function expects the order number of the attached payment as input

§Result

The result of execution is &[u8] for asset_id and i64 for amount

§Usage

use we_cdk::*;

#[action]
fn _constructor() {
    let payment: Payment = get_tx_payment!(0);
    let asset_id = payment.0;
    let amount = payment.1;
}