Read operations

Read a MEM function state

MEM functions are stateful. To read the state, you can simply make a GET request to the base API endpoint.

Using curl

curl -X GET "https://api.mem.tech/api/state/:function_id"

Using Axios

async function readState() {
  try {
    const function_id = "...";
    const base_endpoint = "https://api.mem.tech/api/state";

    const state = (await axios.get(`${base_endpoint}/${function_id}`))?.data;
    console.log(state);

    return state;
  } catch (error) {
    console.log(error);
  }
}

Last updated

mem.tech ยฉ 2023