Build
Reference
RPC
JSON RPC

Rooch JSON-RPC

In the blockchain network, the interaction between the client and the server is carried out through requests and responses. RPC (Remote Process Call) is a protocol for interaction between the client and the server. This protocol standardizes the data format when the client interacts with the server that implements the RPC interface.

There are many RPC interface implementations on the market, such as JSON-RPC, XML-RPC, Protobuf-RPC, etc. Rooch adopts the JSON-RPC protocol specification.

The caller writes the RPC request according to the RPC protocol specification. The client serializes the function name and parameters of the RPC interface. After sending it to the server, the server extracts the functions and parameters in the request through deserialization. The server calls Related functions and return the result of the call to the client. This is the general workflow of the RPC interface.

Type Conversions

  • u64, u128, u256 are represented as strings in JSON.
  • ObjectID and address are represented in JSON as hexadecimal strings beginning with 0x.

Examples

Next, we will use a few small examples to demonstrate how to call Rooch's JSON-RPC interface.

rooch_getChainID

rooch_getChainID This interface method is used to obtain the chain ID of Rooch.

Using the command line program curl as a client

curl --location 'https://dev-seed.rooch.network/' --header 'Content-Type: application/json' --data '{
    "jsonrpc": "2.0",
    "method": "rooch_getChainID",
    "params": [],
    "id": 0
}'

--location specifies the node URL to request, which is Rooch's dev network node.

--header specifies the header information of the request, such as specifying the data type in JSON format, etc.

--data specifies that we want to request the method name and parameters in the RPC interface, which must be filled in in JSON data format.

{"jsonrpc":"2.0","result":"3","id":0}

This is the response information returned in JSON format from the Rooch node after the RPC request. We focus on the result field, which is the execution result of the RPC. The chain ID number of Rooch's dev network is 3.

The client using the web page sends a request to the Rooch node

Above we have introduced how to send RPC requests to Rooch nodes through the command line interface. Next, we will introduce how to use the web client provided by Rooch to send requests.

Web JSON-RPC Client

The Methods on the right side of the page are the callable RPC interfaces currently provided by Rooch.

We click on the rooch_getChainID method, click the TRY IT NOW button, and the calling page will be displayed at the bottom of the page, as shown below.

This web program is easier to use than the curl program, and provides a corresponding request template, which only requires us to fill in the necessary request information.

  • The first step is to fill in the node URL of the Rooch network. Here we use the dev node network: https://dev-seed.rooch.network/
  • The second step is to fill in the name of the RPC method to be called, for example: rooch_getChainID
  • The third step Click the Run button

When the call is successful, you can see that the prompt on the right has responded successfully, and the corresponding response information is returned below, which is the same as the information returned by the curl command:

rooch_listStates

List states by access_path. If StateOptions.decode is true, decode the state and return the decoded value in the response.

See more about Access path.

curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"rooch_listStates","params":["/resource/0x3", null, null, {"decode":true}],"id":1}' https://dev-seed.rooch.network:443 | jq
  • --data is the JSON content we mainly fill in, and the protocol version must be 2.0.
  • method fill in the RPC method to be called.
  • params fills in the parameter list for calling the RPC method. From the RPC site we provide, you can see that access_path is required, and cursor, limit, and state_option are optional.
  • id is the identification information associated when the client and server communicate. When the client uses any ID to make a request, the server must also use the same value to identify the returned response information. Any integer can be used.

For easier reading, we use the jq command to format the returned JSON data.

Response:

