UPCX API (1.0.0)

URL: https://upcx.io License: MIT

OAS 3.0 Nodupcx UPCX API Specification



JSON-RPC Endpoints

- Mainnet

Coming soon



- Testnet

https://node1-testnet.upcx.org:9000

https://node2-testnet.upcx.org:9000

https://node3-testnet.upcx.org:9000

https://node4-testnet.upcx.org:9000

https://node5-testnet.upcx.org:9000

https://node6-testnet.upcx.org:9000

https://node7-testnet.upcx.org:9000

Chain APIs

get_account

Returns an object containing various details about a specific account on the blockchain.

Request Body schema: application/json

JSON Object with single member "account_name"

required
NamePrivileged (string) or NameBasic (string) or NameBid (string) or NameCatchAll (string) (Name)

Responses

Request samples

Content type
application/json
{
  • "account_name": "string"
}

Response samples

Content type
application/json
{
  • "account_name": "string",
  • "head_block_num": 0,
  • "head_block_time": "string",
  • "last_code_update": "string",
  • "created": "string",
  • "refund_request": {
    },
  • "ram_quota": "string",
  • "net_limit": {
    },
  • "cpu_limit": {
    },
  • "total_resources": {
    },
  • "core_liquid_balance": "string",
  • "self_delegated_bandwidth": {
    },
  • "net_weight": "string",
  • "cpu_weight": "string",
  • "ram_usage": "string",
  • "privileged": true,
  • "permissions": [
    ],
  • "voter_info": {
    }
}

get_block

Returns an object containing various details about a specific block on the blockchain.

Request Body schema: application/json
block_num_or_id
required
string

Provide a block number or a block id

Responses

Request samples

Content type
application/json
{
  • "block_num_or_id": "string"
}

Response samples

Content type
application/json
{
  • "timestamp": "string",
  • "producer": "string",
  • "confirmed": 0,
  • "previous": "string",
  • "transaction_mroot": "string",
  • "action_mroot": "string",
  • "schedule_version": 0,
  • "new_producers": {
    },
  • "header_extensions": [
    ],
  • "new_protocol_features": [
    ],
  • "producer_signature": "string",
  • "transactions": [
    ],
  • "block_extensions": [
    ],
  • "id": "string",
  • "block_num": 0,
  • "ref_block_prefix": 0
}

get_block_info

Similar to get_block but returns a fixed-size smaller subset of the block data.

Request Body schema: application/json
block_num
required
integer

Provide a block number

Responses

Request samples

Content type
application/json
{
  • "block_num": 0
}

Response samples

Content type
application/json
{
  • "block_num": 0,
  • "ref_block_num": 0,
  • "id": "string",
  • "timestamp": "string",
  • "producer": "string",
  • "confirmed": 0,
  • "previous": "string",
  • "transaction_mroot": "string",
  • "action_mroot": "string",
  • "schedule_version": 0,
  • "producer_signature": "string",
  • "ref_block_prefix": 0
}

get_info

Returns an object containing various details about the blockchain.

Responses

Response samples

Content type
application/json
{
  • "server_version": "string",
  • "chain_id": "string",
  • "head_block_num": 0,
  • "head_block_id": "string",
  • "head_block_time": "string",
  • "head_block_producer": "string",
  • "last_irreversible_block_num": 0,
  • "last_irreversible_block_id": "string",
  • "virtual_block_cpu_limit": 0,
  • "virtual_block_net_limit": 0,
  • "block_cpu_limit": 0,
  • "block_net_limit": 0,
  • "server_version_string": "string",
  • "fork_db_head_block_num": 0,
  • "fork_db_head_block_id": "string"
}

push_transaction

This method expects a transaction in JSON format and will attempt to apply it to the blockchain.

Request Body schema: application/json
signatures
Array of strings (Signature)

array of signatures required to authorize transaction

compression
boolean

Compression used, usually false

packed_context_free_data
string

json to hex

packed_trx
string

Transaction object json to hex

Responses

Request samples

Content type
application/json
{
  • "signatures": [
    ],
  • "compression": true,
  • "packed_context_free_data": "string",
  • "packed_trx": "string"
}

Response samples

Content type
application/json
null

