sui_getNormalizedMoveModulesByPackage - Sui

Example code for the sui_getNormalizedMoveModulesByPackage JSON-RPC method. Complete guide on how to use sui_getNormalizedMoveModulesByPackage JSON-RPC in GetBlock Web3 documentation.

This method returns all modules in a Move package on the SUI network. This provides a complete view of a package's module structure and is useful for package analysis and documentation.

Parameters

Parameter
Type
Required
Description

package

ObjectID

Yes

Package object ID

Request Example

curl -X POST https://go.getblock.io/<ACCESS-TOKEN>/ \
-H "Content-Type: application/json" \
-d '{
  "jsonrpc": "2.0",
  "id": "getblock.io",
  "method": "sui_getNormalizedMoveModulesByPackage",
  "params": ["0x61630d3505f8905a0f4d42c6ff39a78a6ba2b28f68a3299ec3417bbabc6717dc"]
}'

Response Example

{
  "jsonrpc": "2.0",
  "result": {
    "module_a": {
      "fileFormatVersion": 6,
      "address": "0x61630d3505f8905a0f4d42c6ff39a78a6ba2b28f68a3299ec3417bbabc6717dc",
      "name": "module_a",
      "friends": [],
      "structs": {},
      "exposedFunctions": {}
    },
    "module_b": {
      "fileFormatVersion": 6,
      "address": "0x61630d3505f8905a0f4d42c6ff39a78a6ba2b28f68a3299ec3417bbabc6717dc",
      "name": "module_b",
      "friends": [],
      "structs": {},
      "exposedFunctions": {}
    }
  },
  "id": "getblock.io"
}

Response Parameters

Parameter
Type
Description

result

object

Map of module names to module definitions

Use Cases

  • List all modules in a package

  • Generate complete package documentation

  • Analyze package architecture

  • Build package explorers

Error Handling

Error Code
Description

-32602

Invalid params

-32603

Internal error

PackageNotFound

Package not found

SDK Integration

Last updated

Was this helpful?