{
  "jsonrpc": "2.0",
  "result": {
    "data": [
      {
        "key_state": {
          "key": "0x65303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030333a3a6163636f756e745f636f696e5f73746f72653a3a4175746f416363657074436f696e73",
          "key_type": "0x1::ascii::String",
          "decoded_key": "0000000000000000000000000000000000000000000000000000000000000003::account_coin_store::AutoAcceptCoins"
        },
        "state": {
          "value": "0x01b68de0c3a2bbf92087a463bbf7f8a145d918efadafac7c3776a4cc08accfc7b7",
          "value_type": "0x3::account_coin_store::AutoAcceptCoins",
          "decoded_value": {
            "abilities": 12,
            "type": "0x3::account_coin_store::AutoAcceptCoins",
            "value": {
              "auto_accept_coins": {
                "abilities": 4,
                "type": "0x2::table::Table<address, bool>",
                "value": {
                  "handle": {
                    "abilities": 12,
                    "type": "0x2::object::Object<0x2::table::TablePlaceholder>",
                    "value": {
                      "id": "0xb68de0c3a2bbf92087a463bbf7f8a145d918efadafac7c3776a4cc08accfc7b7"
                    }
                  }
                }
              }
            }
          },
          "display_fields": null
        }
      },
      {
        "key_state": {
          "key": "0x60303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030333a3a6163636f756e745f636f696e5f73746f72653a3a436f696e53746f726573",
          "key_type": "0x1::ascii::String",
          "decoded_key": "0000000000000000000000000000000000000000000000000000000000000003::account_coin_store::CoinStores"
        },
        "state": {
          "value": "0x01124d1a8b62c543cb04eb62038101f4016bd4a620a23127125431abb241c71eac",
          "value_type": "0x3::account_coin_store::AutoAcceptCoins",
          "decoded_value": {
            "abilities": 12,
            "type": "0x3::account_coin_store::AutoAcceptCoins",
            "value": {
              "coin_stores": {
                "abilities": 4,
                "type": "0x2::table::Table<0x1::string::String, 0x2::object::ObjectID>",
                "value": {
                  "handle": {
                    "abilities": 12,
                    "type": "0x2::object::Object<0x2::table::TablePlaceholder>",
                    "value": {
                      "id": "0x124d1a8b62c543cb04eb62038101f4016bd4a620a23127125431abb241c71eac"
                    }
                  }
                }
              }
            }
          },
          "display_fields": null
        }
      },
      {
        "key_state": {
          "key": "0x63303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030333a3a657468657265756d5f6c696768745f636c69656e743a3a426c6f636b53746f7265",
          "key_type": "0x1::ascii::String",
          "decoded_key": "0000000000000000000000000000000000000000000000000000000000000003::ethereum_light_client::BlockStore"
        },
        "state": {
          "value": "0x0193b896cbf29a04a89daebeb57f5c42606f0216827f1be52222ff63e32e9fca5a",
          "value_type": "0x3::ethereum_light_client::BlockStore",
          "decoded_value": {
            "abilities": 12,
            "type": "0x3::ethereum_light_client::BlockStore",
            "value": {
              "blocks": {
                "abilities": 4,
                "type": "0x2::table::Table<u64, 0x3::ethereum_light_client::BlockHeader>",
                "value": {
                  "handle": {
                    "abilities": 12,
                    "type": "0x2::object::Object<0x2::table::TablePlaceholder>",
                    "value": {
                      "id": "0x93b896cbf29a04a89daebeb57f5c42606f0216827f1be52222ff63e32e9fca5a"
                    }
                  }
                }
              }
            }
          },
          "display_fields": null
        }
      },
      {
        "key_state": {
          "key": "0x6c303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030333a3a6163636f756e745f61757468656e7469636174696f6e3a3a41757468656e7469636174696f6e4b657973",
          "key_type": "0x1::ascii::String",
          "decoded_key": "0000000000000000000000000000000000000000000000000000000000000003::account_authentication::AuthenticationKeys"
        },
        "state": {
          "value": "0x01b801a955e36647044f729006c0c2e8b09ea4423c5b286e1785b4c8df4eef3056",
          "value_type": "0x3::account_authentication::AuthenticationKeys",
          "decoded_value": {
            "abilities": 12,
            "type": "0x3::account_authentication::AuthenticationKeys",
            "value": {
              "authentication_keys": {
                "abilities": 4,
                "type": "0x2::type_table::TypeTable",
                "value": {
                  "handle": {
                    "abilities": 12,
                    "type": "0x2::object::Object<0x2::type_table::TablePlaceholder>",
                    "value": {
                      "id": "0xb801a955e36647044f729006c0c2e8b09ea4423c5b286e1785b4c8df4eef3056"
                    }
                  }
                }
              }
            }
          },
          "display_fields": null
        }
      },
      {
        "key_state": {
          "key": "0x6c303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030333a3a617574685f76616c696461746f725f72656769737472793a3a56616c696461746f725265676973747279",
          "key_type": "0x1::ascii::String",
          "decoded_key": "0000000000000000000000000000000000000000000000000000000000000003::auth_validator_registry::ValidatorRegistry"
        },
        "state": {
          "value": "0x030000000000000001bdbf13310e4988822414bff0ee11b1e29af0ec23e2287e1fd855d3724da512da01958fc1f573a3be908ea659f164e9897174df53d43e1b36ee8b82a6c0a99e9894",
          "value_type": "0x3::auth_validator_registry::ValidatorRegistry",
          "decoded_value": {
            "abilities": 12,
            "type": "0x3::auth_validator_registry::ValidatorRegistry",
            "value": {
              "validator_num": "3",
              "validators": {
                "abilities": 4,
                "type": "0x2::table::Table<u64, 0x3::auth_validator::AuthValidator>",
                "value": {
                  "handle": {
                    "abilities": 12,
                    "type": "0x2::object::Object<0x2::table::TablePlaceholder>",
                    "value": {
                      "id": "0xbdbf13310e4988822414bff0ee11b1e29af0ec23e2287e1fd855d3724da512da"
                    }
                  }
                }
              },
              "validators_with_type": {
                "abilities": 4,
                "type": "0x2::type_table::TypeTable",
                "value": {
                  "handle": {
                    "abilities": 12,
                    "type": "0x2::object::Object<0x2::type_table::TablePlaceholder>",
                    "value": {
                      "id": "0x958fc1f573a3be908ea659f164e9897174df53d43e1b36ee8b82a6c0a99e9894"
                    }
                  }
                }
              }
            }
          },
          "display_fields": null
        }
      }
    ],
    "next_cursor": "0x6d6c303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030333a3a617574685f76616c696461746f725f72656769737472793a3a56616c696461746f72526567697374727907000000000000000000000000000000000000000000000000000000000000000105617363696906537472696e6700",
    "has_next_page": false
  },
  "id": 1
}

As you can see, the response content is a JSON object, which contains three attributes:

  • The jsonrpc specifies the version, which is the same as the one that sends the request, identifying the communication version.
  • The result attribute is the body content of the response, which will be explained later.
  • The id: What ID is sent in the request, it will respond with the same ID to ensure that the context between communications is consistent.

Next, let's take a closer look at the result attribute, which contains three attributes:

  • data uses a list to store the specific content returned by this RPC method.
  • next_cursor This is a paging cursor that points to the last item on the page. During the communication process, if the returned response data is relatively large and cannot be delivered at once, it must be paged. The next request will automatically bring this value to let the responder know where to read from next time.
  • has_next_page If there is a lot of data and paging is required, this value is true, otherwise it is false.

rooch_getEventsByEventHandle

Get the event by event handler ID.

Request:

[joe@mx quick_start_object_counter]$ curl --location --request POST 'https://dev-seed.rooch.network:443' --header 'Content-Type: application/json' --data-raw '{
 "id":101,
 "jsonrpc":"2.0",
 "method":"rooch_getEventsByEventHandle", "params":["0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069::quick_start_object_counter::UserCounterCreatedEvent", null, "1000", false, {"decode":true}]
}'

Response:

{
  "jsonrpc": "2.0",
  "result": {
    "data": [
      {
        "event_id": {
          "event_handle_id": "0x3c8af60a5e71022d3ec7f3581c87e9eb81a7e4e94e0706d8107db64c3905b68e",
          "event_seq": 0
        },
        "event_type": "0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069::quick_start_object_counter::UserCounterCreatedEvent",
        "event_data": "0xbfc363a0afb2515ada06376ca4366f14c08b3d1021f23996bedd9109241aebd4",
        "event_index": 3,
        "decoded_event_data": {
          "abilities": 2,
          "type": "0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069::quick_start_object_counter::UserCounterCreatedEvent",
          "value": {
            "id": "0xbfc363a0afb2515ada06376ca4366f14c08b3d1021f23996bedd9109241aebd4"
          }
        }
      }
    ],
    "next_cursor": 0,
    "has_next_page": false
  },
  "id": 101
}

rooch_getBalances

Get the account balance through AccountAddress.

Request:

curl --location 'https://dev-seed.rooch.network:443' --header 'Content-Type: application/json' --data '{
 "id":101,
 "jsonrpc":"2.0",
 "method":"rooch_getBalances",
 "params":["0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069",null, "5"]
}'

Response:

{
  "jsonrpc": "2.0",
  "result": {
    "data": [
      {
        "coin_type": "0x3::gas_coin::RGas",
        "name": "Rooch Gas Coin",
        "symbol": "RGAS",
        "decimals": 18,
        "supply": "600000000000000000000",
        "balance": "99999999999997204086"
      }
    ],
    "next_cursor": "0x53303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030333a3a6761735f636f696e3a3a476173436f696e",
    "has_next_page": false
  },
  "id": 101
}

rooch_getBalance

Get the account balance through AccountAddress and CoinType.

Request:

curl --location 'https://dev-seed.rooch.network:443' --header 'Content-Type: application/json' --data '{
 "id":101,
 "jsonrpc":"2.0",
 "method":"rooch_getBalance",
 "params":["0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069", "0x3::gas_coin::RGas"]
}' | jq

Response:

