Package: iota-client-python
IOTA Client Python LibraryRequirementsRust 1.52.0+Python 3.6+Try Run w/ Local HornetRun your local Hornet$ git clone git@github.com:gohornet/hornet.gitcheckoutdevelopbranchModify yourcreate_snapshot_alphanet.sh, modify Line 14 togo run "..\main.go" tool snapgen alphanet1 96f9de0989e77d0e150e850a5a600e83045fa57419eaf3b20225b763d4e23813 1000000000 "snapshots\alphanet1\full_export.bin"Go tohornet/alphanet$ ./run_coo_bootstrap.shTo build the iota_client python library by yourself, there are two ways.By using thecargoGo tobindings/python/native$ cargo build --releaseThe built library is located intarget/release/On MacOS, renamelibiota_client.dylibtoiota_client.so, on Windows, renameiota_client.dlltoiota_client.pyd, and on Linuxlibiota_client.sotoiota_client.so.Copy your renamed library tobindings/python/examples/Go tobindings/python/examples$ python example.pyBy usingmaturinGo tobindings/python/native$ pip3 install maturin$ maturin develop$ maturin build --manylinux offThe wheel file is now created inbindings/python/native/target/wheels$ pip3 install [THE_BUILT_WHEEL_FILE]To use the pre-build librariesTo use the pre-built libraries for linux/macos/windows, please check theArtifactsfiles generated by the Github Action in the last commit. For example, there are the following 12 wheels inthis commit. Please download the one which matches your os and python version.linux-iota-client-py3.6-wheellinux-iota-client-py3.7-wheellinux-iota-client-py3.8-wheellinux-iota-client-py3.9-wheelosx-iota-client-py3.6-wheelosx-iota-client-py3.7-wheelosx-iota-client-py3.8-wheelosx-iota-client-py3.9-wheelwindows-iota-client-py3.6-wheelswindows-iota-client-py3.7-wheelswindows-iota-client-py3.8-wheelswindows-iota-client-py3.9-wheelsNOTE: Please download the wheel files generated in the commit version you want to use.$ pip3 install [THE_DOWNLOADED_WHEEL_FILE]Install from pip directly.pip3 install iota-client-pythonConnecting to a MQTT broker using raw ip doesn't work with TCP. This is a limitation of rustls.TestingInstalltox$ pip install toxBuild the library$ python setup.py installTo test install tox globally and run$ tox -e pyPython Exampleimportiota_clientimportosLOCAL_NODE_URL="http://0.0.0.0:14265"# NOTE! Load the seed from your env path instead# NEVER assign the seed directly in your codes!# DO NOT USE THIS!!:# SEED = "256a818b2aac458941f7274985a410e57fb750f3a3a67969ece5bd9ae7eef5b2"# USE THIS INSTEADSEED=os.getenv('MY_IOTA_SEED')EMPTY_ADDRESS="atoi1qzt0nhsf38nh6rs4p6zs5knqp6psgha9wsv74uajqgjmwc75ugupx3y7x0r"client=iota_client.Client(nodes_name_password=[[node=LOCAL_NODE_URL]],node_sync_disabled=True)defmain():print('get_health()')print(f'health:{client.get_health()}')print('get_info()')print(f'node_info:{client.get_info()}')print('get_tips()')print(f'tips:{client.get_tips()}')print('get_addresses')address_changed_list=client.get_addresses(seed=SEED,account_index=0,input_range_begin=0,input_range_end=10,get_all=True)print(f'address_changed list:{address_changed_list}')# Get the (address, changed ) for the first found addressaddress,changed=address_changed_list[0]print(f'get_address_balance() for address{address}')print(f'balance:{client.get_address_balance(address)}')print(f'get_address_balance() for address{EMPTY_ADDRESS}')print(f'balance:{client.get_address_balance(EMPTY_ADDRESS)}')print(f'get_address_outputs() for address{EMPTY_ADDRESS}')print(f'outputs():{client.get_address_outputs(EMPTY_ADDRESS)}')print(f'message() 100 tokens to address{EMPTY_ADDRESS}')message_id=client.message(seed=SEED,outputs=[{'address':EMPTY_ADDRESS,'amount':100}])['message_id']print(f'Token sent with message_id:{message_id}')print(f'Please check http://127.0.0.1:14265/api/v1/messages/{message_id}')print(f'get_message_metadata() for message_id{message_id}')message_metadata=client.get_message_metadata(message_id)print(f'message_metadata:{message_metadata}')print(f'get_message_data() for message_id{message_id}')message_data=client.get_message_data(message_id)print(f'message_data:{message_data}')print(f'get_message_raw() for message_id{message_id}')message_raw=client.get_message_raw(message_id)print(f"raw_data ={message_raw.encode('utf-8')}")print(f"Note the raw data is exactly the same from http://127.0.0.1:14265/api/v1/messages/{message_id}/raw")print(', which is not utf-8 format. The utf-8 format here is just for ease of demonstration')print(f'get_message_children() for message_id{message_id}')children=client.get_message_children(message_id)print(f"children:{children}")print(f'message() Indexation')message_id_indexation=client.message(index="Hello",data=[84,97,110,103,108,101])print(f'Indexation sent with message_id:{message_id_indexation}')print(f'Please check http://127.0.0.1:14265/api/v1/messages/{message_id_indexation}')# Note that in rust we need to specify the parameter type explicitly, so if the user wants# to use the utf-8 string as the data, then the `data_str` field can be used.print(f'message() Indexation')message_id_indexation=client.message(index="Hi",data_str="Tangle")print(f'Indexation sent with message_id:{message_id_indexation}')print(f'Please check http://127.0.0.1:14265/api/v1/messages/{message_id_indexation}')print(f"get_message_index() for index 'Hello'")message_id_indexation_queried=client.get_message_index("Hello")print(f'Indexation:{message_id_indexation_queried}')print(f"find_messages() for indexation_keys = ['Hello']")messages=client.find_messages(indexation_keys=["Hello"])print(f'Messages:{messages}')print(f"get_unspent_address()")unspent_addresses=client.get_unspent_address(seed=SEED)print(f'(unspent_address, index):{unspent_addresses}')print(f"get_balance()")balance=client.get_balance(seed=SEED)print(f'balance:{balance}')addresses=[]foraddress,_changedinaddress_changed_list:addresses.append(address)print(f"get_address_balances() for{addresses}")balances=client.get_address_balances(addresses)print(f'balances:{balance}')if__name__=="__main__":main()API ReferenceNote that in the following APIs, the corresponding exception will be returned if an error occurs.
Also for all the optional values, the default values are the same as the ones in the Rust version.Clientconstructor(network (optional), storage (optional), password (optional), polling_interval (optional)):AccountManagerCreates a new instance of the Client.ParamTypeDefaultDescription[network]strundefinedThe network[primary_node_jwt_name_password]list[str]undefinedAn array of array with node URLs and optional JWT and basic auth name and password (length 1 is only the url, length 2 is url with JWT, length 3 is url with basic auth name and password and length 4 is url with JWT and basic auth name and password)[primary_pow_node_jwt_name_password]list[str]undefinedAn array of array with node URLs and optional JWT and basic auth name and password (length 1 is only the url, length 2 is url with JWT, length 3 is url with basic auth name and password and length 4 is url with JWT and basic auth name and password)[nodes_name_password]list[]list[str]undefinedAn array of array with node URLs and optional JWT and basic auth name and password (length 1 is only the url, length 2 is url with JWT, length 3 is url with basic auth name and password and length 4 is url with JWT and basic auth name and password)[permanodes_name_password]list[]list[str]undefinedAn array of array with node URLs and optional JWT and basic auth name and password (length 1 is only the url, length 2 is url with JWT, length 3 is url with basic auth name and password and length 4 is url with JWT and basic auth name and password)[node_sync_interval]intundefinedThe interval for the node syncing process[node_sync_disabled]boolundefinedDisables the node syncing process. Every node will be considered healthy and ready to use[node_pool_urls]strundefinedAn array of node pool URLs[quorum]boolfalseBool to define if quorum should be used[quorum_size]int3An int that defines how many nodes should be used for quorum[quorum_threshold]int66Define the % of nodes that need to return the same response to accept it[request_timeout]intundefinedSets the default HTTP request timeout[api_timeout]dictundefinedThe API to set the request timeout. Key: 'GetHealth', 'GetInfo', 'GetPeers', 'GetTips', 'PostMessage', 'GetOutput', 'GetMilestone' Value: timeout in milliseconds[local_pow]boolundefinedFlag determining if PoW should be done locally or remotely[tips_interval]intundefinedTime between requests for new tips during PoW[mqtt_broker_options]BrokerOptionsundefinedSets the options for the MQTT connection with the nodeReturnsThe constructedClient.Full Node APIsget_health(): boolGets the node health status.Returnswhether the node is healthy.get_info(): NodeInfoWrapperGets information about the node.ReturnstheNodeInfoWrapper.get_peers(): list[PeerDto]Gets peers of the node.Returnsthe list ofPeerDto.get_tips(): list[str]Gets non-lazy tips.Returnstwo non-lazy tips' message ids in list.post_message(msg): strSubmits a message.ParamTypeDefaultDescription[msg]MessageundefinedThe message to submitReturnsthe message id of the submitted message.get_output(output_id): OutputResponseGets the UTXO outputs associated with the given output id.ParamTypeDefaultDescription[output_id]strundefinedThe id of the output to searchReturnsthe OutputResponse[#outputresponse].get_address_balance(address): BalanceAddressResponseGets the balance in the address.ParamTypeDefaultDescription[address]list[str]undefinedThe address Bech32 stringReturnstheBalanceAddressResponse.get_address_outputs(address, options (optional)): list[UtxoInput]Gets the UTXO outputs associated with the given address.ParamTypeDefaultDescription[address]strundefinedThe address Bech32 string[options][AddressOutputsOptions]undefinedThe query filtersReturnsthe list ofUtxoInput.find_outputs(output_ids (optional), addresses (optional)): list[OutputResponse]Gets the UTXO outputs associated with the given output ids and addresses.ParamTypeDefaultDescription[output_ids]list[str]undefinedThe list of addresses to search[addresses]list[str]undefinedThe list of output ids to searchReturnsthe list ofOutputResponse.get_milestone(index): MilestoneDtoGets the milestone by the given index.ParamTypeDefaultDescription[index]intundefinedThe index of the milestoneReturnstheMilestoneDto.get_milestone_utxo_changes(index): MilestoneUTXOChangesGets the utxo changes by the given milestone index.ParamTypeDefaultDescription[index]intundefinedThe index of the milestoneReturnstheMilestoneUTXOChanges.get_receipts(): VecGet all receipts.ReturnstheReceiptDto.get_receipts_migrated_at(index): VecGet all receipts for a given milestone index.ParamTypeDefaultDescription[index]intundefinedThe index of the milestoneReturnstheReceiptDto.get_treasury(): TreasuryResponseGet the treasury amount.ReturnstheTreasuryResponse.get_included_message(): MessageGet the included message of a transaction.ParamTypeDescription[index]strThe id of the transactionReturnsthe newMessage.High-Level APIsmessage(seed (optional), account_index (optional), initial_address_index (optional), inputs (optional), input_range_begin (optional), input_range_end (optional), outputs (optional), dust_allowance_outputs (optional), index (optional), index_raw (optional), data (optional), data_str (optional), parents (optional)): MessageBuild a message.ParamTypeDefaultDescription[seed]strundefinedThe hex-encoded seed of the account to spend[account_index]intundefinedThe account index[initial_address_index]intundefinedThe initial address index[inputs]list[UtxoInput]undefinedUtxoInputs[input_range_begin]intundefinedThe begin index of the input[input_range_end]intundefinedThe end index of the input[outputs]list[Output]undefinedOutputs[dust_allowance_outputs]list[Output]undefinedDust allowance output to the transaction[index]strundefinedThe indexation string[index_raw]list[int]undefinedThe indexation byte array[data]list[int]undefinedThe data in bytes[data_str]strundefinedThe data string[parents]list[str]undefinedThe message ids of the parentsget_output_amount_and_address(output): (int, AddressDto, bool)Get the output amount and address from the provided OutputDto.ParamTypeDefaultDescription[output]OutputDtoundefinedThe outputs where we want to send them tokensReturnsthe tuple of (the amount of tokens, the address, the indicator of the output type:trueforSignatureLockedSingle,falseforSignatureLockedDustAllowance).prepare_transaction(inputs, outputs): PreparedTransactionDataPrepare a transaction.ParamTypeDefaultDescription[inputs]list[UtxoInput]undefinedThe UTXOInputs where we want to send tokens from[outputs]list[Output]undefinedThe outputs where we want to send them tokensReturnsthe prepared transaction data.sign_transaction(prepared_transaction_data, seed, start_index, end_index): PayloadSign the transaction.ParamTypeDefaultDescription[prepared_transaction_data]PreparedTransactionDataundefinedThe prepared transaction data[seed]strundefinedThe seed[start_index]intundefinedThe start address index[end_index]intundefinedThe end address index (excluded)ReturnsthePayload.finish_message(payload): MessageConstruct the message by payload.ParamTypeDefaultDescription[payload]PayloadundefinedThePayloadReturnstheMessage.get_message_metadata(message_id): MessageMetadataResponseGet the message metadata by message_id.ParamTypeDefaultDescription[message_id]strundefinedThe message idReturnstheMessageMetadataResponse.get_message_data(message_id): MessageGets the message data from the message id.ParamTypeDefaultDescription[message_id]strundefinedThe message idReturnstheMessage.get_message_raw(message_id): strGets the raw message string from the message id.ParamTypeDefaultDescription[message_id]strundefinedThe message idReturnsthe raw message string.get_message_children(message_id): list[str]Gets the children of the given message.ParamTypeDefaultDescription[message_id]strundefinedThe message idReturnsthe list of children strings.get_message_id(payload_str): strGet the message id from the payload string.ParamTypeDefaultDescriptionpayload_strstrundefinedThe payload string from the mqtt message eventReturnsThe identifier of message.get_message_index(index): list[str]Gets the list of message indices from the message_id.ParamTypeDefaultDescription[index]strundefinedThe identifier of messageReturnsthe list of message ids.find_messages(indexation_keys (optional), message_ids (optional)): list[Message]Finds all messages associated with the given indexation keys and message ids.ParamTypeDefaultDescription[indexation_keys]list[str]undefinedThe list of indexations keys too search[message_ids]list[str]undefinedThe list of message ids to searchReturnsthe list of the found messages.get_unspent_address(seed, account_index (optional), initial_address_index(optional)): (str, int)Gets a valid unspent address.ParamTypeDefaultDescription[seed]strundefinedThe hex-encoded seed to search[account_index]intundefinedThe account index[initial_address_index]intundefinedThe initial address indexReturnsa tuple with type of(str, int)as the address and corresponding index in the account.get_addresses(seed, account_index (optional), input_range_begin (optional), input_range_end (optional) get_all (optional)): list[(str, bool (optional))]Finds addresses from the seed regardless of their validity.ParamTypeDefaultDescription[seed]strundefinedThe hex-encoded seed to search[account_index]intundefinedThe account index[input_range_begin]intundefinedThe begin of the address range[input_range_end]intundefinedThe end of the address range[bech32_hrp]stringundefinedThe Bech32 HRP[get_all]boolundefinedGet all addressesReturnsa list of tuples with type of(str, int)as the address and corresponding index in the account.get_balance(seed, account_index (optional), initial_address_index(optional), gap_limit(optional)): intGet balance on a given seed and its wallet account index.ParamTypeDefaultDescription[seed]strundefinedThe hex-encoded seed to search[account_index]intundefinedThe account index[initial_address_index]intundefinedThe initial address index[gap_limit]intundefinedThe gap limitReturnsthe amount of balance.get_address_balances(addresses): list[AddressBalancePair]Get the balance in iotas for the given addresses.ParamTypeDefaultDescription[addresses]list[str]undefinedThe list of addresses to searchReturnsthe list ofAddressBalancePair.generate_mnemonic()Returns a random generated Bip39 mnemonic with the English word list.ReturnsA Stringmnemonic_to_hex_seed(mnemonic)Returns the seed hex encoded.ParamTypeDefaultDescriptionmnemonicstrundefinedBip39 mnemonic with words from the English word list.ReturnsA Stringfind_inputs(addresses, amount: u64)Return the inputs from addresses for a provided amount (useful for offline signing)ParamTypeDefaultDescriptionaddresseslist[str]undefinedThe input address list.amountstrundefinedThe input amount.ReturnsThe list ofUtxoInput.bech32_to_hex(bech32)Returns a parsed hex String from bech32.ParamTypeDefaultDescriptionbech32strundefinedThe address Bech32 stringReturnsA Stringhex_to_bech32(hex, bech32_hrp (optional))Returns a parsed bech32 String from hex.ParamTypeDefaultDescriptionbech32strundefinedThe address Bech32 stringbech32_hrpstrundefinedThe Bech32 hrp stringReturnsA Stringhex_public_key_to_bech32_address(hex, bech32_hrp (optional))Returns the bech32 address from the hex public key.ParamTypeDefaultDescriptionhexstrundefinedHex encoded public keybech32_hrpstrundefinedThe Bech32 hrp stringReturnsA Stringis_address_valid(address): boolChecks if a given address is valid.ParamTypeDefaultDescriptionaddressstrundefinedThe address Bech32 stringReturnsA boolean.retry(message_id): (str, Message)Retries (promotes or reattaches) the message associated with the given id.ParamTypeDefaultDescription[message_id]strundefinedThe message idReturnsthe message id and the retriedMessage.retry_until_included(message_id, interval (optional), max_attempts (optional)): list[(str, Message)]Retries (promotes or reattaches) the message associated with the given id.ParamTypeDefaultDescription[message_id]strundefinedThe message idintervalint5The interval in seconds in which we retry the message.max_attemptsint10The maximum of attempts we retry the message.Returnsthe message ids andMessageof reattached messages.consolidate_funds(seed, account_index, start_index, end_index): strFunction to consolidate all funds from a range of addresses to the address with the lowest index in that rangeParamTypeDescription[seed]strThe seed[account_index]intThe account index.[start_index]intThe lowest address index, funds will be consolidated to this address.[end_index]intThe address index until which funds will be consolidatedReturnsthe address to which the funds got consolidated, if any were available.reattach(message_id): (str, Message)Reattaches the message associated with the given id.ParamTypeDefaultDescription[message_id]strundefinedThe message idReturnsthe message id and the reattachedMessage.promote(message_id): (str, Message)Promotes the message associated with the given id.ParamTypeDefaultDescription[message_id]strundefinedThe message idReturnsthe message id and the promotedMessage.MQTT APIssubscribe_topic(topic, callback): voidSubscribe a topic and assign the associated callback.ParamTypeDefaultDescription[topic]strundefinedThe MQTT topic[callback]functionundefinedThe callback functionsubscribe_topics(topics, callback): voidSubscribe topics and assign the associated callbacks, respectively.ParamTypeDefaultDescription[topics]list[str]undefinedThe MQTT topics[callback]functionundefinedThe callback functionsunsubscribe(): voidUnsubscribe all topics.unsubscribe_topics(topics): voidUnsubscribe from provided topics.ParamTypeDefaultDescription[topics]list[str]undefinedThe MQTT topicsdisconnect(): voidDisconnect the mqtt broker.WalletAddressA dict with the following key/value pairs.message_metadata_response={'message_id':str,'parent_message_ids':list[str],'is_solid':bool,'referenced_by_milestone_index':int,# (optional)'milestone_index':int,# (optional)'ledger_inclusion_state':LedgerInclusionStateDto,# (optional)'conflict_reason':int,# (optional)'should_promote:'bool# (optional)'should_reattach':bool# (optional)}Please refer toLedgerInclusionStateDtofor the details of this type.BalanceAddressResponseA dict with the following key/value pairs.balance_for_address_response={'address_type':int,'address':str,'balance':int}AddressBalancePairA dict with the following key/value pairs.address_balance_pair={'address':str,'balance':int'dust_allowed':bool}MilestoneDtoA dict with the following key/value pairs.milestoned_to={'index':int,'timestamp':int,'message_id':str}MilestoneUTXOChangesA dict with the following key/value pairs.milestone_utxo_changes={'index':int,'created_outputs':list[str],'consumed_outputs':list[str]}ReceiptDtoA dict with the following key/value pairs.receiptDto={'receipt':Receipt,'milestone_index':int,}TreasuryResponseA dict with the following key/value pairs.treasuryResponse={'milestone_id':str,'amount':int,}UtxoInputA dict with the following key/value pairs.utxo_input={'transaction_id':list[int],'index':int}OutputResponseA dict with the following key/value pairs.output_response={'message_id':str,'transaction_id':str,'output_index':int,'is_spent':bool,'output':OutputDto}Please refer toOutputDtofor the details of this type.OutputDtoA dict with the following key/value pairs.output_dto={'treasury':TreasuryOutputDto,# (opitonal)'signature_locked_single':SignatureLockedSingleOutputDto,# (opitonal)'signature_locked_dust_allowance':SignatureLockedDustAllowanceOutputDto# (opitonal)}Please refer toTreasuryOutputDto,SignatureLockedSingleOutputDto, andSignatureLockedDustAllowanceOutputDtofor the details of these types.SignatureLockedSingleOutputDtoA dict with the following key/value pairs.signature_locked_single_output_dto={'kind':int,'address':AddressDto,'amount':int}Please refer toAddressDtofor the details of this type.SignatureLockedDustAllowanceOutputDtoA dict with the following key/value pairs.signature_locked_dust_allowance_output_dto={'kind':int,'address':AddressDto,'amount':int}Please refer toAddressDtofor the details of this type.pub struct TreasuryOutputDto {A dict with the following key/value pairs.treasury_output_dto={'kind':int,'amount':int}AddressDtoA dict with the following key/value pairs.address_dto={'ed25519':Ed25519AddressDto}Please refer toEd25519AddressDtofor the details of this type.Ed25519AddressDtoA dict with the following key/value pairs.ed25519_address_dto={'kind':int,'address':str}MessageA dict with the following key/value pairs.message={'message_id':str,'network_id':int,'parents':list[str],'payload':Payload,# (optional)'nonce':int}Please refer toPayloadfor the details of this type.PayloadA dict with the following key/value pairs.payload={'transaction':list[Transaction],# (optional)'milestone':list[Milestone],# (optional)'indexation':list[Indexation],# (optional)'receipt':List[Receipt],# (optional)'treasury_transaction':List[TreasuryTransaction],# (optional)}Please refer toTransaction,Milestone, andIndexationfor the details of these types.TransactionA dict with the following key/value pairs.transaction={'essence':RegularEssence,'unlock_blocks':list[UnlockBlock]}Please refer toRegularEssence, andUnlockBlockfor the details of these types.MilestoneA dict with the following key/value pairs.milestone={'essence':MilestonePayloadEssence,'signatures':list[list[int]]}Please refer toMilestonePayloadEssencefor the details of this type.MilestonePayloadEssenceA dict with the following key/value pairs.milestone_payload_essence={'index':int,'timestamp':int,'parents':list[str],'merkle_proof':list[int],'next_pow_score':int,'next_pow_score_milestone_index':int,'public_keys':list[list[int]]}IndexationA dict with the following key/value pairs.indexation={'index':str,'data':list[int]}RegularEssenceA dict with the following key/value pairs.regular_essence={'inputs':list[Input],'outputs':list[Output],'payload':list[Payload]}Please refer toInput,Output, andPayloadfor the details of these types.OutputA dict with the following key/value pairs.output={'address':str,'amount':int}InputA dict with the following key/value pairs.input={'transaction_id':str,'index':int}UnlockBlockA dict with the following key/value pairs.unlock_block={'signature':Ed25519Signature,# (optional)'reference':int# (optional)}Please refer toEd25519Signaturefor the details of this type.Ed25519SignatureA dict with the following key/value pairs.ed25519_signature={'public_key':list[int],'signature':list[int]}BrokerOptionsA dict with the following key/value pairs.broker_options={'automatic_disconnect':bool,'timeout':int,'max_reconnection_attempts':int,}LedgerInclusionStateDtoA dict with the following key/value pairs.ledger_inclusion_state_dto={'state':str}NodeInfoWrapperA dict with the following key/value pairs.nodeinfo_wrapper{url:str,nodeinfo:info_response,}info_response={'name':str,'version':str,'is_healthy':bool,'network_id':str,'bech32_hrp':str,'min_pow_score':float,'messages_per_second':float,'referenced_messages_per_second':float,'referenced_rate':float,'latest_milestone_timestamp':u64,'latest_milestone_index':int,'confirmed_milestone_index':int,'pruning_index':int,'features':list[str],'min_pow_score':float,}NetworkInfoA dict with the following key/value pairs.network_info={'network':str,'network_id':int,'bech32_hrp':str,'min_pow_score':float,'local_pow':bool,'tips_interval':int,}PeerDtoA dict with the following key/value pairs.peer_dto={'id':str,'multi_addresses':list[str],'alias':str,# (optional)'relation':RelationDto,'connected':bool,'gossip':GossipDto,# (optional)}Please refer toRelationDtoandGossipDtofor the details of these types.RelationDtoA dict with the following key/value pairs.relation_dto={'relation':str}GossipDtoA dict with the following key/value pairs.gossip_dto={'heartbeat':HeartbeatDto,'metrics':MetricsDto}Please refer toHeartbeatDtoandMetricsDtofor the details of these types.HeartbeatDtoA dict with the following key/value pairs.heart_beat_dto={'solid_milestone_index':int,'pruned_milestone_index':int,'latest_milestone_index':int,'connected_neighbors':int,'synced_neighbors':int}MetricsDtoA dict with the following key/value pairs.metrics_dto={'received_messages':int,'known_messages':int,'received_message_requests':int,'received_milestone_requests':int,'received_heartbeats':int,'sent_messages':int,'sent_message_requests':int,'sent_milestone_requests':int,'sent_heartbeats':int,'dropped_packets':int,}AddressOutputsOptionsA dict with the following key/value pairs.options={'include_spent':bool,'output_type':string}