send_transaction

This method expects a transaction in JSON format and will attempt to apply it to the blockchain.

Request Body schema: application/json
signatures
Array of strings (Signature)

array of signatures required to authorize transaction

compression
boolean

Compression used, usually false

packed_context_free_data
string

json to hex

packed_trx
string

Transaction object json to hex

Responses

Request samples

Content type
application/json
{
  • "signatures": [
    ],
  • "compression": true,
  • "packed_context_free_data": "string",
  • "packed_trx": "string"
}

Response samples

Content type
application/json
null

push_transactions

This method expects a transaction in JSON format and will attempt to apply it to the blockchain.

Request Body schema: application/json
Array
expiration
required
string (DateTime) ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}...

Date/time string in the format YYYY-MM-DDTHH:MM:SS

ref_block_num
required
integer
ref_block_prefix
required
integer

32-bit portion of block ID

required
WholeNumber (string) or WholeNumber (integer) (WholeNumber)

A whole number

required
WholeNumber (string) or WholeNumber (integer) (WholeNumber)

A whole number

delay_sec
required
integer
required
Array of objects (Action) [ items >= 5 properties ]
required
Array of objects (Action) [ items >= 5 properties ]
Array of integers or strings (Extension) [ items ]

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
null

get_block_header_state

Retrieves the glock header state

Request Body schema: application/json
block_num_or_id
required
string

Provide a block_number or a block_id

Responses

Request samples

Content type
application/json
{
  • "block_num_or_id": "string"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "block_num": 0,
  • "header": {
    },
  • "dpos_proposed_irreversible_blocknum": "string",
  • "dpos_irreversible_blocknum": "string",
  • "bft_irreversible_blocknum": "string",
  • "pending_schedule_lib_num": "string",
  • "pending_schedule_hash": "string",
  • "pending_schedule": {
    },
  • "active_schedule": {
    },
  • "blockroot_merkle": {
    },
  • "producer_to_last_produced": [
    ],
  • "producer_to_last_implied_irb": [
    ],
  • "block_signing_key": "string",
  • "confirm_count": [
    ],
  • "confirmations": [
    ]
}

get_abi

Retrieves the ABI for a contract based on its account name

Request Body schema: application/json
required
NamePrivileged (string) or NameBasic (string) or NameBid (string) or NameCatchAll (string) (Name)

Responses

Request samples

Content type
application/json
{
  • "account_name": "string"
}

Response samples

Content type
application/json
{
  • "version": "string",
  • "types": [
    ],
  • "structs": [
    ],
  • "actions": [
    ],
  • "tables": [
    ],
  • "abi_extensions": [
    ],
  • "error_messages": [
    ],
  • "ricardian_clauses": [
    ],
  • "variants": [
    ]
}

get_currency_balance

Retrieves the current balance

Request Body schema: application/json
required
NamePrivileged (string) or NameBasic (string) or NameBid (string) or NameCatchAll (string) (Name)
required
NamePrivileged (string) or NameBasic (string) or NameBid (string) or NameCatchAll (string) (Name)
symbol
required
string (Symbol) ^([0-9]{1,32}.[0-9]{4} [A-Z]{1,7})$

A string representation of an EOSIO symbol, composed of a float with a precision of 4, and a symbol composed of capital letters between 1-7 letters separated by a space, example 1.0000 ABC.

Responses

Request samples

Content type
application/json
{
  • "code": "string",
  • "account": "string",
  • "symbol": "string"
}

Response samples

Content type
application/json
[
  • "string"
]

get_currency_stats

Retrieves currency stats

Request Body schema: application/json
NamePrivileged (string) or NameBasic (string) or NameBid (string) or NameCatchAll (string) (Name)
symbol
string (Symbol) ^([0-9]{1,32}.[0-9]{4} [A-Z]{1,7})$

A string representation of an EOSIO symbol, composed of a float with a precision of 4, and a symbol composed of capital letters between 1-7 letters separated by a space, example 1.0000 ABC.

Responses

Request samples

Content type
application/json
{
  • "code": "string",
  • "symbol": "string"
}

Response samples

Content type
application/json
null

get_required_keys

Returns the required keys needed to sign a transaction.

