ViewService

interface ViewService

Typed view calls and explicit raw JSON access.

Functions

Link copied to clipboard
abstract suspend fun call(function: String, typeArguments: List<TypeTag> = emptyList(), arguments: List<MoveArgument> = emptyList(), ledgerVersion: ULong? = null): AptosResult<MoveViewResult>

ABI-validated arguments encoded as BCS. JSON response values remain lossless.

Link copied to clipboard
open suspend fun callOf(function: String, vararg arguments: Any?): AptosResult<MoveViewResult>

Concise ABI-validated view call accepting vararg arguments inferred as MoveArguments.

open suspend fun callOf(function: String, typeArguments: List<TypeTag>, vararg arguments: Any?): AptosResult<MoveViewResult>

Concise ABI-validated view call with type arguments and vararg arguments.

Link copied to clipboard
@JvmName(name = "callOfReified")
inline suspend fun <T1> ViewService.callOf(function: String, vararg arguments: Any?): AptosResult<MoveViewResult>

Concise ABI-validated view call inferring a single type argument from T1.

@JvmName(name = "callOfStrings")
suspend fun ViewService.callOf(function: String, typeArguments: List<String>, vararg arguments: Any?): AptosResult<MoveViewResult>

Concise ABI-validated view call with string type arguments and vararg arguments.

Link copied to clipboard
abstract suspend fun callRaw(function: String, typeArguments: List<String> = emptyList(), arguments: List<JsonElement> = emptyList(), ledgerVersion: ULong? = null): AptosResult<MoveViewResult>

Sends JSON as supplied, without ABI validation. The fullnode validates raw argument semantics. Calls function at an optional historical ledgerVersion and preserves JSON return values.