MEM
WebsiteLabsGuides
  • โš—๏ธMolecular Execution Machine
  • ๐Ÿ‘‹Introduction
    • What is MEM?
    • MEM features
    • MEM vs alternatives
    • Technical architecture
    • Use-case examples
  • โšกQuickstart
    • Quickstart guide
  • ๐Ÿ“–MEM Specifications
    • Function syntax
    • Function specs
    • Transaction specs
    • Supported languages
    • About MIPs
  • โš›๏ธMolecules
    • Overview
    • Multichain authentication
    • Using APIs
    • API reference
  • ๐ŸงชMEM IDE
    • Overview
    • Function ABI
  • โš’๏ธMEM Carbon Testnet
    • Overview
    • Deploy to testnet
    • Interact with testnet functions
  • โš™๏ธMEM SDK
    • SDK Usage
  • ๐Ÿ–ฅ๏ธMEM CLI
    • Function deployment
    • Function interaction
  • ๐Ÿ—๏ธMEM API
    • Overview
    • Write operations
    • Read operations
  • โš›๏ธ3EM-MEM
    • Overview
    • EXM API
    • Key-Value Storage (KVS)
  • ๐ŸงฉExamples
    • Pastebin clone
    • Query onchain data
Powered by GitBook

mem.tech ยฉ 2023

On this page
  • Using curl
  • Using Axios
  1. MEM API

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);
  }
}
PreviousWrite operationsNextOverview

Last updated 1 year ago

๐Ÿ—๏ธ