Request Body schema: application/json
required
object (Transaction) >= 8 properties
available_keys
required
Array of strings (PublicKey)

Provide the available keys

Responses

Request samples

Content type
application/json
{
  • "transaction": {
    },
  • "available_keys": [
    ]
}

Response samples

Content type
application/json
null

get_producers

Retrieves producers list

Request Body schema: application/json
limit
required
string

total number of producers to retrieve

lower_bound
required
string

In conjunction with limit can be used to paginate through the results. For example, limit=10 and lower_bound=10 would be page 2

json
boolean

return result in JSON format

Responses

Request samples

Content type
application/json
{
  • "limit": "string",
  • "lower_bound": "string",
  • "json": true
}

Response samples

Content type
application/json
{
  • "active": [
    ],
  • "pending": [
    ],
  • "proposed": [
    ]
}

get_raw_code_and_abi

Retrieves raw code and ABI for a contract based on account name

Request Body schema: application/json
required
NamePrivileged (string) or NameBasic (string) or NameBid (string) or NameCatchAll (string) (Name)

Responses

Request samples

Content type
application/json
{
  • "account_name": "string"
}

Response samples

Content type
application/json
{
  • "account_name": "string",
  • "wasm": "string",
  • "abi": "string"
}

get_scheduled_transaction

Retrieves the scheduled transaction

Request Body schema: application/json
lower_bound
string (DateTimeSeconds) ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}...

Date/time string in the format YYYY-MM-DDTHH:MM:SS.sss

limit
integer

The maximum number of transactions to return

json
boolean

true/false whether the packed transaction is converted to json

Responses

Request samples

Content type
application/json
{
  • "lower_bound": "string",
  • "limit": 0,
  • "json": true
}

Response samples

Content type
application/json
{
  • "transactions": [
    ]
}

get_table_by_scope

Retrieves table scope

Request Body schema: application/json
code
required
string

name of the contract to return table data for

table
string

Filter results by table

lower_bound
string

Filters results to return the first element that is not less than provided value in set

upper_bound
string

Filters results to return the first element that is greater than provided value in set

limit
integer <int32>
Default: 10

Limit number of results returned.

reverse
boolean
Default: false

Reverse the order of returned results

show_payer
boolean
Default: false

Show RAM payer

Responses

Request samples

Content type
application/json
{
  • "code": "string",
  • "table": "string",
  • "lower_bound": "string",
  • "upper_bound": "string",
  • "limit": 10,
  • "reverse": false,
  • "show_payer": false
}

Response samples

Content type
application/json
{
  • "rows": [
    ],
  • "more": "string"
}

get_table_rows

Returns an object containing rows from the specified table.

Request Body schema: application/json
code
required
string

The name of the smart contract that controls the provided table

table
required
string

The name of the table to query

scope
required
string

The account to which this data belongs

index_position
string

Position of the index used, accepted parameters primary, secondary, tertiary, fourth, fifth, sixth, seventh, eighth, ninth , tenth

key_type
string

Type of key specified by index_position (for example - uint64_t or name)

encode_type
string
lower_bound
string

Filters results to return the first element that is not less than provided value in set

upper_bound
string

Filters results to return the first element that is greater than provided value in set

limit
integer <int32>
Default: 10

Limit number of results returned.

reverse
boolean
Default: false

Reverse the order of returned results

show_payer
boolean
Default: false

Show RAM payer

Responses

Request samples

Content type
application/json
{
  • "code": "string",
  • "table": "string",
  • "scope": "string",
  • "index_position": "string",
  • "key_type": "string",
  • "encode_type": "string",
  • "lower_bound": "string",
  • "upper_bound": "string",
  • "limit": 10,
  • "reverse": false,
  • "show_payer": false
}

Response samples

Content type
application/json
{
  • "rows": [
    ]
}

get_kv_table_rows

Returns an object containing rows from the specified kv table.

Request Body schema: application/json
code
required
string

The name of the smart contract that controls the provided kv table

table
required
string

The name of the kv table to query

index_name
required
string

The name of primary or secondary index

encode_type
string ( 'bytes' for arbitray binary index value )

Type of key specified by index_position (for example - uint64_t or name)

