[][src]Function casperlabs_contract::ext_ffi::get_balance

pub unsafe extern "C" fn get_balance(
    purse_ptr: *const u8,
    purse_size: usize,
    result_size: *mut usize
) -> i32

This function uses the mint contract's balance function to get the balance of the specified purse. It causes a Trap if the bytes in wasm memory from purse_ptr to purse_ptr + purse_size cannot be de-serialized as a casperlabs_types::uref::URef. The return value is the size of the result in bytes. The result is copied to the host buffer and thus can be obtained by any function which copies the buffer into wasm memory (e.g. get_read). The result bytes are serialized from type Option<U512> and should be interpreted as such.

Arguments