Function casper_contract::ext_ffi::casper_get_balance[][src]

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

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 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

  • purse_ptr - pointer in wasm memory to the bytes representing the URef of the purse to get the balance of
  • purse_size - size of the URef (in bytes)