Execute View Function of a Module

Execute the Move function with the given parameters and return its execution result.

This method will use 50 Compute Units.


Execute view function of a module

Execute the Move function with the given parameters and return its execution result.

The Aptos nodes prune account state history, via a configurable time window. If the requested ledger version has been pruned, the server responds with a 410.

POSThttps://mainnet.aptos.validationcloud.io/v1/<YOUR_API_KEY_HERE>/v1/view
Query parameters
Body
function*EntryFunctionId (string)

Entry function id is string representation of a entry function defined on-chain.

Format: {address}::{module name}::{function name}

Both module name and function name are case-sensitive.

Example: "0x1::aptos_coin::transfer"
type_arguments*array of MoveType (string)

Type arguments of the function

arguments*array of any

Arguments of the function

Response
Headers
Body
array of MoveValue (object)
Request
const response = await fetch('https://mainnet.aptos.validationcloud.io/v1/<YOUR_API_KEY_HERE>/v1/view', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "function": "0x1::aptos_coin::transfer",
      "type_arguments": [
        "text"
      ],
      "arguments": []
    }),
});
const data = await response.json();
Response
[]

Last updated