{
  "jsonrpc": "2.0",
  "result": {
    "coin_type": "0x3::gas_coin::RGas",
    "name": "Rooch Gas Coin",
    "symbol": "RGAS",
    "decimals": 18,
    "supply": "300000000000000000000",
    "balance": "99999999999996463576"
  },
  "id": 101
}

rooch_getStates

Get state by access_path If StateOptions.decode is true, the state is decoded and the decoded value is returned in the response.

Request:

[joe@mx quick_start_object_counter]$ curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"rooch_getStates","params":["/object/0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069::quick_start_object_counter::Counter", {"decode":true}],"id":1}' https://dev-seed.rooch.network:443

Response:

{
  "jsonrpc": "2.0",
  "result": [
    {
      "value": "0xc98ad59f7c47f496df769a78119bc4d56a50ff19aa207ad8dcf89ae79fc1c6890000000000000000000000000000000000000000000000000000000000000000010000000000000000",
      "value_type": "0x2::object::ObjectEntity<0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069::quick_start_object_counter::Counter>",
      "decoded_value": {
        "abilities": 0,
        "type": "0x2::object::ObjectEntity<0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069::quick_start_object_counter::Counter>",
        "value": {
          "flag": 1,
          "id": "0xc98ad59f7c47f496df769a78119bc4d56a50ff19aa207ad8dcf89ae79fc1c689",
          "owner": "0x0000000000000000000000000000000000000000000000000000000000000000",
          "value": {
            "abilities": 12,
            "type": "0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069::quick_start_object_counter::Counter",
            "value": {
              "count_value": "0"
            }
          }
        }
      }
    }
  ],
  "id": 1
}

rooch_getTransactionsByHash

Request:

curl --location 'https://dev-seed.rooch.network:443' --header 'Content-Type: application/json' --data '{
 "id":101,
 "jsonrpc":"2.0",
 "method":"rooch_getTransactionsByHash",
 "params":[["0x08156186e176ae50d5e15cd52fd1225089621eef716dbb05736422ed1be58f8a"]]
}' | jq

Response:

{
  "jsonrpc": "2.0",
  "result": [
    {
      "transaction": {
        "sequence_number": 4,
        "sender": "0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069",
        "action_type": "functioncall",
        "action": {
          "function_call": {
            "function_id": "d9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069::quick_start_object_counter::increase",
            "ty_args": [],
            "args": [
              "0xbfc363a0afb2515ada06376ca4366f14c08b3d1021f23996bedd9109241aebd4"
            ]
          }
        },
        "raw": "0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a0300690400000000000000d7af34010000000000e1f5050000000001d9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a0300691a717569636b5f73746172745f6f626a6563745f636f756e74657208696e637265617365000120bfc363a0afb2515ada06376ca4366f14c08b3d1021f23996bedd9109241aebd400000000000000006100b12a9f7cba1686862581af02ae1a1b7adad94670291e88d2c63b8daec816f35e8f43d61dde845ee07ee749ec0ca2c53be5d690ca526c6d0b3bad6259fb00c209b538115d45ef7ceaff0f4918d23c5c84f0b35fa1791b4fc86b1391e84b40fdde"
      },
      "sequence_info": {
        "tx_order": "4442",
        "tx_order_signature": {
          "auth_validator_id": "0",
          "payload": "0x00e6badca0ceac73f3fcb1b2fd89820f7d93e56422320371738ad7ad3f3a58dd74f2fb8437722363271b19b92eaec97e635e2a224d37fbb1c50ea0a7044a80e30eca2ecf17ab26b7c32ddba10913e6f74d43b5258905bef0f88b6d744d73bc9ce9"
        },
        "tx_accumulator_root": "0x21e4d358567d8124f42fb25dd8cf10a6e98364c9293a13d6a5cd34a4d4c608e9"
      },
      "execution_info": {
        "tx_hash": "0x08156186e176ae50d5e15cd52fd1225089621eef716dbb05736422ed1be58f8a",
        "state_root": "0xbe5e35a3cec42b1a4cf14cced6750a88ead97ada8040f217eb8c758aa7a418f6",
        "event_root": "0x6a159a9537e443cf250ab24ae468cf85012f95338867cda12d9939be7adc0743",
        "gas_used": 15305,
        "status": {
          "type": "executed"
        }
      }
    }
  ],
  "id": 101
}

rooch_getTransactionsByOrder

Request:

curl --location 'https://dev-seed.rooch.network:443' --header 'Content-Type: application/json' --data '{
 "id":101,
 "jsonrpc":"2.0",
 "method":"rooch_getTransactionsByOrder",
 "params":[null, null]
}' | jq

Response:

......
        "sequence_info": {
          "tx_order": "49",
          "tx_order_signature": {
            "auth_validator_id": "0",
            "payload": "0x00c07c23a3ca6655efbd166f382ad1880dfc1fc9f5ebd3f44b0d985fbbbac24bc01528745e62c121a633eaabe1b66b21cc82ce57e565d9b0bf85977dbebeb75900ca2ecf17ab26b7c32ddba10913e6f74d43b5258905bef0f88b6d744d73bc9ce9"
          },
          "tx_accumulator_root": "0xb0cf37dc71ec65a645959cbcc495fb36e686cf32c85c4626e37a857842efb8f6"
        },
        "execution_info": {
          "tx_hash": "0xf18e26d1fed3021c8ebbd48a633560f679e0df306e759da2776cf9764ad56028",
          "state_root": "0x226e96f308f6eef3fa61f9fed6a5f4a5af62effb39a45ae50e20a7e45a492a82",
          "event_root": "0xf9fa4469e8fdd44eb522702621670245ca2d43852a4998db05a9e31ee2e80c79",
          "gas_used": 248658,
          "status": {
            "type": "executed"
          }
        }
      }
    ],
    "next_cursor": 49,
    "has_next_page": true
  },
  "id": 101
}

rooch_queryEvents

Currently there are two ways to query events.

  1. Query events through sender:

Request:

[joe@mx quick_start_object_counter]$ curl --location 'https://dev-seed.rooch.network:443' --header 'Content-Type: application/json' --data '{
    "id": 101,
    "jsonrpc": "2.0",
    "method": "rooch_queryEvents",
    "params": [
        {"sender":"0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069"}, null, "10", true
    ]
}' | jq

Response:

