Modules — View Functions
Overview
Execute read-only Move view functions without submitting a transaction.
Endpoint
POST /v1/view
Movement-Specific Notes
- Provide the fully-qualified function
0x...::module::fn
.
Request
Body Schema
{
"function": "0x1::chain_id::get",
"type_arguments": [],
"arguments": []
}
Response
Success Response (200)
["0x..."]
Code Examples
TypeScript (Aptos SDK)
import { Aptos, AptosConfig, Network } from '@aptos-labs/ts-sdk';
const cfg = new AptosConfig({ network: Network.CUSTOM, fullnode: 'https://api-movement-mainnet.n.dwellir.com/YOUR_API_KEY/v1' });
const aptos = new Aptos(cfg);
const res = await aptos.view({ function: '0x1::chain_id::get', typeArguments: [], functionArguments: [] });
console.log(res);
Python
# Use aptos_sdk view helpers (or direct REST call)
cURL
curl -X POST https://api-movement-mainnet.n.dwellir.com/YOUR_API_KEY/v1/view \
-H "Content-Type: application/json" \
-d '{"function":"0x1::chain_id::get","type_arguments":[],"arguments":[]}'
EVM Equivalent
eth_call
for read-only EVM contract execution.