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

post

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.

Query parameters
ledger_versionstring · uint64Optional

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.

Example: 32425224034
Body

View request for the Move View Function API

functionstringRequired

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_argumentsstring[]Required

Type arguments of the function

Responses
post
/view
POST /v1/<YOUR_API_KEY_HERE>/v1/view HTTP/1.1
Host: mainnet.aptos.validationcloud.io/v1/<YOUR_API_KEY_HERE>/v1
Content-Type: application/json
Accept: */*
Content-Length: 81

{
  "function": "0x1::aptos_coin::transfer",
  "type_arguments": [
    "text"
  ],
  "arguments": []
}
[
  1
]

Last updated

Was this helpful?