Skip to main content

iota_sdk.client._node_core_api

NodeCoreAPI Objects

class NodeCoreAPI()

Node core API.

get_health

def get_health(url: str)

Get node health.

Arguments:

  • url - The node's url.

get_node_info

def get_node_info(url: str, auth=None) -> NodeInfo

Get node info.

Arguments:

  • url - The node's url.
  • auth - A JWT or username/password authentication object.

get_info

def get_info() -> NodeInfoWrapper

Return node information together with the url of the used node.

get_peers

def get_peers()

Get the peers of the node.

get_tips

def get_tips() -> List[HexStr]

Request tips from the node.

post_block

def post_block(block: Block) -> HexStr

Post a block.

Arguments:

  • block - The block to post.

Returns:

The block id of the posted block.

get_block_data

def get_block_data(block_id: HexStr) -> Block

Get the block corresponding to the given block id.

get_block_metadata

def get_block_metadata(block_id: HexStr) -> BlockMetadata

Get the block metadata corresponding to the given block id.

get_block_raw

def get_block_raw(block_id: HexStr) -> List[int]

Get the raw bytes of the block corresponding to the given block id.

post_block_raw

def post_block_raw(block_bytes: List[int]) -> HexStr

Post a block as raw bytes.

Returns:

The corresponding block id of the block.

get_output

def get_output(output_id: Union[OutputId, HexStr]) -> OutputWithMetadata

Get the output corresponding to the given output id.

Returns:

The output itself with its metadata.

get_output_metadata

def get_output_metadata(output_id: Union[OutputId, HexStr]) -> OutputMetadata

Get the output metadata corresponding to the given output id.

Returns:

The output metadata.

get_milestone_by_id

def get_milestone_by_id(milestone_id: HexStr) -> MilestonePayload

Get the milestone corresponding to the given milestone id.

Returns:

The milestone payload.

get_milestone_by_id_raw

def get_milestone_by_id_raw(milestone_id: HexStr) -> List[int]

Get the raw bytes of the milestone corresponding to the given milestone id.

Returns:

The raw bytes of the milestone.

get_milestone_by_index

def get_milestone_by_index(index: int) -> MilestonePayload

Get the milestone by the given milestone index.

Returns:

The milestone payload.

get_milestone_by_index_raw

def get_milestone_by_index_raw(index: int) -> List[int]

Get the raw bytes of the milestone corresponding to the given milestone index.

Returns:

The raw bytes of the milestone.

get_utxo_changes_by_id

def get_utxo_changes_by_id(milestone_id: HexStr) -> UtxoChanges

Get the UTXO changes applied in the given milestone.

get_utxo_changes_by_index

def get_utxo_changes_by_index(index: int) -> UtxoChanges

Get the UTXO changes applied at the given milestone index.

get_receipts

def get_receipts()

Get all receipts.

get_receipts_migrated_at

def get_receipts_migrated_at(milestone_index: int)

Get the receipts that were migrated at the given milestone index.

get_treasury

def get_treasury()

Get the treasury output.

get_included_block

def get_included_block(transaction_id: HexStr) -> Block

Returns the included block of the given transaction.

Returns:

The included block.

get_included_block_metadata

def get_included_block_metadata(transaction_id: HexStr) -> BlockMetadata

Returns the metadata of the included block of the given transaction.

Returns:

The metadata of the included block.

call_plugin_route

def call_plugin_route(base_plugin_path: str,
method: str,
endpoint: str,
query_params: [str] = None,
request: str = None)

Extension method which provides request methods for plugins.

Arguments:

  • base_plugin_path - The base path of the routes provided by the plugin.
  • method - The HTTP method.
  • endpoint - The endpoint to query provided by the plugin.
  • query_params - The parameters of the query.
  • request - The request object sent to the endpoint of the plugin.