{
  "jsonrpc": "2.0",
  "result": {
    "data": [
      {
        "indexer_event_id": {
          "tx_order": 4442,
          "event_index": 1
        },
        "event_id": {
          "event_handle_id": "0x6ab771425e05fad096ce70d6ca4903de7cca732ee4c9f6820eb215be288e98dd",
          "event_seq": 4447
        },
        "event_type": "0x3::coin_store::DepositEvent",
        "event_data": "0x5184184f61a704261615f879b5c100ebaa530a03e7b72b5ca09317fe4302b12f53303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030333a3a6761735f636f696e3a3a476173436f696ec93b000000000000000000000000000000000000000000000000000000000000",
        "tx_hash": "0x08156186e176ae50d5e15cd52fd1225089621eef716dbb05736422ed1be58f8a",
        "sender": "0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069",
        "created_at": 0,
        "decoded_event_data": null
      },
      {
        "indexer_event_id": {
          "tx_order": 4442,
          "event_index": 0
        },
        "event_id": {
          "event_handle_id": "0x8e3089f2c059cc5377a1b6b7c3dcefba8a586697c35de27c2a4b68f81defb69c",
          "event_seq": 4442
        },
        "event_type": "0x3::coin_store::WithdrawEvent",
        "event_data": "0x3b7fcb00060dc80466da1185345b80f896a327100a7911f2fe480b29b22d59f853303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030333a3a6761735f636f696e3a3a476173436f696ec93b000000000000000000000000000000000000000000000000000000000000",
        "tx_hash": "0x08156186e176ae50d5e15cd52fd1225089621eef716dbb05736422ed1be58f8a",
        "sender": "0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069",
        "created_at": 0,
        "decoded_event_data": null
      },
      {
        "indexer_event_id": {
          "tx_order": 4440,
          "event_index": 1
        },
        "event_id": {
          "event_handle_id": "0x6ab771425e05fad096ce70d6ca4903de7cca732ee4c9f6820eb215be288e98dd",
          "event_seq": 4445
        },
        "event_type": "0x3::coin_store::DepositEvent",
        "event_data": "0x5184184f61a704261615f879b5c100ebaa530a03e7b72b5ca09317fe4302b12f53303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030333a3a6761735f636f696e3a3a476173436f696ec93b000000000000000000000000000000000000000000000000000000000000",
        "tx_hash": "0xdb59788af6a3e7a7fd9ccee93be392c5ca42c1da3d689bed2434ec5a7a6598dd",
        "sender": "0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069",
        "created_at": 0,
        "decoded_event_data": null
      },
      {
        "indexer_event_id": {
          "tx_order": 4440,
          "event_index": 0
        },
        "event_id": {
          "event_handle_id": "0x8e3089f2c059cc5377a1b6b7c3dcefba8a586697c35de27c2a4b68f81defb69c",
          "event_seq": 4440
        },
        "event_type": "0x3::coin_store::WithdrawEvent",
        "event_data": "0x3b7fcb00060dc80466da1185345b80f896a327100a7911f2fe480b29b22d59f853303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030333a3a6761735f636f696e3a3a476173436f696ec93b000000000000000000000000000000000000000000000000000000000000",
        "tx_hash": "0xdb59788af6a3e7a7fd9ccee93be392c5ca42c1da3d689bed2434ec5a7a6598dd",
        "sender": "0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069",
        "created_at": 0,
        "decoded_event_data": null
      },
      {
        "indexer_event_id": {
          "tx_order": 4156,
          "event_index": 1
        },
        "event_id": {
          "event_handle_id": "0x6ab771425e05fad096ce70d6ca4903de7cca732ee4c9f6820eb215be288e98dd",
          "event_seq": 4161
        },
        "event_type": "0x3::coin_store::DepositEvent",
        "event_data": "0x5184184f61a704261615f879b5c100ebaa530a03e7b72b5ca09317fe4302b12f53303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030333a3a6761735f636f696e3a3a476173436f696ec93b000000000000000000000000000000000000000000000000000000000000",
        "tx_hash": "0x09ddacbcc565e8d2f7544f4dded01ba54b80d43a6df1995bf6b0d55a6d5b78a4",
        "sender": "0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069",
        "created_at": 0,
        "decoded_event_data": null
      },
      {
        "indexer_event_id": {
          "tx_order": 4156,
          "event_index": 0
        },
        "event_id": {
          "event_handle_id": "0x8e3089f2c059cc5377a1b6b7c3dcefba8a586697c35de27c2a4b68f81defb69c",
          "event_seq": 4156
        },
        "event_type": "0x3::coin_store::WithdrawEvent",
        "event_data": "0x3b7fcb00060dc80466da1185345b80f896a327100a7911f2fe480b29b22d59f853303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030333a3a6761735f636f696e3a3a476173436f696ec93b000000000000000000000000000000000000000000000000000000000000",
        "tx_hash": "0x09ddacbcc565e8d2f7544f4dded01ba54b80d43a6df1995bf6b0d55a6d5b78a4",
        "sender": "0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069",
        "created_at": 0,
        "decoded_event_data": null
      },
      {
        "indexer_event_id": {
          "tx_order": 4152,
          "event_index": 1
        },
        "event_id": {
          "event_handle_id": "0x6ab771425e05fad096ce70d6ca4903de7cca732ee4c9f6820eb215be288e98dd",
          "event_seq": 4157
        },
        "event_type": "0x3::coin_store::DepositEvent",
        "event_data": "0x5184184f61a704261615f879b5c100ebaa530a03e7b72b5ca09317fe4302b12f53303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030333a3a6761735f636f696e3a3a476173436f696ed5100b0000000000000000000000000000000000000000000000000000000000",
        "tx_hash": "0x0ea9d9a0dd8d19b13e5b0c89d46b9eb58e7c82990a970be5397f554d1f516e4a",
        "sender": "0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069",
        "created_at": 0,
        "decoded_event_data": null
      },
      {
        "indexer_event_id": {
          "tx_order": 4152,
          "event_index": 0
        },
        "event_id": {
          "event_handle_id": "0x8e3089f2c059cc5377a1b6b7c3dcefba8a586697c35de27c2a4b68f81defb69c",
          "event_seq": 4152
        },
        "event_type": "0x3::coin_store::WithdrawEvent",
        "event_data": "0x3b7fcb00060dc80466da1185345b80f896a327100a7911f2fe480b29b22d59f853303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030333a3a6761735f636f696e3a3a476173436f696ed5100b0000000000000000000000000000000000000000000000000000000000",
        "tx_hash": "0x0ea9d9a0dd8d19b13e5b0c89d46b9eb58e7c82990a970be5397f554d1f516e4a",
        "sender": "0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069",
        "created_at": 0,
        "decoded_event_data": null
      },
      {
        "indexer_event_id": {
          "tx_order": 4136,
          "event_index": 5
        },
        "event_id": {
          "event_handle_id": "0x6ab771425e05fad096ce70d6ca4903de7cca732ee4c9f6820eb215be288e98dd",
          "event_seq": 4141
        },
        "event_type": "0x3::coin_store::DepositEvent",
        "event_data": "0x5184184f61a704261615f879b5c100ebaa530a03e7b72b5ca09317fe4302b12f53303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030333a3a6761735f636f696e3a3a476173436f696e8aa92a0000000000000000000000000000000000000000000000000000000000",
        "tx_hash": "0x4b0819be8e5a0bcbce20df2c28fbbde744535a53bacf5f0580c0fb271ac8161e",
        "sender": "0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069",
        "created_at": 0,
        "decoded_event_data": null
      },
      {
        "indexer_event_id": {
          "tx_order": 4136,
          "event_index": 4
        },
        "event_id": {
          "event_handle_id": "0x8e3089f2c059cc5377a1b6b7c3dcefba8a586697c35de27c2a4b68f81defb69c",
          "event_seq": 4136
        },
        "event_type": "0x3::coin_store::WithdrawEvent",
        "event_data": "0x3b7fcb00060dc80466da1185345b80f896a327100a7911f2fe480b29b22d59f853303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030333a3a6761735f636f696e3a3a476173436f696e8aa92a0000000000000000000000000000000000000000000000000000000000",
        "tx_hash": "0x4b0819be8e5a0bcbce20df2c28fbbde744535a53bacf5f0580c0fb271ac8161e",
        "sender": "0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069",
        "created_at": 0,
        "decoded_event_data": null
      }
    ],
    "next_cursor": {
      "tx_order": 4136,
      "event_index": 4
    },
    "has_next_page": true
  },
  "id": 101
}
  1. Query events by transaction sort range.

