Skip to main content

view

Use this function to call a View function on a Move Module.

import { view } from "~~/utils/scaffold-move/view";

const viewResult = await view(
{
module_address: module.address,
module_name: module.name,
function_name: fn.name,
ty_args: data.typeArgs,
function_args: data.args,
},
aptos,
);

This example calls the View function.

Parameters

ParameterTypeDescription
module_addressstringAddress of the module
module_namestringName of the module
function_namestringName of the function
ty_args (optional)string[]Type arguments
function_args (optional)string[]Input arguments for the view function

Return Value

Returns an array of Move values