deterministicFetch() can be used to query data from any blockchain RPC. This is often used to verify that an onchain action has taken place in order to continue MEM function logic. This way, MEM can be deployed alongside smart contracts from any chain as a way to compute with data that would be otherwise impossible or uneconomical to do inside the onchain contract itself.
Arweave
Retrieve tag names and values for a given transaction ID. Refer to the Arweave GraphQL guide and playground for documentation on other types of supported queries.
function.js
exportasyncfunctionhandle(state, action) {constinput=action.input;if (input.function ==="getArweaveTxData") {constres=awaitEXM.deterministicFetch("https://arweave.net/graphql", { method:"POST", headers: {"Content-Type":"application/json", }, body:JSON.stringify({ query:` { transactions(ids: ["G-1t0Lqysin897HC3IV8xu_Mr884B-Mo5YEnlhUH54k"]) { edges { node { id tags { name value } } } } } `, }), });state.data.push(res.asJSON()); }return { state };}