Request:

curl --location 'https://dev-seed.rooch.network:443' --header 'Content-Type: application/json' --data '{
    "id": 101,
    "jsonrpc": "2.0",
    "method": "rooch_queryEvents",
    "params": [
        {"tx_order_range":{"from_order":0, "to_order":3}}, null, "10", true
    ]
}' | jq

Response:

{
  "jsonrpc": "2.0",
  "result": {
    "data": [
      {
        "indexer_event_id": {
          "tx_order": 2,
          "event_index": 1
        },
        "event_id": {
          "event_handle_id": "0x6ab771425e05fad096ce70d6ca4903de7cca732ee4c9f6820eb215be288e98dd",
          "event_seq": 3
        },
        "event_type": "0x3::coin_store::DepositEvent",
        "event_data": "0x5184184f61a704261615f879b5c100ebaa530a03e7b72b5ca09317fe4302b12f53303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030333a3a6761735f636f696e3a3a476173436f696e52cb030000000000000000000000000000000000000000000000000000000000",
        "tx_hash": "0xc2ad19a0dcfa2e2811624874e9c334c273bff2799fb3254e2c0371f057b1000c",
        "sender": "0x49ee3cf17a017b331ab2b8a4d40ecc9706f328562f9db63cba625a9c106cdf35",
        "created_at": 0,
        "decoded_event_data": null
      },
      {
        "indexer_event_id": {
          "tx_order": 2,
          "event_index": 0
        },
        "event_id": {
          "event_handle_id": "0x8e3089f2c059cc5377a1b6b7c3dcefba8a586697c35de27c2a4b68f81defb69c",
          "event_seq": 2
        },
        "event_type": "0x3::coin_store::WithdrawEvent",
        "event_data": "0x125813b64065138cd0e37b7cc73c6d90dc7e1a0a00de9e1741b8c338dcc620ae53303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030333a3a6761735f636f696e3a3a476173436f696e52cb030000000000000000000000000000000000000000000000000000000000",
        "tx_hash": "0xc2ad19a0dcfa2e2811624874e9c334c273bff2799fb3254e2c0371f057b1000c",
        "sender": "0x49ee3cf17a017b331ab2b8a4d40ecc9706f328562f9db63cba625a9c106cdf35",
        "created_at": 0,
        "decoded_event_data": null
      },
      {
        "indexer_event_id": {
          "tx_order": 1,
          "event_index": 1
        },
        "event_id": {
          "event_handle_id": "0x6ab771425e05fad096ce70d6ca4903de7cca732ee4c9f6820eb215be288e98dd",
          "event_seq": 2
        },
        "event_type": "0x3::coin_store::DepositEvent",
        "event_data": "0x5184184f61a704261615f879b5c100ebaa530a03e7b72b5ca09317fe4302b12f53303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030333a3a6761735f636f696e3a3a476173436f696e3ea6020000000000000000000000000000000000000000000000000000000000",
        "tx_hash": "0x7de9409a8c51262981dbcb8ecf6acda53c7f6920657786178321990c4246baef",
        "sender": "0x49ee3cf17a017b331ab2b8a4d40ecc9706f328562f9db63cba625a9c106cdf35",
        "created_at": 0,
        "decoded_event_data": null
      },
      {
        "indexer_event_id": {
          "tx_order": 1,
          "event_index": 0
        },
        "event_id": {
          "event_handle_id": "0x8e3089f2c059cc5377a1b6b7c3dcefba8a586697c35de27c2a4b68f81defb69c",
          "event_seq": 1
        },
        "event_type": "0x3::coin_store::WithdrawEvent",
        "event_data": "0x125813b64065138cd0e37b7cc73c6d90dc7e1a0a00de9e1741b8c338dcc620ae53303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030333a3a6761735f636f696e3a3a476173436f696e3ea6020000000000000000000000000000000000000000000000000000000000",
        "tx_hash": "0x7de9409a8c51262981dbcb8ecf6acda53c7f6920657786178321990c4246baef",
        "sender": "0x49ee3cf17a017b331ab2b8a4d40ecc9706f328562f9db63cba625a9c106cdf35",
        "created_at": 0,
        "decoded_event_data": null
      },
      {
        "indexer_event_id": {
          "tx_order": 0,
          "event_index": 4
        },
        "event_id": {
          "event_handle_id": "0x6ab771425e05fad096ce70d6ca4903de7cca732ee4c9f6820eb215be288e98dd",
          "event_seq": 1
        },
        "event_type": "0x3::coin_store::DepositEvent",
        "event_data": "0x5184184f61a704261615f879b5c100ebaa530a03e7b72b5ca09317fe4302b12f53303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030333a3a6761735f636f696e3a3a476173436f696e1a661a0000000000000000000000000000000000000000000000000000000000",
        "tx_hash": "0x6fb503df33e446ceff37e07ebf143f7e332981b3e356c6b973947f3c265885a8",
        "sender": "0x49ee3cf17a017b331ab2b8a4d40ecc9706f328562f9db63cba625a9c106cdf35",
        "created_at": 0,
        "decoded_event_data": null
      },
      {
        "indexer_event_id": {
          "tx_order": 0,
          "event_index": 3
        },
        "event_id": {
          "event_handle_id": "0x8e3089f2c059cc5377a1b6b7c3dcefba8a586697c35de27c2a4b68f81defb69c",
          "event_seq": 0
        },
        "event_type": "0x3::coin_store::WithdrawEvent",
        "event_data": "0x125813b64065138cd0e37b7cc73c6d90dc7e1a0a00de9e1741b8c338dcc620ae53303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030333a3a6761735f636f696e3a3a476173436f696e1a661a0000000000000000000000000000000000000000000000000000000000",
        "tx_hash": "0x6fb503df33e446ceff37e07ebf143f7e332981b3e356c6b973947f3c265885a8",
        "sender": "0x49ee3cf17a017b331ab2b8a4d40ecc9706f328562f9db63cba625a9c106cdf35",
        "created_at": 0,
        "decoded_event_data": null
      },
      {
        "indexer_event_id": {
          "tx_order": 0,
          "event_index": 2
        },
        "event_id": {
          "event_handle_id": "0x6ab771425e05fad096ce70d6ca4903de7cca732ee4c9f6820eb215be288e98dd",
          "event_seq": 0
        },
        "event_type": "0x3::coin_store::DepositEvent",
        "event_data": "0x125813b64065138cd0e37b7cc73c6d90dc7e1a0a00de9e1741b8c338dcc620ae53303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030333a3a6761735f636f696e3a3a476173436f696e000010632d5ec76b050000000000000000000000000000000000000000000000",
        "tx_hash": "0x6fb503df33e446ceff37e07ebf143f7e332981b3e356c6b973947f3c265885a8",
        "sender": "0x49ee3cf17a017b331ab2b8a4d40ecc9706f328562f9db63cba625a9c106cdf35",
        "created_at": 0,
        "decoded_event_data": null
      },
      {
        "indexer_event_id": {
          "tx_order": 0,
          "event_index": 1
        },
        "event_id": {
          "event_handle_id": "0xdebc7ccc8fa8855fad9fdd2919e875e06bcfa9b11cdc53c3247e0f81239852e2",
          "event_seq": 1
        },
        "event_type": "0x3::coin_store::CreateEvent",
        "event_data": "0x125813b64065138cd0e37b7cc73c6d90dc7e1a0a00de9e1741b8c338dcc620ae53303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030333a3a6761735f636f696e3a3a476173436f696e",
        "tx_hash": "0x6fb503df33e446ceff37e07ebf143f7e332981b3e356c6b973947f3c265885a8",
        "sender": "0x49ee3cf17a017b331ab2b8a4d40ecc9706f328562f9db63cba625a9c106cdf35",
        "created_at": 0,
        "decoded_event_data": null
      },
      {
        "indexer_event_id": {
          "tx_order": 0,
          "event_index": 0
        },
        "event_id": {
          "event_handle_id": "0x358779b791ef606d7f07df8881c1939f26de95119486b60745a9c3127ae8fd37",
          "event_seq": 0
        },
        "event_type": "0x3::coin::MintEvent",
        "event_data": "0x53303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030333a3a6761735f636f696e3a3a476173436f696e000010632d5ec76b050000000000000000000000000000000000000000000000",
        "tx_hash": "0x6fb503df33e446ceff37e07ebf143f7e332981b3e356c6b973947f3c265885a8",
        "sender": "0x49ee3cf17a017b331ab2b8a4d40ecc9706f328562f9db63cba625a9c106cdf35",
        "created_at": 0,
        "decoded_event_data": null
      }
    ],
    "next_cursor": {
      "tx_order": 0,
      "event_index": 0
    },
    "has_next_page": false
  },
  "id": 101
}

