sui_getMoveFunctionArgTypes{deprecated} - Sui

This method returns the argument types of a Move function on the SUI network. This is useful for understanding function signatures, building transaction calls, and validating inputs before execution.

This method is deprecated

Parameters

ParameterTypeRequiredDescription
packageObjectIDYesPackage object ID
modulestringYesModule name
functionstringYesFunction name

Request Example

cURL

bashcurl -X POST https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/ \
-H "Content-Type: application/json" \
-d '{
  "jsonrpc": "2.0",
  "id": "getblock.io",
  "method": "sui_getMoveFunctionArgTypes",
  "params": [
    "0xa0a7b108f5023b7356f2c6a4be6f058e267aae38e08260c7d519d8641897490c",
    "suifrens",
    "mint"
  ]
}'

request.js

javascriptconst axios = require('axios');

const payload = {
  jsonrpc: '2.0',
  id: 'getblock.io',
  method: 'sui_getMoveFunctionArgTypes',
  params: [
    '0xa0a7b108f5023b7356f2c6a4be6f058e267aae38e08260c7d519d8641897490c',
    'suifrens',
    'mint'
  ]
};

axios.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', payload)
.then(response => console.log(response.data));

request.py

pythonimport requests

payload = {
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "method": "sui_getMoveFunctionArgTypes",
    "params": [
        "0xa0a7b108f5023b7356f2c6a4be6f058e267aae38e08260c7d519d8641897490c",
        "suifrens",
        "mint"
    ]
}

response = requests.post("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/", json=payload)
print(response.json())

request.rs

rustuse reqwest::Client;
use serde_json::json;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    let payload = json!({
        "jsonrpc": "2.0",
        "id": "getblock.io",
        "method": "sui_getMoveFunctionArgTypes",
        "params": [
            "0xa0a7b108f5023b7356f2c6a4be6f058e267aae38e08260c7d519d8641897490c",
            "suifrens",
            "mint"
        ]
    });
    let response = client.post("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/")
        .json(&payload).send().await?;
    println!("{}", response.text().await?);
    Ok(())
}

Response Example

response.json

json{
  "jsonrpc": "2.0",
  "result": [
    "Pure",
    { "Object": "ByMutableReference" },
    { "Object": "ByValue" }
  ],
  "id": "getblock.io"
}

Response Parameters

ParameterTypeDescription
resultarrayArray of argument type descriptors

Argument Types

  • Pure - Primitive type (u8, u64, bool, address, vector, etc.)
  • Object: ByValue - Object passed by value (consumed)
  • Object: ByImmutableReference - Immutable object reference
  • Object: ByMutableReference - Mutable object reference

Use Cases

  • Build transaction calls programmatically
  • Validate function parameters
  • Generate type-safe SDK code
  • Document smart contract interfaces

Error Handling

Error CodeDescription
-32602Invalid params - invalid package/module/function
-32603Internal error - node issues
FunctionNotFoundFunction does not exist

SDK Integration

sdk.ts

typescriptimport { SuiClient } from '@mysten/sui/client';

const client = new SuiClient({ url: 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' });
const argTypes = await client.getMoveFunctionArgTypes({
  package: '0xa0a7b108f5023b7356f2c6a4be6f058e267aae38e08260c7d519d8641897490c',
  module: 'suifrens',
  function: 'mint'
});
console.log(argTypes);

sdk.rs

rustuse sui_sdk::SuiClientBuilder;

#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {
    let sui = SuiClientBuilder::default().build("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/").await?;
    let arg_types = sui.read_api().get_move_function_arg_types(
        "0xa0a7b108f5023b7356f2c6a4be6f058e267aae38e08260c7d519d8641897490c".parse()?,
        "suifrens",
        "mint"
    ).await?;
    println!("{:?}", arg_types);
    Ok(())
}