# Onbloc API documentation ## Features - Gno Json RPC access - tx-indexer access - Provide an easy-to-use ABCI query request methods - Provide useful methods ## Network Information ### Supported Networks - Portal Loop (portal-loop) - Testnet3 (test3) ### Network Endpoints | Network | Description | URL | | ----------- | ----------------------- | ------------------------------------------- | | Portal Loop | JSON-RPC over HTTPS | `https://api.onbloc.xyz/v1` | | Portal Loop | JSON-RPC over Websocket | `wss://api.onbloc.xyz/v1` | | Testnet3 | JSON-RPC over HTTPS | `https://test3.api.onbloc.xyz/v1` | | Testnet3 | JSON-RPC over Websocket | `wss://test3.api.onbloc.xyz/v1` | > The APIs will be permissionlessly usable for any indivisuals or teams developing in Gno. ## Network APIs ### JSON-RPC methods The Onbloc API provides the Gnoland standard JSON-RPC-API and methods from tx-indexer, as well as functions to help with ABCI queries. - The endpoints of JSON-RPC-API will be the same as the Gno RPC endpoinrts. - indexer\_\*: indicates the endpoint of the indexer. - gno\_\*: Utilizes functions from known packages in Gno. --- - **Common** **[Response]** | Name | Type | Description | | --------------- | ------ | --------------------------------- | | `jsonrpc` | String | The RPC version. | | `id` | String | The response ID. | | `result` | Object | (upon success) The result object. | | `error` | Object | (upon failure) The error object. | | `error.code` | Number | The error code. | | `error.message` | String | The error message. | | `error.data` | String | The error data. | - **Health Check ([Gno RPC Endpoints](https://docs.gno.land/reference/rpc-endpoints#health-check))** Call with the `health` path. - **Check Node Server Status ([Gno RPC Endpoints](https://docs.gno.land/reference/rpc-endpoints#check-node-server-status))** Call with the `status` path. - **Get Network Information ([Gno RPC Endpoints](https://docs.gno.land/reference/rpc-endpoints#get-network-information))** Call with the `net_info` path. - **Get Genesis Block Information ([Gno RPC Endpoints](https://docs.gno.land/reference/rpc-endpoints#get-genesis-block-information))** Call with the `genesis` path. - **Get Consensus Parameters ([Gno RPC Endpoints](https://docs.gno.land/reference/rpc-endpoints#get-consensus-parameters))** Call with the `consensus_params` path. - **Get Consensus State ([Gno RPC Endpoints](https://docs.gno.land/reference/rpc-endpoints#get-consensus-state))** Call with the `consensus_state` path. - **Get Commit ([Gno RPC Endpoints](https://docs.gno.land/reference/rpc-endpoints#get-commit))** Call with the `commit` path. - **Get Block Information ([Gno RPC Endpoints](https://docs.gno.land/reference/rpc-endpoints#get-block-information))** Call with the `block` path. - **Get Block Results ([Gno RPC Endpoints](https://docs.gno.land/reference/rpc-endpoints#get-block-results))** Call with the `block_results` path. - **Get Block List ([Gno RPC Endpoints](https://docs.gno.land/reference/rpc-endpoints#get-block-list))** Call with the `blockchain` path. - **Get a No. of Unconfirmed Transactions ([Gno RPC Endpoints](https://docs.gno.land/reference/rpc-endpoints#get-a-no.-of-unconfirmed-transactions))** Call with the `num_unconfirmed_txs` path. - **Get a List of Unconfirmed Transactions ([Gno RPC Endpoints](https://docs.gno.land/reference/rpc-endpoints#get-a-list-of-unconfirmed-transactions))** Call with the `unconfirmed_txs` path. - **Get a List of Validators ([Gno RPC Endpoints](https://docs.gno.land/reference/rpc-endpoints#get-a-list-of-validators))** Call with the `validators` path. ### ABCI methods - **Get ABCI Information ([Gno RPC Endpoints](https://docs.gno.land/reference/rpc-endpoints#get-abci-information))** Call with the `abci_info` path. - **Get ABCI Query ([Gno RPC Endpoints](https://docs.gno.land/reference/rpc-endpoints#get-abci-query))** Call with the `abci_query` path. ### Additional ABCI methods - **(Added) Get Account Of ABCI Query** Call with the `abci_auth_account` path. **[Parameter]** | Name | Type | Description | | --------- | ------ | -------------- | | `address` | String | Bech32 Address | **[Response]** | Name | Type | Description | | --------- | -------------------------- | ------------------------ | | `jsonrpc` | String | The RPC version. | | `id` | String | The response ID. | | `result` | [ABCI Auth Account Result] | The account informations | **[ABCI Auth Account Result]** | Name | Type | Description | | ------------------ | ------ | -------------------------------------------- | | `address` | Number | Bech32 Address | | `coins` | String | A list string of coins in the account | | `public_key` | String | The account's public key | | `public_key.@type` | String | The account's public key type | | `public_key.value` | String | The account's public key value | | `account_number` | String | Account number | | `sequence` | String | Number of transactions signed by the account | - **(Newly Added) Get Balances Of ABCI Query** Call with the `abci_bank_balances` path. **[Parameter]** | Name | Type | Description | | --------- | ------ | -------------- | | `address` | String | Bech32 Address | **[Response]** | Name | Type | Description | | --------- | ---------------------------- | ---------------------------- | | `jsonrpc` | String | The RPC version. | | `id` | String | The response ID. | | `result` | [ABCI Bank Balance Result][] | Account balance informations | **[ABCI Bank Balance Result]** | Name | Type | Description | | -------------- | ------ | ---------------------- | | `amount` | Number | Amount of tokens | | `denomination` | String | Denomination of tokens | - **(Newly Added) Get VM Realm Functions Of ABCI Query** Call with the `abci_vm_qfuncs` path. **[Parameter]** | Name | Type | Description | | ------------- | ------ | ------------------ | | `packagePath` | String | Gno Package's path | **[Response]** | Name | Type | Description | | --------- | ------------------------- | -------------------------------- | | `jsonrpc` | String | The RPC version. | | `id` | String | The response ID. | | `result` | [ABCI VM Function Result] | List of functions in the package | **[ABCI VM Function Result]** | Name | Type | Description | | ----------- | --------- | -------------------------------- | | `functions` | String [] | List of functions in the package | - **(Newly Added) Get VM File Content Of ABCI Query** Call with the `abci_vm_qfile` path. **[Parameter]** | Name | Type | Description | | ------------- | ------ | ------------------ | | `packagePath` | String | Gno Package's path | **[Response]** | Name | Type | Description | | --------- | --------------------- | ---------------------------- | | `jsonrpc` | String | The RPC version. | | `id` | String | The response ID. | | `result` | [ABCI VM File Result] | List of files in the package | **[ABCI VM File Result]** | Name | Type | Description | | ------- | --------- | ---------------------------- | | `files` | String [] | List of files in the package | - **(Newly Added) Get VM Realm Render Output Of ABCI Query** Call with the `abci_vm_qrender` path. **[Parameter]** | Name | Type | Description | | ------------- | ------ | ------------------ | | `packagePath` | String | Gno Package's path | **[Response]** | Name | Type | Description | | --------- | ----------------------- | --------------------------------------------------- | | `jsonrpc` | String | The RPC version. | | `id` | String | The response ID. | | `result` | [ABCI VM Render Result] | Results from the Render function in the Gno package | **[ABCI VM Render Result]** | Name | Type | Description | | ------- | ------ | ---------------------- | | `value` | String | String of data results | - **(Newly Added) Evaluating VM Realm Function Expressions Of ABCI Query** Call with the `abci_vm_qeval` path. **[Parameter]** | Name | Type | Description | | ------------- | --------- | --------------------------------------------------- | | `packagePath` | String | Gno Package's path | | `func` | String | The name of the function to call in the gno package | | `args` | String [] | Arguments in a function | **[Response]** | Name | Type | Description | | --------- | --------------------------- | -------------------------------------------------------- | | `jsonrpc` | String | The RPC version. | | `id` | String | The response ID. | | `result` | [ABCI VM Evaluation Result] | The result of the evaluation of the Gno package function | **[ABCI VM Evaluation Result]** | Name | Type | Description | | ------- | ------ | ------------------------------- | | `value` | String | String of data results | | `type` | String | Data types of evaluated results | - **(Not yet supported) Get Package** Call with the `abci_vm_package` path. - **(Not yet supported) Get Store** Call with the `abci_vm_store` path. ### Indexer methods (from [tx-indexer](https://github.com/gnolang/tx-indexer)) - **Get a block** Call with the `indexer_getBlock` path. **[Parameter]** | Name | Type | Description | | -------- | ------ | ------------ | | `height` | Number | Block Height | **[Response]** | Name | Type | Description | | --------- | -------------- | ---------------------- | | `jsonrpc` | String | The RPC version. | | `id` | String | The response ID. | | `result` | [Block Result] | The block information. | - **Get Transaction Result** Call with the `indexer_getTxResult` path. **[Parameter]** | Name | Type | Description | | ------ | ------ | ---------------- | | `hash` | Number | Transaction Hash | **[Response]** | Name | Type | Description | | --------- | -------------------- | ---------------------------- | | `jsonrpc` | String | The RPC version. | | `id` | String | The response ID. | | `result` | [Transaction Result] | The Transaction information. | ### Indexer Filter methods - **Creates a block filter for new block events** Call with the `indexer_newBlockFilter` path. **[Response]** | Name | Type | Description | | --------- | ------ | ---------------- | | `jsonrpc` | String | The RPC version. | | `id` | String | The response ID. | | `result` | String | Filter ID | - **(Not yet supported) Creates a transaction filter for new transaction events** Call with the `indexer_newTransactionFilter` path. - **Polling method for a block filter** Call with the `indexer_getFilterChanges` path. **[Parameter]** | Name | Type | Description | | ---------- | ------ | ----------- | | `filterId` | String | Filter ID | **[Response]** | Name | Type | Description | | --------- | ------------------ | ---------------- | | `jsonrpc` | String | The RPC version. | | `id` | String | The response ID. | | `result` | [Changed Result][] | Changed Object. | - **Uninstall Filter** Call with the `indexer_uninstallFilter` path. **[Parameter]** | Name | Type | Description | | ---------- | ------ | ----------- | | `filterId` | String | Filter ID | **[Response]** | Name | Type | Description | | --------- | ------ | -------------------------------------------------------------------------- | | `jsonrpc` | String | The RPC version. | | `id` | String | The response ID. | | `result` | Bool | true if the filter was successfully uninstalled, otherwise false (boolean) | ### Indexer Filter Query - **Query the list** Call with the `indexer_query` path. **[Parameter]** | Name | Type | Description | | -------- | -------------- | ----------------------- | | `query` | String | GraphQL Query String | **[Response]** | Name | Type | Description | | --------- | -------------- | ------------------ | | `data` | [GraphQL Response] | Dynamic GraphQL Response. | ### Subscription methods - **Subscribe by filter** Call with the `indexer_subscribe` path. **[Parameter]** | Name | Type | Description | | ---------- | ------ | ----------- | | `filterId` | String | Filter ID | **[Response]** | Name | Type | Description | | --------- | ---------------- | -------------------- | | `jsonrpc` | String | The RPC version. | | `id` | String | The response ID. | | `result` | [Changed Result] | Changed Information. | - **Subscribe by query** Call with the `indexer_subscribeQuery` path. **[Parameter]** | Name | Type | Description | | ---------- | ------ | ----------- | | `filterId` | String | Filter ID | **[Response]** | Name | Type | Description | | --------- | -------------- | ------------------------- | | `jsonrpc` | String | The RPC version. | | `id` | String | The response ID. | | `result` | [Query Result] | Query Result Information. | ### Utility methods (from Gno) - **Get Username By Address** Call with the `gno_getUsername` path. **[Parameter]** | Name | Type | Description | | --------- | ------ | -------------- | | `address` | String | Bech32 Address | **[Response]** | Name | Type | Description | | --------- | ------ | ------------------- | | `jsonrpc` | String | The RPC version. | | `id` | String | The response ID. | | `result` | String | Address's username. | - **Get GRC20 Tokens** Call with the `gno_getGRC20Tokens` path. **[Response]** | Name | Type | Description | | --------- | ----------------------- | ----------------- | | `jsonrpc` | String | The RPC version. | | `id` | String | The response ID. | | `result` | [GRC20 Token Result] [] | GRC20 Token Lists | **[GRC20 Token Result]** | Name | Type | Description | | ---------- | ------ | -------------- | | `name` | String | Token name | | `symbol` | String | Token symbol | | `decimals` | Number | Token decimals | | `packagePath` | String | Token Pacakge path | - **Get GRC20 Balance** Call with the `gno_getGRC20balance` path. **[Parameter]** | Name | Type | Description | | ------------- | ------ | ------------------ | | `address` | String | Bech32 Address | | `packagePath` | String | GRC20 Package path | **[Response]** | Name | Type | Description | | --------- | ------ | ---------------- | | `jsonrpc` | String | The RPC version. | | `id` | String | The response ID. | | `result` | Number | Balance Amount | ### Error Codes https://www.jsonrpc.org/specification code message meaning | code | message | meaning | | --------- | ------ | ---------------- | | -32700 | Parse error Invalid | JSON was received by the server. An error occurred on the server while parsing the JSON text. | | -32600 | Invalid Request | The JSON sent is not a valid Request object. | | -32601 | Method not found | The method does not exist / is not available. | | -32602 | Invalid params | Invalid method parameter(s). | | -32603 | Internal error | Internal JSON-RPC error. | | -32000 to -32099 | Server error | Reserved for implementation-defined server-errors. |
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up