rooch_executeViewFunction

Execute a read-only function, calling this function will not change the state of the application.

Request:

curl --location --header 'Content-Type: application/json' --data '{
 "id":101,
 "jsonrpc":"2.0",
 "method":"rooch_executeViewFunction",
 "params":[{"function_id":"0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069::quick_start_object_counter::init", "ty_args":[], "args":[]}]
}' https://dev-seed.rooch.network:443 | jq

Response:

{
  "jsonrpc": "2.0",
  "result": {
    "vm_status": {
      "MoveAbort": {
        "location": "0000000000000000000000000000000000000000000000000000000000000002::object",
        "abort_code": "1"
      }
    },
    "return_values": null
  },
  "id": 101
}

rooch_queryObjectStates

Query the global status indexer by status filter.

Filters can be set in 4 ways:

  • object_type + owner
  • object_type
  • owner
  • object_id

The following demonstrates using owner to query.

Request:

curl --location 'https://dev-seed.rooch.network:443' --header 'Content-Type: application/json' --data '{
 "id":101,
 "jsonrpc":"2.0",
 "method":"rooch_queryObjectStates",
 "params":[{"owner":"0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069"}, null, "5", false]
}' | jq

Response:

{
  "jsonrpc": "2.0",
  "result": {
    "data": [
      {
        "object_id": "0x3b7fcb00060dc80466da1185345b80f896a327100a7911f2fe480b29b22d59f8",
        "owner": "0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069",
        "flag": 0,
        "value": {
          "abilities": 8,
          "type": "0x3::coin_store::CoinStore<0x3::gas_coin::RGas>",
          "value": {
            "balance": {
              "abilities": 4,
              "type": "0x3::coin_store::Balance",
              "value": {
                "value": "99999999999997204086"
              }
            },
            "coin_type": "0000000000000000000000000000000000000000000000000000000000000003::gas_coin::RGas",
            "frozen": false
          }
        },
        "object_type": "0x3::coin_store::CoinStore",
        "key_type": null,
        "size": 0,
        "tx_order": 423,
        "state_index": 2,
        "created_at": 0,
        "updated_at": 0
      },
      {
        "object_id": "0xbfc363a0afb2515ada06376ca4366f14c08b3d1021f23996bedd9109241aebd4",
        "owner": "0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069",
        "flag": 0,
        "value": {
          "abilities": 12,
          "type": "0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069::quick_start_object_counter::Counter",
          "value": {
            "count_value": "123"
          }
        },
        "object_type": "0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069::quick_start_object_counter::Counter",
        "key_type": null,
        "size": 0,
        "tx_order": 423,
        "state_index": 3,
        "created_at": 0,
        "updated_at": 0
      },
      {
        "object_id": "0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069",
        "owner": "0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069",
        "flag": 0,
        "value": {
          "abilities": 8,
          "type": "0x2::account_storage::AccountStorage",
          "value": {
            "modules": {
              "abilities": 4,
              "type": "0x2::table::Table<0x1::string::String, 0x2::move_module::MoveModule>",
              "value": {
                "handle": "0xc8f877a25f28d6060b5b8f34e83f86aa69308c4bfffc5a124130e4c2e980cd54"
              }
            },
            "resources": {
              "abilities": 4,
              "type": "0x2::type_table::TypeTable",
              "value": {
                "handle": "0x1b46cf25c0aedc8a4249e312dbd4cec5e37009014bffdd193e748cf37f5eb278"
              }
            }
          }
        },
        "object_type": "0x2::account_storage::AccountStorage",
        "key_type": null,
        "size": 0,
        "tx_order": 423,
        "state_index": 8,
        "created_at": 0,
        "updated_at": 0
      }
    ],
    "next_cursor": {
      "tx_order": 423,
      "state_index": 8
    },
    "has_next_page": false
  },
  "id": 101
}

