From e88a4b1d2003aa44444a09577aaa18010fe76b10 Mon Sep 17 00:00:00 2001 From: Snider Date: Sun, 19 Oct 2025 14:49:09 +0100 Subject: [PATCH] Update OpenAPI spec for Lethean Blockchain API Expanded the OpenAPI specification to include new endpoints, updated server URLs, and revised schema definitions for improved clarity and coverage. The API description was updated and several new models and parameters were added to support additional blockchain and daemon functionality. --- utils/sdk/spec/oas-3.0.0.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/sdk/spec/oas-3.0.0.json b/utils/sdk/spec/oas-3.0.0.json index 61f62dd2..d5e5b5e3 100644 --- a/utils/sdk/spec/oas-3.0.0.json +++ b/utils/sdk/spec/oas-3.0.0.json @@ -1 +1 @@ -{"openapi":"3.0.0","info":{"title":"Lethean Blockchain API","description":"New API layer for Lethean","contact":{"name":"Lethean","url":"https:\/\/lt.hn\/"},"license":{"name":"EUPL-1.2","url":"https:\/\/joinup.ec.europa.eu\/software\/page\/eupl\/licence-eupl"},"version":"6.0.1"},"servers":[{"url":"http:\/\/localhost:8000","description":"server on localhost"}],"paths":{"\/info\/version":{"get":{"description":"Returns the current version of the API.","summary":"Get API version","operationId":"version","tags":["Info"],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/VersionDto"}}}}},"parameters":[]}},"\/block\/{hash}":{"get":{"summary":"Get a block by its hash","operationId":"getBlockByHash","tags":["Block"],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BlockDetailsDto"}}}}},"parameters":[{"name":"hash","description":"The hash of the block to retrieve","in":"path","required":true,"deprecated":false,"schema":{"type":"string"}}]}}},"components":{"schemas":{"VersionDto":{"type":"object","properties":{"version":{"type":"string"},"version_long":{"type":"string"},"major":{"type":"string"},"minor":{"type":"string"},"revision":{"type":"string"}},"required":[]},"TransactionOutputDto":{"type":"object","properties":{"amount":{"type":"integer"},"global_index":{"type":"integer"},"is_spent":{"type":"boolean"},"minimum_sigs":{"type":"integer","minimum":0,"maximum":4294967295},"pub_keys":{"type":"array","items":{"type":"string"}}},"required":[]},"TransactionInputDto":{"type":"object","properties":{"amount":{"type":"integer"},"global_indexes":{"type":"array","items":{"type":"integer"}},"htlc_origin":{"type":"string"},"kimage_or_ms_id":{"type":"string"},"multisig_count":{"type":"integer","minimum":0,"maximum":4294967295}},"required":[]},"TransactionExtraDto":{"type":"object","properties":{"type":{"type":"string"},"short_view":{"type":"string"},"details_view":{"type":"string"}},"required":[]},"TransactionAttachmentDto":{"type":"object","properties":{"type":{"type":"string"},"short_view":{"type":"string"},"details_view":{"type":"string"}},"required":[]},"TransactionDetailsDto":{"type":"object","properties":{"amount":{"type":"integer"},"attachments":{"type":"array","items":{"$ref":"#\/components\/schemas\/TransactionAttachmentDto"}},"blob":{"type":"string"},"blob_size":{"type":"integer"},"extra":{"type":"array","items":{"$ref":"#\/components\/schemas\/TransactionExtraDto"}},"fee":{"type":"integer"},"id":{"type":"string"},"ins":{"type":"array","items":{"$ref":"#\/components\/schemas\/TransactionInputDto"}},"keeper_block":{"type":"integer","format":"int64"},"object_in_json":{"type":"string"},"outs":{"type":"array","items":{"$ref":"#\/components\/schemas\/TransactionOutputDto"}},"pub_key":{"type":"string"},"timestamp":{"type":"integer"}},"required":[]},"BlockDetailsDto":{"type":"object","properties":{"actual_timestamp":{"type":"integer"},"already_generated_coins":{"type":"string"},"base_reward":{"type":"integer"},"blob":{"type":"string"},"block_cumulative_size":{"type":"integer"},"block_tself_size":{"type":"integer"},"cumulative_diff_adjusted":{"type":"string"},"cumulative_diff_precise":{"type":"string"},"difficulty":{"type":"string"},"effective_fee_median":{"type":"integer"},"height":{"type":"integer"},"id":{"type":"string"},"is_orphan":{"type":"boolean"},"miner_text_info":{"type":"string"},"object_in_json":{"type":"string"},"penalty":{"type":"integer"},"pow_seed":{"type":"string"},"prev_id":{"type":"string"},"summary_reward":{"type":"integer"},"this_block_fee_median":{"type":"integer"},"timestamp":{"type":"integer"},"total_fee":{"type":"integer"},"total_txs_size":{"type":"integer"},"transactions_details":{"type":"array","items":{"$ref":"#\/components\/schemas\/TransactionDetailsDto"}},"type":{"type":"integer","minimum":0,"maximum":4294967295}},"required":[]}}}} \ No newline at end of file +{"openapi":"3.0.0","info":{"title":"Lethean Blockchain API","description":"OpenAPI for Lethean Blockchain","contact":{"name":"Lethean","url":"https:\/\/lt.hn\/"},"license":{"name":"EUPL-1.2","url":"https:\/\/joinup.ec.europa.eu\/software\/page\/eupl\/licence-eupl"},"version":"6.0.1"},"servers":[{"url":"http:\/\/127.0.0.1:36943","description":"Local Daemon"},{"url":"http:\/\/seed.lethean.io:36943","description":"Seed Server"}],"paths":{"\/info":{"get":{"summary":"Get detailed information about the blockchain and daemon state","operationId":"getInfo","tags":["Info"],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/InfoModel"}}}}},"parameters":[{"name":"flags","description":"Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median.","in":"query","required":false,"deprecated":false,"schema":{"type":"string"}}]}},"\/info\/version":{"get":{"description":"Returns the current version of the API.","summary":"Get API version","operationId":"version","tags":["Info"],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/VersionModel"}}}}},"parameters":[]}},"\/block":{"get":{"summary":"Get one or more blocks, with optional pagination.","operationId":"getBlocks","tags":["Block"],"responses":{"404":{"description":"text\/plain"},"400":{"description":"text\/plain"},"200":{"description":"A list of block objects.","content":{"application\/json":{"schema":{"type":"array","items":{"$ref":"#\/components\/schemas\/BlockDetailsModel"}}}}}},"parameters":[]}},"\/block\/template":{"post":{"summary":"Create a block template for mining","operationId":"createBlockTemplate","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BlockTemplateRequestModel"}}}},"tags":["Block"],"responses":{"500":{"description":"text\/plain"},"400":{"description":"text\/plain"},"200":{"description":"OK","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BlockTemplateModel"}}}}},"parameters":[]}},"\/block\/submit":{"post":{"summary":"Submit a new block to the network","operationId":"submitBlock","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SubmitBlockRequestModel"}}}},"tags":["Block"],"responses":{"406":{"description":"text\/plain"},"400":{"description":"text\/plain"},"200":{"description":"OK","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SubmitBlockResponseModel"}}}}},"parameters":[]}},"\/block\/height":{"get":{"summary":"Get the current blockchain height","operationId":"getHeight","tags":["Block"],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/HeightModel"}}}}},"parameters":[]}},"\/block\/{identifier}":{"get":{"summary":"Get a block by its hash or height (ID)","operationId":"getBlock","tags":["Block"],"responses":{"404":{"description":"text\/plain"},"400":{"description":"text\/plain"},"200":{"description":"OK","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BlockDetailsModel"}}}}},"parameters":[{"name":"identifier","description":"The hash (hex string) or height (integer) of the block to retrieve.","in":"path","required":true,"deprecated":false,"schema":{"type":"string"}}]}}},"components":{"schemas":{"DbStatInfoModel":{"type":"object","properties":{"tx_count":{"type":"integer"},"write_tx_count":{"type":"integer"},"map_size":{"type":"integer"}},"required":[]},"TxPoolPerformanceModel":{"type":"object","properties":{"tx_processing_time":{"type":"integer"},"check_inputs_types_supported_time":{"type":"integer"},"expiration_validate_time":{"type":"integer"},"validate_amount_time":{"type":"integer"},"validate_alias_time":{"type":"integer"},"check_keyimages_ws_ms_time":{"type":"integer"},"check_inputs_time":{"type":"integer"},"begin_tx_time":{"type":"integer"},"update_db_time":{"type":"integer"},"db_commit_time":{"type":"integer"},"check_post_hf4_balance":{"type":"integer"}},"required":[]},"MaintainersInfoModel":{"type":"object","properties":{"ver_major":{"type":"integer","minimum":0,"maximum":255},"ver_minor":{"type":"integer","minimum":0,"maximum":255},"ver_revision":{"type":"integer","minimum":0,"maximum":255},"build_no":{"type":"integer","minimum":0,"maximum":4294967295},"mode":{"type":"integer","minimum":0,"maximum":255}},"required":[]},"InfoModel":{"type":"object","properties":{"height":{"type":"integer"},"tx_count":{"type":"integer"},"tx_pool_size":{"type":"integer"},"alt_blocks_count":{"type":"integer"},"outgoing_connections_count":{"type":"integer"},"incoming_connections_count":{"type":"integer"},"synchronized_connections_count":{"type":"integer"},"white_peerlist_size":{"type":"integer"},"grey_peerlist_size":{"type":"integer"},"current_blocks_median":{"type":"integer"},"alias_count":{"type":"integer"},"current_max_allowed_block_size":{"type":"integer"},"daemon_network_state":{"type":"string"},"synchronization_start_height":{"type":"integer"},"max_net_seen_height":{"type":"integer"},"mi":{"$ref":"#\/components\/schemas\/MaintainersInfoModel"},"pos_allowed":{"type":"boolean"},"pos_difficulty":{"type":"string"},"pow_difficulty":{"type":"integer"},"default_fee":{"type":"integer"},"minimum_fee":{"type":"integer"},"is_hardfork_active":{"type":"array","items":{"type":"boolean"}},"net_time_delta_median":{"type":"integer","format":"int64"},"current_network_hashrate_50":{"type":"integer"},"current_network_hashrate_350":{"type":"integer"},"seconds_for_10_blocks":{"type":"integer"},"seconds_for_30_blocks":{"type":"integer"},"transactions_cnt_per_day":{"type":"array","items":{"type":"integer"}},"transactions_volume_per_day":{"type":"array","items":{"type":"integer"}},"last_pos_timestamp":{"type":"integer"},"last_pow_timestamp":{"type":"integer"},"total_coins":{"type":"string"},"last_block_size":{"type":"integer"},"tx_count_in_last_block":{"type":"integer"},"pos_sequence_factor":{"type":"number","format":"double"},"pow_sequence_factor":{"type":"number","format":"double"},"block_reward":{"type":"integer"},"last_block_total_reward":{"type":"integer"},"pos_diff_total_coins_rate":{"type":"integer"},"last_block_timestamp":{"type":"integer"},"last_block_hash":{"type":"string"},"pos_block_ts_shift_vs_actual":{"type":"integer","format":"int64"},"outs_stat":{"type":"object","additionalProperties":{"type":"integer"}},"performance_data":{"$ref":"#\/components\/schemas\/PerformanceModel"},"offers_count":{"type":"integer"},"expiration_median_timestamp":{"type":"integer"}},"required":[]},"SubmitBlockResponseModel":{"type":"object","properties":{"status":{"type":"string"}},"required":[]},"VersionModel":{"type":"object","properties":{"version":{"type":"string"},"version_long":{"type":"string"},"major":{"type":"string"},"minor":{"type":"string"},"revision":{"type":"string"}},"required":[]},"TransactionOutputModel":{"type":"object","properties":{"amount":{"type":"integer"},"global_index":{"type":"integer"},"is_spent":{"type":"boolean"},"minimum_sigs":{"type":"integer","minimum":0,"maximum":4294967295},"pub_keys":{"type":"array","items":{"type":"string"}}},"required":[]},"TransactionInputModel":{"type":"object","properties":{"amount":{"type":"integer"},"global_indexes":{"type":"array","items":{"type":"integer"}},"htlc_origin":{"type":"string"},"kimage_or_ms_id":{"type":"string"},"multisig_count":{"type":"integer","minimum":0,"maximum":4294967295}},"required":[]},"PerformanceModel":{"type":"object","properties":{"block_processing":{"$ref":"#\/components\/schemas\/BlockProcessingPerformanceModel"},"tx_processing":{"$ref":"#\/components\/schemas\/TxProcessingPerformanceModel"},"tx_pool":{"$ref":"#\/components\/schemas\/TxPoolPerformanceModel"},"db_stat_info":{"$ref":"#\/components\/schemas\/DbStatInfoModel"}},"required":[]},"TransactionExtraModel":{"type":"object","properties":{"type":{"type":"string"},"short_view":{"type":"string"},"details_view":{"type":"string"}},"required":[]},"TxProcessingPerformanceModel":{"type":"object","properties":{"tx_check_inputs":{"type":"integer"},"tx_add_one_tx":{"type":"integer"},"tx_process_extra":{"type":"integer"},"tx_process_attachment":{"type":"integer"},"tx_process_inputs":{"type":"integer"},"tx_push_global_index":{"type":"integer"},"tx_check_exist":{"type":"integer"},"tx_print_log":{"type":"integer"},"tx_prapare_append":{"type":"integer"},"tx_append":{"type":"integer"},"tx_append_rl_wait":{"type":"integer"},"tx_append_is_expired":{"type":"integer"},"tx_store_db":{"type":"integer"},"tx_check_inputs_prefix_hash":{"type":"integer"},"tx_check_inputs_attachment_check":{"type":"integer"},"tx_check_inputs_loop":{"type":"integer"},"tx_check_inputs_loop_kimage_check":{"type":"integer"},"tx_check_inputs_loop_ch_in_val_sig":{"type":"integer"},"tx_check_inputs_loop_scan_outputkeys_get_item_size":{"type":"integer"},"tx_check_inputs_loop_scan_outputkeys_relative_to_absolute":{"type":"integer"},"tx_check_inputs_loop_scan_outputkeys_loop":{"type":"integer"},"tx_check_inputs_loop_scan_outputkeys_loop_get_subitem":{"type":"integer"},"tx_check_inputs_loop_scan_outputkeys_loop_find_tx":{"type":"integer"},"tx_check_inputs_loop_scan_outputkeys_loop_handle_output":{"type":"integer"},"tx_mixin_count":{"type":"integer"}},"required":[]},"TxGenerationContextModel":{"type":"object","properties":{"asset_ids":{"type":"array","items":{"type":"string"}},"blinded_asset_ids":{"type":"array","items":{"type":"string"}},"amount_commitments":{"type":"array","items":{"type":"string"}},"asset_id_blinding_masks":{"type":"array","items":{"type":"string"}},"amounts":{"type":"array","items":{"type":"string"}},"amount_blinding_masks":{"type":"array","items":{"type":"string"}},"pseudo_outs_blinded_asset_ids":{"type":"array","items":{"type":"string"}},"pseudo_outs_plus_real_out_blinding_masks":{"type":"array","items":{"type":"string"}},"real_zc_ins_asset_ids":{"type":"array","items":{"type":"string"}},"zc_input_amounts":{"type":"array","items":{"type":"integer"}},"pseudo_out_amount_commitments_sum":{"type":"string"},"pseudo_out_amount_blinding_masks_sum":{"type":"string"},"real_in_asset_id_blinding_mask_x_amount_sum":{"type":"string"},"amount_commitments_sum":{"type":"string"},"amount_blinding_masks_sum":{"type":"string"},"asset_id_blinding_mask_x_amount_sum":{"type":"string"},"ao_asset_id":{"type":"string"},"ao_asset_id_pt":{"type":"string"},"ao_amount_commitment":{"type":"string"},"ao_amount_blinding_mask":{"type":"string"},"ao_commitment_in_outputs":{"type":"boolean"},"tx_key_pub":{"type":"string"},"tx_key_sec":{"type":"string"},"tx_pub_key_p":{"type":"string"}},"required":[]},"HeightModel":{"type":"object","properties":{"height":{"type":"integer"}},"required":[]},"BlockTemplateModel":{"type":"object","properties":{"blocktemplate_blob":{"type":"string"},"difficulty":{"type":"string"},"height":{"type":"integer"},"miner_tx_tgc":{"$ref":"#\/components\/schemas\/TxGenerationContextModel"},"block_reward_without_fee":{"type":"integer"},"block_reward":{"type":"integer"},"txs_fee":{"type":"integer"},"prev_hash":{"type":"string"},"seed":{"type":"string"}},"required":[]},"TransactionAttachmentModel":{"type":"object","properties":{"type":{"type":"string"},"short_view":{"type":"string"},"details_view":{"type":"string"}},"required":[]},"BlockDetailsModel":{"type":"object","properties":{"actual_timestamp":{"type":"integer"},"already_generated_coins":{"type":"string"},"base_reward":{"type":"integer"},"blob":{"type":"string"},"block_cumulative_size":{"type":"integer"},"block_tself_size":{"type":"integer"},"cumulative_diff_adjusted":{"type":"string"},"cumulative_diff_precise":{"type":"string"},"difficulty":{"type":"string"},"effective_fee_median":{"type":"integer"},"height":{"type":"integer"},"id":{"type":"string"},"is_orphan":{"type":"boolean"},"miner_text_info":{"type":"string"},"object_in_json":{"type":"string"},"penalty":{"type":"integer"},"pow_seed":{"type":"string"},"prev_id":{"type":"string"},"summary_reward":{"type":"integer"},"this_block_fee_median":{"type":"integer"},"timestamp":{"type":"integer"},"total_fee":{"type":"integer"},"total_txs_size":{"type":"integer"},"transactions_details":{"type":"array","items":{"$ref":"#\/components\/schemas\/TransactionDetailsModel"}},"type":{"type":"integer","minimum":0,"maximum":4294967295}},"required":[]},"PosEntryModel":{"type":"object","properties":{"amount":{"type":"integer"},"g_index":{"type":"integer"},"keyimage":{"type":"string"},"block_timestamp":{"type":"integer"},"stake_unlock_time":{"type":"integer"},"tx_id":{"type":"string"},"tx_out_index":{"type":"integer"},"wallet_index":{"type":"integer"}},"required":[]},"TransactionDetailsModel":{"type":"object","properties":{"amount":{"type":"integer"},"attachments":{"type":"array","items":{"$ref":"#\/components\/schemas\/TransactionAttachmentModel"}},"blob":{"type":"string"},"blob_size":{"type":"integer"},"extra":{"type":"array","items":{"$ref":"#\/components\/schemas\/TransactionExtraModel"}},"fee":{"type":"integer"},"id":{"type":"string"},"ins":{"type":"array","items":{"$ref":"#\/components\/schemas\/TransactionInputModel"}},"keeper_block":{"type":"integer","format":"int64"},"object_in_json":{"type":"string"},"outs":{"type":"array","items":{"$ref":"#\/components\/schemas\/TransactionOutputModel"}},"pub_key":{"type":"string"},"timestamp":{"type":"integer"}},"required":[]},"BlockProcessingPerformanceModel":{"type":"object","properties":{"block_processing_time_0":{"type":"integer"},"block_processing_time_1":{"type":"integer"},"target_calculating_time_2":{"type":"integer"},"longhash_calculating_time_3":{"type":"integer"},"all_txs_insert_time_5":{"type":"integer"},"etc_stuff_6":{"type":"integer"},"insert_time_4":{"type":"integer"},"raise_block_core_event":{"type":"integer"},"validate_miner_transaction_time":{"type":"integer"},"collect_rangeproofs_data_from_tx_time":{"type":"integer"},"verify_multiple_zc_outs_range_proofs_time":{"type":"integer"},"target_calculating_enum_blocks":{"type":"integer"},"target_calculating_calc":{"type":"integer"},"pos_validate_ki_search":{"type":"integer"},"pos_validate_get_out_keys_for_inputs":{"type":"integer"},"pos_validate_zvp":{"type":"integer"}},"required":[]},"BlockTemplateRequestModel":{"type":"object","properties":{"miner_address":{"type":"string"},"stakeholder_address":{"type":"string"},"ex_nonce":{"type":"string"},"pos_block":{"type":"boolean"},"ignore_pow_ts_check":{"type":"boolean"},"pe":{"$ref":"#\/components\/schemas\/PosEntryModel"},"explicit_txs":{"type":"array","items":{"type":"string"}}},"required":[]},"SubmitBlockRequestModel":{"type":"object","properties":{"block_blob":{"type":"string"}},"required":[]}}}} \ No newline at end of file