Move Utils

iota_getMoveFunctionArgTypes

Return the argument types of a Move function, based on normalized Type.

Parameters

package< ObjectID >

  • Required: yes

module< string >

  • Required: yes

function< string >

  • Required: yes

Result

Vec<MoveFunctionArgType><[ MoveFunctionArgType ]>

Example

Returns the argument types for the package and function the request provides.

Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "iota_getMoveFunctionArgTypes",
  "params": [
    "0x9c4eb6769ca8b6a23efeb7298cf0a8d0b837b78749c2cfc711c42036cc6b7621",
    "my_module",
    "mint"
  ]
}

Response

{
  "jsonrpc": "2.0",
  "result": [
    {
      "Object": "ByMutableReference"
    },
    "Pure",
    "Pure",
    {
      "Object": "ByValue"
    },
    {
      "Object": "ByImmutableReference"
    },
    {
      "Object": "ByValue"
    },
    {
      "Object": "ByMutableReference"
    }
  ],
  "id": 1
}

​iota_getNormalizedMoveFunction

Return a structured representation of Move function

Parameters

package< ObjectID >

  • Required: yes

module_name< string >

  • Required: yes

function_name< string >

  • Required: yes

Result

IotaMoveNormalizedFunction< IotaMoveNormalizedFunction >

Parameters

isEntry< Boolean >

  • Required: yes

parameters<[ IotaMoveNormalizedType ]>

  • Required: yes

return<[ IotaMoveNormalizedType ]>

  • Required: yes

typeParameters<[ IotaMoveAbilitySet ]>

  • Required: yes

visibility< IotaMoveVisibility >

  • Required: yes

Example

Returns the structured representation of the function the request provides.

Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "iota_getNormalizedMoveFunction",
  "params": [
    "0x1639f3606a53f61f3a566963b3eac49fe3bb57d304a454ed2f4859b44f4e4918",
    "moduleName",
    "functionName"
  ]
}

Response

{
  "jsonrpc": "2.0",
  "result": {
    "visibility": "Public",
    "isEntry": false,
    "typeParameters": [
      {
        "abilities": [
          "Store",
          "Key"
        ]
      }
    ],
    "parameters": [
      "U64"
    ],
    "return": [
      "U64"
    ]
  },
  "id": 1
}

iota_getNormalizedMoveModule

Return a structured representation of Move module

Parameters

package< ObjectID >

  • Required: yes

module_name< string >

  • Required: yes

Result

IotaMoveNormalizedModule< IotaMoveNormalizedModule >

Parameters

address< string >

  • Required: yes

exposedFunctions< IotaMoveNormalizedFunction >

  • Required: yes

fileFormatVersion< uint32 >

  • Required: yes

friends<[ IotaMoveModuleId ]>

  • Required: yes

name< string >

  • Required: yes

structs< IotaMoveNormalizedStruct >

  • Required: yes

Example

Gets a structured representation of the Move module for the package in the request.

Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "iota_getNormalizedMoveModule",
  "params": [
    "0x800105867da4655eca6d9eb1258bfd1ad92af329a07781ee71e60065e00f2de9",
    "module"
  ]
}

Response

{
  "jsonrpc": "2.0",
  "result": {
    "fileFormatVersion": 6,
    "address": "0x0047d5fa0a823e7d0ff4d55c32b09995a0ae1eedfee9c7b1354e805ed10ee3d0",
    "name": "module",
    "friends": [],
    "structs": {},
    "exposedFunctions": {}
  },
  "id": 1
}

iota_getNormalizedMoveModulesByPackage

Return structured representations of all modules in the given package

Parameters

package< ObjectID >

  • Required: yes

Result

BTreeMap<String,IotaMoveNormalizedModule>< IotaMoveNormalizedModule >

Example

Gets structured representations of all the modules for the package in the request.

Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "iota_getNormalizedMoveModulesByPackage",
  "params": [
    "0xc95b9e341bc3aba1654bdbad707dcd773bd6309363447ef3fe58a960de92aa93"
  ]
}

Response

{
  "jsonrpc": "2.0",
  "result": {
    "fileFormatVersion": 6,
    "address": "0x61630d3505f8905a0f4d42c6ff39a78a6ba2b28f68a3299ec3417bbabc6717dc",
    "name": "module",
    "friends": [],
    "structs": {},
    "exposedFunctions": {}
  },
  "id": 1
}

iota_getNormalizedMoveStruct

Return a structured representation of Move struct

Parameters

package< ObjectID >

  • Required: yes

module_name< string >

  • Required: yes

struct_name< string >

  • Required: yes

Result

IotaMoveNormalizedStruct< IotaMoveNormalizedStruct >

Parameters

abilities< IotaMoveAbilitySet >

  • Required: yes

fields<[ IotaMoveNormalizedField ]>

  • Required: yes

typeParameters<[ IotaMoveStructTypeParameter ]>

  • Required: yes

Example

Gets a structured representation of the struct in the request.

Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "iota_getNormalizedMoveStruct",
  "params": [
    "0x77b3482580ee8d5bdc5b824808df54bfec4fc817622e5add0e48f749f01def98",
    "module",
    "StructName"
  ]
}

Response

{
  "jsonrpc": "2.0",
  "result": {
    "abilities": {
      "abilities": [
        "Store",
        "Key"
      ]
    },
    "typeParameters": [],
    "fields": []
  },
  "id": 1
}

Last updated