rooch_queryTransactions

Query the transaction indexer by transaction filter.

Request:

curl --location 'https://dev-seed.rooch.network:443' --header 'Content-Type: application/json' --data '{
 "id":101,
 "jsonrpc":"2.0",
 "method":"rooch_queryTransactions",
 "params":[{"tx_hashes":["0x09ddacbcc565e8d2f7544f4dded01ba54b80d43a6df1995bf6b0d55a6d5b78a4"]}, null, "5", true]
}' | jq

Response:

{
  "jsonrpc": "2.0",
  "result": {
    "data": [
      {
        "transaction": {
          "sequence_number": 2,
          "sender": "0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069",
          "action_type": "functioncall",
          "action": {
            "function_call": {
              "function_id": "d9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a030069::quick_start_object_counter::increase",
              "ty_args": [],
              "args": [
                "0xbfc363a0afb2515ada06376ca4366f14c08b3d1021f23996bedd9109241aebd4"
              ]
            }
          },
          "raw": "0xd9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a0300690200000000000000d7af34010000000000e1f5050000000001d9858821a52538c99f822d3f90ec798f76466bb7a1e82ebdb42d19b62a0300691a717569636b5f73746172745f6f626a6563745f636f756e74657208696e637265617365000120bfc363a0afb2515ada06376ca4366f14c08b3d1021f23996bedd9109241aebd4000000000000000061009e4f47e14a1b1e3f8bbd51bada6af1a76df543879aa5a920d142bc4e9dabc5027045ef855e5b8b2c547acc93644eb073143c2f3ba982a5e4e1031c6bc27d460eb538115d45ef7ceaff0f4918d23c5c84f0b35fa1791b4fc86b1391e84b40fdde"
        },
        "sequence_info": {
          "tx_order": "933",
          "tx_order_signature": {
            "auth_validator_id": "0",
            "payload": "0x0080461bbf41a5607c99a087222bedaf73b33d1f19e861aa9afe900d7e8826d10150b532d49062e87d71d166609a887df23ac3d44c2d8065bbd4ff4830d473530bca2ecf17ab26b7c32ddba10913e6f74d43b5258905bef0f88b6d744d73bc9ce9"
          },
          "tx_accumulator_root": "0xf41d37b7e0f58b483e14ecc35b42ab9bce765aa715608b1ca5f2116b83fa34cc"
        },
        "execution_info": {
          "tx_hash": "0x09ddacbcc565e8d2f7544f4dded01ba54b80d43a6df1995bf6b0d55a6d5b78a4",
          "state_root": "0x45ae059f9f9b104168f9127b5b48276155b21a61423e80b9ac499211f5f4274f",
          "event_root": "0x45ae059f9f9b104168f9127b5b48276155b21a61423e80b9ac499211f5f4274f",
          "gas_used": 15305,
          "status": {
            "type": "executed"
          }
        }
      }
    ],
    "next_cursor": 933,
    "has_next_page": false
  },
  "id": 101
}

btc_queryUTXOs

curl --location 'http://localhost:6767' \
--header 'Content-Type: application/json' \
--data '{
    "id": 101,
    "jsonrpc": "2.0",
    "method": "btc_queryUTXOs",
    "params": [
        null, null, "3", true
    ]
}'
{
    "jsonrpc": "2.0",
    "result": {
        "data": [
            {
                "object_id": "0x53ecba6bd8512287bb153f90b500b707b432af0db7e7e30f098755dd2acd90c0",
                "owner": "0x0000000000000000000000000000000000000000000000000000000000000004",
                "owner_bitcoin_address": null,
                "flag": 0,
                "value": {
                    "txid": "0x53cb51a5afc66d3b4a94bd44469c0e60bcbcb728008fd91c7867a9515a1f8f3d",
                    "bitcoin_txid": "3d8f1f5a51a967781cd98f0028b7bcbc600e9c4644bd944a3b6dc6afa551cb53",
                    "vout": 1,
                    "value": 0,
                    "seals": "{\"data\":[]}"
                },
                "object_type": "0x4::utxo::UTXO",
                "tx_order": 203,
                "state_index": 1,
                "created_at": 0,
                "updated_at": 0
            },
            {
                "object_id": "0x02a26226625959a46a85411def4dfce8bf6741b60083f1d8029d2eb7c5537b87",
                "owner": "0xe5f0793893d5117a4a6a245295e504a1c53c76b339b9a2f96c66e6bcf02473bc",
                "owner_bitcoin_address": "bc1pz24vcth8ey6kj2jv8uucxwgw946sg7c7tdrqmnnrfq96her2asgqel4222",
                "flag": 0,
                "value": {
                    "txid": "0x53cb51a5afc66d3b4a94bd44469c0e60bcbcb728008fd91c7867a9515a1f8f3d",
                    "bitcoin_txid": "3d8f1f5a51a967781cd98f0028b7bcbc600e9c4644bd944a3b6dc6afa551cb53",
                    "vout": 0,
                    "value": 5000000000,
                    "seals": "{\"data\":[]}"
                },
                "object_type": "0x4::utxo::UTXO",
                "tx_order": 203,
                "state_index": 0,
                "created_at": 0,
                "updated_at": 0
            },
            {
                "object_id": "0x9dca6d407ab237f3e004778945ff296a01f98c309e332bded089062e11d1dee4",
                "owner": "0xe5f0793893d5117a4a6a245295e504a1c53c76b339b9a2f96c66e6bcf02473bc",
                "owner_bitcoin_address": "bc1pz24vcth8ey6kj2jv8uucxwgw946sg7c7tdrqmnnrfq96her2asgqel4222",
                "flag": 0,
                "value": {
                    "txid": "0x4242756ae7f3d884b17f087d531847b4d5aa08ffd34184a85e1d72cf728da2c7",
                    "bitcoin_txid": "c7a28d72cf721d5ea88441d3ff08aad5b44718537d087fb184d8f3e76a754242",
                    "vout": 0,
                    "value": 5000000000,
                    "seals": "{\"data\":[]}"
                },
                "object_type": "0x4::utxo::UTXO",
                "tx_order": 201,
                "state_index": 3,
                "created_at": 0,
                "updated_at": 0
            }
        ],
        "next_cursor": {
            "tx_order": 201,
            "state_index": 3
        },
        "has_next_page": true
    },
    "id": 101
}

btc_queryUTXOs