index_value
string

index value used for point query encoded as 'encode_type'

lower_bound
string

lower bound index value for ranged query. Query result includes rows specified with lower_bound

upper_bound
string

upper bound index value for ranged query. Query result doesn't include rows specified with upper_bound

limit
integer <int32>

Limit number of results returned.

reverse
boolean

Reverse the order of returned results

Responses

Request samples

Content type
application/json
{
  • "code": "string",
  • "table": "string",
  • "index_name": "string",
  • "encode_type": null,
  • "index_value": "string",
  • "lower_bound": "string",
  • "upper_bound": "string",
  • "limit": 0,
  • "reverse": true
}

Response samples

Content type
application/json
{
  • "rows": [
    ]
}

abi_json_to_bin

Returns an object containing the serialized action data.

Request Body schema: application/json
NamePrivileged (string) or NameBasic (string) or NameBid (string) or NameCatchAll (string) (Name)
NamePrivileged (string) or NameBasic (string) or NameBid (string) or NameCatchAll (string) (Name)
args
object

json object of the action parameters that will be serialized.

Responses

Request samples

Content type
application/json
{
  • "code": "string",
  • "action": "string",
  • "args": { }
}

Response samples

Content type
application/json
{
  • "binargs": "string"
}

abi_bin_to_json

Returns an object containing the deserialized action data.

Request Body schema: application/json
required
NamePrivileged (string) or NameBasic (string) or NameBid (string) or NameCatchAll (string) (Name)
required
NamePrivileged (string) or NameBasic (string) or NameBid (string) or NameCatchAll (string) (Name)
binargs
required
string (Hex) ^(0[xX])?[0-9a-fA-F]*$

Responses

Request samples

Content type
application/json
{
  • "code": "string",
  • "action": "string",
  • "binargs": "string"
}

Response samples

Content type
application/json
"string"

get_code

Returns an object containing the smart contract WASM code.

Request Body schema: application/json
required
NamePrivileged (string) or NameBasic (string) or NameBid (string) or NameCatchAll (string) (Name)
code_as_wasm
required
integer
Default: 1

This must be 1 (true)

Responses

Request samples

Content type
application/json
{
  • "account_name": "string",
  • "code_as_wasm": 1
}

Response samples

Content type
application/json
{
  • "name": "string",
  • "code_hash": "string",
  • "wast": "string",
  • "wasm": "string",
  • "abi": {
    }
}

get_raw_abi

Returns an object containing the smart contract abi.

Request Body schema: application/json
required
NamePrivileged (string) or NameBasic (string) or NameBid (string) or NameCatchAll (string) (Name)

Responses

Request samples

Content type
application/json
{
  • "account_name": "string"
}

Response samples

Content type
application/json
{
  • "account_name": "string",
  • "code_hash": "string",
  • "abi_hash": "string",
  • "abi": "string"
}

get_activated_protocol_features

Retreives the activated protocol features for producer node

Request Body schema: application/json
required
object

Defines the filters to retreive the protocol features by

Responses

Request samples

Content type
application/json
{
  • "params": {
    }
}

Response samples

Content type
application/json
{
  • "activated_protocol_features": [
    ],
  • "more": 0
}

get_accounts_by_authorizers

Given a set of account names and public keys, find all account permission authorities that are, in part or whole, satisfiable

Request Body schema: application/json
Array of (Name (NamePrivileged (string) or NameBasic (string) or NameBid (string) or NameCatchAll (string))) or Authority (object)

List of authorizing accounts and/or actor/permissions

keys
Array of strings (PublicKey)

List of authorizing keys

Responses

Request samples

Content type
application/json
{
  • "accounts": [
    ],
  • "keys": [
    ]
}

Response samples

Content type
application/json
{
  • "accounts": [
    ]
}

Producer APIs

pause

Pause producer node

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
true

resume

Resume producer node

Request Body schema: application/json
object

Resumes activity for producer

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
null

paused

Retreives paused status for producer node

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
true

get_runtime_options