curl --location 'http://localhost:6767' \
--header 'Content-Type: application/json' \
--data '{
    "id": 101,
    "jsonrpc": "2.0",
    "method": "btc_queryUTXOs",
    "params": [
        {"owner":"bc1pz24vcth8ey6kj2jv8uucxwgw946sg7c7tdrqmnnrfq96her2asgqel4222"}, null, "3", true
    ]
}'
{
    "jsonrpc": "2.0",
    "result": {
        "data": [
            {
                "object_id": "0x02a26226625959a46a85411def4dfce8bf6741b60083f1d8029d2eb7c5537b87",
                "owner": "0xe5f0793893d5117a4a6a245295e504a1c53c76b339b9a2f96c66e6bcf02473bc",
                "owner_bitcoin_address": "bc1pz24vcth8ey6kj2jv8uucxwgw946sg7c7tdrqmnnrfq96her2asgqel4222",
                "flag": 0,
                "value": {
                    "txid": "0x53cb51a5afc66d3b4a94bd44469c0e60bcbcb728008fd91c7867a9515a1f8f3d",
                    "bitcoin_txid": "3d8f1f5a51a967781cd98f0028b7bcbc600e9c4644bd944a3b6dc6afa551cb53",
                    "vout": 0,
                    "value": 5000000000,
                    "seals": "{\"data\":[]}"
                },
                "object_type": "0x4::utxo::UTXO",
                "tx_order": 203,
                "state_index": 0,
                "created_at": 0,
                "updated_at": 0
            },
            {
                "object_id": "0x9dca6d407ab237f3e004778945ff296a01f98c309e332bded089062e11d1dee4",
                "owner": "0xe5f0793893d5117a4a6a245295e504a1c53c76b339b9a2f96c66e6bcf02473bc",
                "owner_bitcoin_address": "bc1pz24vcth8ey6kj2jv8uucxwgw946sg7c7tdrqmnnrfq96her2asgqel4222",
                "flag": 0,
                "value": {
                    "txid": "0x4242756ae7f3d884b17f087d531847b4d5aa08ffd34184a85e1d72cf728da2c7",
                    "bitcoin_txid": "c7a28d72cf721d5ea88441d3ff08aad5b44718537d087fb184d8f3e76a754242",
                    "vout": 0,
                    "value": 5000000000,
                    "seals": "{\"data\":[]}"
                },
                "object_type": "0x4::utxo::UTXO",
                "tx_order": 201,
                "state_index": 3,
                "created_at": 0,
                "updated_at": 0
            },
            {
                "object_id": "0x8a82f637e4964f4651abb5d35e3bc9c2d1c00c5c678d7f3fb0a5c4f3248007a8",
                "owner": "0xe5f0793893d5117a4a6a245295e504a1c53c76b339b9a2f96c66e6bcf02473bc",
                "owner_bitcoin_address": "bc1pz24vcth8ey6kj2jv8uucxwgw946sg7c7tdrqmnnrfq96her2asgqel4222",
                "flag": 0,
                "value": {
                    "txid": "0x5ca8776c70db65736f69bce5b8ed2a6108134696ca5da8edd8c946293b6d839f",
                    "bitcoin_txid": "9f836d3b2946c9d8eda85dca96461308612aedb8e5bc696f7365db706c77a85c",
                    "vout": 0,
                    "value": 5000000000,
                    "seals": "{\"data\":[]}"
                },
                "object_type": "0x4::utxo::UTXO",
                "tx_order": 199,
                "state_index": 2,
                "created_at": 0,
                "updated_at": 0
            }
        ],
        "next_cursor": {
            "tx_order": 199,
            "state_index": 2
        },
        "has_next_page": true
    },
    "id": 101
}

btc_queryInscriptions

curl --location 'http://localhost:6767' \
--header 'Content-Type: application/json' \
--data '{
    "id": 101,
    "jsonrpc": "2.0",
    "method": "btc_queryInscriptions",
    "params": [
        {"owner":"bc1prwkw9eatwve4zthumxd9jjsz9vsrfvyla6x7jv27kwpasu7j839samxheh"}, null, "3", true
    ]
}'
{
    "jsonrpc": "2.0",
    "result": {
        "data": [
            {
                "object_id": "0x0e9244b7960e271ff1bc68e88f7df1bec45e9246048d5b9f7101b53774e56365",
                "owner": "0xfc7ec61a7c481c66797954dd5256e3f34bb578bb350d3cfa4df5940e3e960219",
                "owner_bitcoin_address": "bc1prwkw9eatwve4zthumxd9jjsz9vsrfvyla6x7jv27kwpasu7j839samxheh",
                "flag": 0,
                "value": {
                    "txid": "0xb8b7a9b8be2f43746dceaf83b741737e3b577d8cbbc950e10001f7aa9becefc7",
                    "bitcoin_txid": "c7efec9baaf70100e150c9bb8c7d573b7e7341b783afce6d74432fbeb8a9b7b8",
                    "index": 0,
                    "body": "0x48656c6c6f20726f6f63680a",
                    "content_encoding": null,
                    "content_type": "text/plain;charset=utf-8",
                    "metadata": "0x",
                    "metaprotocol": null,
                    "parent": null,
                    "pointer": null
                },
                "object_type": "0x4::ord::Inscription",
                "tx_order": 205,
                "state_index": 0,
                "created_at": 0,
                "updated_at": 0
            }
        ],
        "next_cursor": {
            "tx_order": 205,
            "state_index": 0
        },
        "has_next_page": false
    },
    "id": 101
}

btc_queryInscriptions

curl --location 'http://localhost:6767' \
--header 'Content-Type: application/json' \
--data '{
    "id": 101,
    "jsonrpc": "2.0",
    "method": "btc_queryInscriptions",
    "params": [
        null, null, "10", true
    ]
}'
{
    "jsonrpc": "2.0",
    "result": {
        "data": [
            {
                "object_id": "0x0e9244b7960e271ff1bc68e88f7df1bec45e9246048d5b9f7101b53774e56365",
                "owner": "0xfc7ec61a7c481c66797954dd5256e3f34bb578bb350d3cfa4df5940e3e960219",
                "owner_bitcoin_address": "bc1prwkw9eatwve4zthumxd9jjsz9vsrfvyla6x7jv27kwpasu7j839samxheh",
                "flag": 0,
                "value": {
                    "txid": "0xb8b7a9b8be2f43746dceaf83b741737e3b577d8cbbc950e10001f7aa9becefc7",
                    "bitcoin_txid": "c7efec9baaf70100e150c9bb8c7d573b7e7341b783afce6d74432fbeb8a9b7b8",
                    "index": 0,
                    "body": "0x48656c6c6f20726f6f63680a",
                    "content_encoding": null,
                    "content_type": "text/plain;charset=utf-8",
                    "metadata": "0x",
                    "metaprotocol": null,
                    "parent": null,
                    "pointer": null
                },
                "object_type": "0x4::ord::Inscription",
                "tx_order": 205,
                "state_index": 0,
                "created_at": 0,
                "updated_at": 0
            }
        ],
        "next_cursor": {
            "tx_order": 205,
            "state_index": 0
        },
        "has_next_page": false
    },
    "id": 101
}