Retreives run time options for producer node

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "max_transaction_time": 0,
  • "max_irreversible_block_age": 0,
  • "produce_time_offset_us": 0,
  • "last_block_time_offset_us": 0,
  • "max_scheduled_transaction_time_per_block_ms": 0,
  • "subjective_cpu_leeway_us": 0,
  • "incoming_defer_ratio": 0
}

update_runtime_options

Update run time options for producer node

Request Body schema: application/json
required
object

Defines the run time options to set for the producer

Responses

Request samples

Content type
application/json
{
  • "options": {
    }
}

Response samples

Content type
application/json
null

get_greylist

Retreives the greylist for producer node

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
[
  • "string"
]

add_greylist_accounts

Adds accounts to grey list for producer node

Request Body schema: application/json
required
object

Responses

Request samples

Content type
application/json
{
  • "params": {
    }
}

Response samples

Content type
application/json
null

remove_greylist_accounts

Removes accounts from greylist for producer node

Request Body schema: application/json
required
object

Responses

Request samples

Content type
application/json
{
  • "params": {
    }
}

Response samples

Content type
application/json
[
  • "string"
]

get_whitelist_blacklist

Retreives the white list and black list for producer node

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "actor_whitelist": [
    ],
  • "actor_blacklist": [
    ],
  • "contract_whitelist": [
    ],
  • "contract_blacklist": [
    ],
  • "action_blacklist": [
    ],
  • "key_blacklist": [
    ]
}

set_whitelist_blacklist

Sets the white list and black list for producer node

Request Body schema: application/json
required
object

Defines the actor whitelist and blacklist, the contract whitelist and blacklist, the action blacklist and key blacklist

Responses

Request samples

Content type
application/json
{
  • "params": {
    }
}

Response samples

Content type
application/json
null

create_snapshot

Creates a snapshot for producer node

Request Body schema: application/json
required
object

Defines the snapshot to be created

Responses

Request samples

Content type
application/json
{
  • "next": {
    }
}

Response samples

Content type
application/json
null

get_integrity_hash

Retreives the integrity hash for producer node

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "integrity_hash": "string",
  • "head_block_id": "string"
}

schedule_protocol_feature_activations

Schedule protocol feature activation for producer node

Request Body schema: application/json
required
object

Responses

Request samples

Content type
application/json
{
  • "schedule": {
    }
}

Response samples

Content type
application/json
null

get_supported_protocol_features

Retreives supported protocol features for producer node

Request Body schema: application/json
required
object

Defines filters based on which to return the supported protocol features

Responses

Request samples

Content type
application/json
{
  • "params": {
    }
}

Response samples

Content type
application/json
[
  • "string"
]

Net APIs

connections

Returns an array of all peer connection statuses.

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
[
  • {
    }
]

connect

Initiate a connection to a specified peer.

Request Body schema: application/json
endpoint
required
string

the endpoint to connect to expressed as either IP address or URL

Responses

Request samples

Content type
application/json
{
  • "endpoint": "string"
}

Response samples

Content type
application/json
"string"

disconnect

Initiate disconnection from a specified peer.

Request Body schema: application/json
endpoint
required
string

the endpoint to disconnect from, expressed as either IP address or URL

Responses

Request samples

Content type
application/json
{
  • "endpoint": "string"
}

Response samples

Content type
application/json
"string"

status

Retrieves the connection status for a specified peer.

Request Body schema: application/json
endpoint
required
string

the endpoint to get the status for, to expressed as either IP address or URL

Responses

Request samples

Content type
application/json
{
  • "endpoint": "string"
}

Response samples

Content type
application/json
{
  • "peer": "string",
  • "connecting": true,
  • "syncing": true,
  • "last_handshake": {
    }
}

Trace APIs

get_block

Returns a block trace object containing retired actions and related metadata.

Request Body schema: application/json
block_num
required
integer

Provide a block number

Responses

Request samples

Content type
application/json
{
  • "block_num": 0
}

Response samples

Content type
application/json
Example
{
  • "id": "string",
  • "number": 0,
  • "previous_id": "string",
  • "status": "string",
  • "timestamp": "string",
  • "producer": "string",
  • "transactions": [
    ]
}

DB Size APIs

get

Retrieves database stats

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "free_bytes": 0,
  • "used_bytes": 0,
  • "size": 0,
  • "indices": [
    ]
}