Package: iconsdk
ICON SDK for PythonICON SDK for Python is a collection of libraries which allows you to interact with a local or remote ICON node using an HTTP connection.This document describes how to interact with ICON Network using the ICON SDK for Python, including SDK installation, API usage guide, and code examples.RequirementsPython 3.7 or later.InstallationSetup a virtual environment first, and install ICON SDK.$virtualenv-ppython3venv
$sourcevenv/bin/activate
$pipinstalliconsdkUsing the SDKCreateIconServiceand Set ProviderYou need to create anIconServiceinstance and set a provider.TheIconServiceclass contains a set of API methods. It accepts anHTTPProviderwhich serves the purpose of connecting to HTTP and HTTPS based JSON-RPC servers.Aproviderdefines how theIconServiceconnects to ICON node.TheHTTPProvidertakes a base domain URL where the server can be found. For local development, this would be something likehttp://localhost:9000.Here is an example of calling a simple API method to get a block by its height:fromiconsdk.icon_serviceimportIconServicefromiconsdk.providers.http_providerimportHTTPProvider# Creates an IconService instance using the HTTP provider and set a provider.icon_service=IconService(HTTPProvider("http://localhost:9000",3))# Gets a block by a given block height.block=icon_service.get_block(1209)Using LoggerSet a logger namedICON-SDK-PYTHONif necessary. Useset_loggerfunction to set log level like "DEBUG", "INFO", etc as shown below.fromiconsdk.utilsimportset_logger# Sets level in the logger. In this case, the handler is default StreamHandler which writes logging records, appropriately formatted, to a stream.set_logger("DEBUG")You can also set logger with a specific handler likeFileHandlerorSteamHandlerand user own log format as shown below.from logging import StreamHandler, Formatter

# Sets level in the logger. In this case, the handler is FileHandler which writes formatted logging records to disk files.
handler = FileHandler("./icon-sdk-python.log", mode='a', encoding=None, delay=False)

# Sets user own log format.
formatter = Formatter('%(asctime)s %(name)-12s %(levelname)-5s %(filename)-12s %(lineno)-4s %(funcName)-12s %(message)s')

set_logger("DEBUG", handler, formatter)Queriesfromiconsdk.builder.call_builderimportCallBuilder# Returns block information by block heightblock=icon_service.get_block(1000)# Returns block information by block hashblock=icon_service.get_block("0x000...000")# Returns the last block informationblock=icon_service.get_block("latest")# Returns the balance of the account of given addressbalance=icon_service.get_balance("hx000...1")# Returns a list of the SCORE APIsscore_apis=icon_service.get_score_api("cx000...1")# Returns the total supply of ICXtotal_supply=icon_service.get_total_supply()# Returns information about a transaction requested by transaction hashtx=icon_service.get_transaction("0x000...000")# Returns the result of a transaction by transaction hashtx_result=icon_service.get_transaction_result("0x000...000")# Returns the data based on the hashtx_result=icon_service.get_data_by_hash("0x000...000")# Returns block header for specified height.tx_result=icon_service.get_block_header_by_height(1000)# Returns votes for the block specified by heighttx_result=icon_service.get_votes_by_height(1000)# Returns proof for the receipt. Proof, itself, may include the receipt.tx_result=icon_service.get_proof_for_result("0x000...000",0)# Returns proof for the receipt and the events in it. The proof may include the data itself.tx_result=icon_service.get_proof_for_events("0x000...000",0,["0x0","0x2"])# Generates a call instance using the CallBuildercall=CallBuilder().from_(wallet.get_address())\.to("cx000...1")\.method("balance_of")\.params({"address":"hx000...1"})\.height(100)\.build()# Executes a call method to call a read-only API method on the SCORE immediately without creating a transactionresult=icon_service.call(call)get_blockget_block(value)Function AReturns block information by block heightDelegates toicx_getBlockByHeightRPC methodFunction BReturns block information by block hashDelegates toicx_getBlockByHashRPC methodFunction CReturns the last block informationDelegates toicx_getLastBlockRPC methodParametersFunction Avalue : Integer of a block heightFunction Bvalue : Hash of a block prefixed with '0x'Function Cvalue : 'latest'ReturnsBlock dataExample of a returned block dataError CasesDataTypeException : Data type is invalid.JSONRPCException :  JSON-RPC Response is error.Example# Returns block information by block heightblock=icon_service.get_block(1000)# Returns block information by block hashblock=icon_service.get_block("0x000...000")# Returns the last block informationblock=icon_service.get_block("latest")get_balanceget_balance(address:str,height:int=None)Returns the ICX balance of the given EOA or SCOREDelegates toicx_getBalanceRPC methodParametersaddress : An address of EOA or SCOREheight(optional) : Block heightReturnsNumber of ICX coinsError CasesAddressException : Address is invalid.DataTypeException : Data type is invalid.JSONRPCException :  JSON-RPC Response is error.Example# Returns the ICX balance of the given EOA or SCOREbalance=icon_service.get_balance("hx000...1")get_score_apiget_score_api(address:str,height:int=None)Returns SCORE's external API listDelegates toicx_getScoreApiRPC methodParametersaddress : A SCORE address to be examinedheight(optional) : Block heightReturnsA list of API methods of the SCORE and its informationFields :type : Method type;  function, fallback, or eventlogname : Function name on the SCOREinputs : A list of information of parametersname : Parameter nametype : Parameter type ; int, str, bytes, bool, Addressindexed : In the case of eventlog, tells if the parameter is indexed.outputs : Return valuetype : Return value type ; int, str, bytes, bool, AddressReadonly : External (readonly=True)Payable: PayableError CasesAddressException : Address is invalid.DataTypeException : Data type is invalid.JSONRPCException :  JSON-RPC Response is error.Example# Returns SCORE's external API listscore_apis=icon_service.get_score_api("cx000...1")get_total_supplyget_total_supply(height:int=None)Returns total ICX coin supply that has been issuedDelegates toicx_getTotalSupplyRPC methodParametersheight(optional) : Block heightReturnsTotal number of ICX coins issuedError CasesDataTypeException : Data type is invalid.JSONRPCException :  JSON-RPC Response is error.Example# Returns total ICX coin supply that has been issuedtotal_supply=icon_service.get_total_supply()get_transactionget_transaction(tx_hash:str)Returns the transaction information requested by transaction hashDelegates toicx_getTransactionByHashRPC methodParameterstx_hash : Transaction hash prefixed with '0x'ReturnsInformation about a transactionFields :version : Protocol version (3 for V3)from : An EOA address that created the transactionto : An EOA address to receive coins, or SCORE address to execute the transactionvalue : Amount of ICX coins in loop to transfer. When omitted, assumes 0. (1 icx = 10 ^ 18 loop)stepLimit :  Maximum step allowance that can be used by the transactiontimestamp : Transaction creation time. Timestamp is in microseconds.nid : Network ID (1 for Main net, etc)nonce : An arbitrary number used to prevent transaction hash collisiontxHash : Transaction hashtxIndex : Transaction index in a block. Null when it is pending.blockHeight : Block height including the transaction. Null when it is pendingblockHash : Block hash including the transaction. Null when it is pending.signature : Signature of the transactiondataType : Data type; call, deploy, messagedata : Contains various type of data depending on the dataTypeError CasesDataTypeException : Data type is invalid.JSONRPCException :  JSON-RPC Response is error.Example# Returns the transaction information requested by transaction hashtx=icon_service.get_transaction("0x000...000")get_transaction_resultget_transaction_result(tx_hash:str)Returns the transaction result requested by transaction hashDelegates toicx_getTransactionResultRPC methodParameterstx_hash : Hash of a transaction prefixed with '0x'ReturnsA transaction result objectField :status : 1 on success, 0 on failureto : Recipient address of the transactionfailure : This field exists when status is 0. Contains code(str) and message(str)txHash : Transaction hashtxIndex : Transaction index in the blockblockHeight : Block height including the transactionblockHash : Block hash including the transactioncumulativeStepUsed : Sum of stepUsed by this transaction and all preceding transactions in the same blockstepUsed : The amount of step used by this transactionstepPrice: The step price used by this transactionscoreAddress : A SCORE address if the transaction created a new SCORE. (optional)eventLogs : Array of eventlogs generated by this transactionlogsBloom : Bloom filter to quickly retrieve related eventlogsError CasesDataTypeException : Data type is invalid.JSONRPCException :  JSON-RPC Response is error.Example# Returns the transaction result requested by transaction hashtx_result=icon_service.get_transaction_result("0x000...000")get_data_by_hashget_data_by_hash(hash:str)Get data by hash.It can be used to retrieve data based on the hash algorithm (SHA3-256).Following data can be retrieved by a hash.BlockHeader with the hash of the blockValidators with BlockHeader.NextValidatorsHashVotes with BlockHeader.VotesHashetc…Delegates toicx_getDataByHashRPC methodParametershash : The hash value of the data to retrieve.ReturnsError CasesDataTypeException : Data type is invalid.JSONRPCException :  JSON-RPC Response is error.Exampletx_result=icon_service.get_data_by_hash("0x000...000")get_block_header_by_heightget_block_header_by_height(height:int)Get block header for specified height.Delegates toicx_getBlockHeaderByHeightRPC methodParametersheight : The height of the blockReturnsError CasesDataTypeException : Data type is invalid.JSONRPCException :  JSON-RPC Response is error.Exampletx_result=icon_service.get_block_header_by_height(1000)get_votes_by_heightget_votes_by_height(height:int)Get votes for the block specified by height.Normally votes for the block are included in the next. So, even though the block is finalized by votes already, the block including votes may not exist. For that reason, we support this API to get votes as proof for the block.Delegates toicx_getVoteByHeightRPC methodParametersheight : The height of the blockReturnsError CasesDataTypeException : Data type is invalid.JSONRPCException :  JSON-RPC Response is error.Exampletx_result=icon_service.get_vote_by_height(1000)callcall(call:Call)Calls SCORE's external function which is read-only without creating a transaction.Delegates toicx_callRPC methodParametersCall object made byCallBuilderFields :from : Message sender's address (optional)to : A SCORE address that will handle the messagemethod : name of an external functionparams : Parameters to be passed to the function (optional). A data type of params should bedict.ReturnsValues returned by the executed SCORE functionError CasesDataTypeException : Data type is invalid.JSONRPCException :  JSON-RPC Response is error.Example# Generates a call instance using the CallBuildercall=CallBuilder().from_(wallet.get_address())\.to("cx000...1")\.method("balance_of")\.params({"address":"hx000...1"})\.build()# Calls SCORE's external function which is read-only without creating a transactionresult=icon_service.call(call)KeyWalletTo send transactions, first, you should make an instance of your wallet.You can make an instance of the wallet using bytes of the private key or from a keystore file.fromiconsdk.wallet.walletimportKeyWallet# Generates a walletwallet=KeyWallet.create()# Loads a wallet from bytes of the private keywallet=KeyWallet.load(b'-B\x99...xedy')# Loads a wallet from a keystore filewallet=KeyWallet.load("./keystore","password")# Stores a keystore file on the file pathwallet.store("./keystore","password")# throw exception if having an error.# Returns an Addresswallet.get_address()# Returns a private keywallet.get_private_key()# Signs the transactionsignature=wallet.sign(b'D8\xe9...\xfc')createcreate()Generates an instance of Wallet without a specific private keyParametersNoneReturnsAn instance of Wallet classExample# Generates a walletwallet=KeyWallet.create()loadload(private_key:bytes)Loads a wallet from bytes of the private key and generates an instance of WalletParametersprivate_key : Bytes of the private keyReturnsAn instance of Wallet classError CasesDataTypeException : Private key is invalid.Example# Loads a wallet from bytes of the private keywallet=KeyWallet.load(b'-B\x99...xedy')loadload(file_path:PathLikeObject,password:str)Note:
type aliasPathLikeObjectis defined inutils/__init__.pyPathLikeObject=Union[str,bytes,os.PathLike]Loads a wallet from a keystore file with your password and generates an instance of WalletParametersfile_path : File path of the keystore filepassword : Password for the keystore file. Password must include alphabet character, number, and special characterReturnsAn instance of Wallet classError CasesKeyStoreException: Key store file is invalid.Example# Loads a wallet from a keystore filewallet=KeyWallet.load("./keystore","password")storestore(file_path,password)Stores data of an instance of a derived wallet class on the file path with your passwordParametersfile_path : File path of the keystore filepassword :  Password for the keystore file. Password must include alphabet character, number, and special characterReturnsNoneError CasesKeyStoreException: Key store file is invalid.Example# Stores a keystore file on the file pathwallet.store("./keystore","password")# throw exception if having an error.get_addressget_address()Returns an EOA addressThe format of your account (which is generated from your public key) is hxfd7e4560ba363f5aabd32caac7317feeee70ea57.ParametersNoneReturnsAn EOA addressExample# Returns an EOA addresswallet.get_address()get_private_keyget_private_key()Returns hex string of the private key of the walletParametersNoneReturnsHex string of the private keyExample# Returns the private keywallet.get_private_key()signsign(data:bytes)Returns bytes of the ECDSA-SHA256 signature made from the dataParametersdata : bytes of the transactionReturnsBytes of the signatureError CasesDataTypeException : Data type is invalid.Example# Signs the transactionsignature=wallet.sign(b'D8\xe9...\xfc')TransactionsGenerating a TransactionNext, you should create an instance of the transaction using different types oftransaction buildersas follows:Signing a TransactionBefore sending a transaction, the transaction should be signed by usingSignedTransactionclass. The SignedTransaction class is used to sign the transaction by returning an instance of the signed transaction as demonstrated in the example below. The instance of the signed transaction has the property of a signature.Sending a TransactionFinally, you can send a transaction with the signed transaction object as follows:Examplesfromiconsdk.builder.transaction_builderimport(TransactionBuilder,DeployTransactionBuilder,CallTransactionBuilder,MessageTransactionBuilder,DepositTransactionBuilder)fromiconsdk.signed_transactionimportSignedTransaction# Generates an instance of transaction for sending icx.transaction=TransactionBuilder()\.from_(wallet.get_address())\.to("cx00...02")\.value(150000000)\.step_limit(1000000)\.nid(3)\.nonce(100)\.build()# Generates an instance of transaction for deploying SCORE.transaction=DeployTransactionBuilder()\.from_(wallet.get_address())\.to("cx00...02")\.step_limit(1000000)\.nid(3)\.nonce(100)\.content_type("application/java")\.content(b'D8\xe9...\xfc')\.params(params)\.build()# Generates an instance of transaction for calling method in SCORE.transaction=CallTransactionBuilder()\.from_(wallet.get_address())\.to("cx00...02")\.step_limit(1000000)\.nid(3)\.nonce(100)\.method("transfer")\.params(params)\.build()# Generates an instance of transaction for sending a message.transaction=MessageTransactionBuilder()\.from_(wallet.get_address())\.to("cx00...02")\.step_limit(1000000)\.nid(3)\.nonce(100)\.data("0x74657374")\.build()# Generates an instance of transaction for adding or withdrawing a deposit.# Case0: Adding a deposittransaction=DepositTransactionBuilder()\.from_(wallet.get_address())\.to("cx00...02")\.value(5000*(10**18))\.step_limit(1000000)\.nid(3)\.nonce(100)\.action("add")\.build()# Case1: Withdrawing the deposittransaction=DepositTransactionBuilder()\.from_(wallet.get_address())\.to("cx00...02")\.step_limit(1000000)\.nid(3)\.nonce(100)\.action("withdraw")\.id(tx_hash)\.build()# Returns the signed transaction object having a signaturesigned_transaction=SignedTransaction(transaction,wallet)# Sends the transactiontx_hash=icon_service.send_transaction(signed_transaction)TransactionBuilderBuilder for aTransactionobjectMethodsfrom_ : The wallet address making a transaction. The default address is your account address.to : The wallet address to receive coin or SCORE address to receive a transaction.value : The amount of ICX to be sent. (Optional)step_limit : The maximum step value for processing a transaction.nid : Network ID. Default nid is 1 if you didn't set the value. (1 for Main net, etc)nonce :  An arbitrary number used to prevent transaction hash collision. (Optional)version : Protocol version (3 for V3). The default version is 3 if you didn't set the value.timestamp : Transaction creation time. Timestamp is in microseconds. Default timestamp is set, if you didn't set the value.build : Returns an ICX transaction objectReturnsA transaction objectExample# Generates an instance of transaction for sending icx.transaction=TransactionBuilder()\.from_(wallet.get_address())\.to("cx00...02")\.value(150000000)\.step_limit(1000000)\.nid(3)\.nonce(100)\.build()DeployTransactionBuilderBuilder forDeployTransactionobjectMethodsfrom_ : The wallet address making a transaction. The default address is your account address.to : The wallet address to receive coin or SCORE address to receive a transactionstep_limit : The maximum step value for processing a transactionnid : Network ID. Default nid is 1 if you didn't set the value. (1 for Main net, etc)nonce : An arbitrary number used to prevent transaction hash collisioncontent_type : Content's MIME typecontent : Binary data of the SCOREparams : Parameters passed on the SCORE methods ; on_install (), on_update (). Data type of the params should bedict. (optional)version : Protocol version (3 for V3). The default version is 3 if you didn't set the value.timestamp : Transaction creation time. Timestamp is in microseconds. Default timestamp is set, if you didn't set the value.build : Returns a deploy transaction objectReturnsA deploy transaction objectExample# Generates an instance of transaction for deploying SCORE.transaction=DeployTransactionBuilder()\.from_(wallet.get_address())\.to("cx00...02")\.step_limit(1000000)\.nid(3)\.nonce(100)\.content_type("application/java")\.content(b'D8\xe9...\xfc')\.params(params)\.build()CallTransactionBuilderBuilder forCallTransactionobjectMethodsfrom_ : The wallet address making a transaction. The default address is your account address.to : The wallet address to receive coin or SCORE address to receive a transactionstep_limit : The maximum step value for processing a transactionnid : Network ID. Default nid is 1 if you didn't set the value. (1 for Main net, etc)nonce :  An arbitrary number used to prevent transaction hash collisionmethod : Methods in the SCOREparams : Parameters passed on the SCORE methods. Data type of the params should bedict. (optional)version : Protocol version (3 for V3). The default version is 3 if you didn't set the value.timestamp : Transaction creation time. Timestamp is in microseconds. Default timestamp is set, if you didn't set the value.Build : Returns a call transaction objectReturnsA call transaction objectExample# Generates an instance of transaction for calling method in SCORE.transaction=CallTransactionBuilder()\.from_(wallet.get_address())\.to("cx00...02")\.step_limit(1000000)\.nid(3)\.nonce(100)\.method("transfer")\.params(params)\.build()MessageTransactionBuilderBuilder forMessageTransactionobjectMethodsfrom_ : The wallet address making a transaction. The default address is your account address.to : The wallet address to receive coin or SCORE address to receive a transactionstepLimit : The maximum step value for processing a transactionnid : Network ID. Default nid is 1 if you didn't set the value. (1 for Main net, etc)nonce :  An arbitrary number used to prevent transaction hash collisiondata : Data by the dataType. Data type of the data should belowercase hex stringprefixed with '0x'.version : Protocol version (3 for V3). The default version is 3 if you didn't set the value.timestamp : Transaction creation time. Timestamp is in microseconds. Default timestamp is set, if you didn't set the value.build : Returns a message transaction objectReturnsA message transaction objectExample# Generates an instance of transaction for sending a message.transaction=MessageTransactionBuilder()\.from_(wallet.get_address())\.to("cx00...02")\.step_limit(1000000)\.nid(3)\.nonce(100)\.data("0x74657374")\.build()DepositTransactionBuilderBuilder forDepositTransactionobjectMethodsfrom_ : The wallet address making a transaction. The default address is your account address.to : SCORE address to receive a transactionvalue : The amount of ICX to be deposited. It is used only for 'add' action. (Optional)action : "add" or "withdraw".id : Transaction hash prefixed with '0x'. It is used only for 'withdraw' action. (Optional)stepLimit : The maximum step value for processing a transaction.nid : Network ID. Default nid is 1 if you didn't set the value. (1 for Main net, etc)nonce :  An arbitrary number used to prevent transaction hash collision.version : Protocol version (3 for V3). The default version is 3 if you didn't set the value.timestamp : Transaction creation time. Timestamp is in microseconds. Default timestamp is set, if you didn't set the value.build : Returns a deposit transaction object.ReturnsA deposit transaction objectExample# Generates an instance of transaction for adding or withdrawing a deposit.# Case0: Adding a deposittransaction=DepositTransactionBuilder()\.from_(wallet.get_address())\.to("cx00...02")\.value(5000*(10**18))\.step_limit(1000000)\.nid(3)\.nonce(100)\.action("add")\.build()# Case1: Withdrawing the deposittransaction=DepositTransactionBuilder()\.from_(wallet.get_address())\.to("cx00...02")\.step_limit(1000000)\.nid(3)\.nonce(100)\.action("withdraw")\.id(tx_hash)\.build()SignedTransactionSignedTransaction(transaction:Transaction,wallet:Wallet)Returns the signed transaction object having a signatureParameterstransaction : A transaction object not having a signature field yetwallet : A wallet objectReturnsThe signed transaction object having a signature field finallyError CasesDataTypeException : Data type is invalid.Example# Returns the signed transaction object having a signaturesigned_transaction=SignedTransaction(transaction,wallet)send_transactionsend_transaction(signed_transaction:SignedTransaction)Sends the transactionDelegates toicx_sendTransactionRPC methodNeed to wait for a while after sending the transaction. Because it takes time to create consensus among nodes. We recommend 0.3 seconds at least.Parameterssigned_transaction : A signed transaction objectReturnsTransaction hash prefixed with '0x'Error CasesDataTypeException : Data type is invalid.JSONRPCException :  JSON-RPC Response is error.Example# Sends the transactiontx_hash=icon_service.send_transaction(signed_transaction)Estimating StepIt is important to set a properstep_limitvalue in your transaction to make the submitted transaction executed successfully.estimate_stepAPI provides a way toestimatethe Step usage of a given transaction. Using the method, you can get an estimated Step usage before sending your transaction then make aSignedTransactionwith thestep_limitbased on the estimate.Examples# Generates a raw transaction without the stepLimittransaction=TransactionBuilder()\.from_(wallet.get_address())\.to("cx00...02")\.value(150000000)\.nid(3)\.nonce(100)\.build()# Returns an estimated step valueestimate_step=icon_service.estimate_step(transaction)# Adds some margin to the estimated stepestimate_step+=10000# Returns the signed transaction object having a signature with the same raw transaction and the estimated stepsigned_transaction=SignedTransaction(transaction,wallet,estimate_step)# Sends the transactiontx_hash=icon_service.send_transaction(signed_transaction)Note that the estimate can be smaller or larger than the actual amount of step to be used by the transaction, so it is recommended to add some margin to the estimate when you set thestep_limitof theSignedTransaction.estimate_stepestimate_step(transaction:Transaction)Returns an estimated step of how much step is necessary to allow the transaction to completeDelegates todebug_estimateStepRPC methodParameterstransaction : An Transaction object made by TransactionBuilderReturnsNumber of an estimated stepError CasesDataTypeException : Data type is invalid.JSONRPCException :  JSON-RPC Response is error.Example# Generates a raw transaction without the stepLimittransaction=TransactionBuilder()\.from_(wallet.get_address())\.to("cx00...02")\.value(150000000)\.nid(3)\.nonce(100)\.build()# Returns an estimated step valueestimate_step=icon_service.estimate_step(transaction)BTP2 extensionget_btp_network_infodefget_btp_network_info(self,id:int,height:int=None)->dict:Returns BTP Network information for specified height and ID.Delegates to btp_getNetworkInfo RPC method.https://github.com/icon-project/goloop/blob/master/doc/btp2_extension.md#btp_getNetworkInfoParametersparamdescriptionidThe id of the BTP networkheightThe height of the main blockReturnsA BTP Network information objectget_btp_network_type_infodefget_btp_network_type_info(self,id:int,height:int=None)->dict:Returns BTP Network Type information for specified height and ID.Delegates to btp_getNetworkTypeInfo RPC method.https://github.com/icon-project/goloop/blob/master/doc/btp2_extension.md#btp_getNetworkTypeInfoParametersparamdescriptionidThe id of the BTP network typeheightThe height of the main blockReturnsA BTP Network Type information objectget_btp_messagesdefget_btp_messages(self,height:int,network_id:int)->list:Returns BTP messages for specified height and network ID.Delegates to btp_getMessages RPC method.https://github.com/icon-project/goloop/blob/master/doc/btp2_extension.md#btp_getMessagesParametersparamdescriptionheightThe height of the main blocknetwork_idThe id of the BTP networkReturnsA BTP Messages objectget_btp_headerdefget_btp_header(self,height:int,network_id:int)->str:Returns BTP block header for specified height and network ID.Delegates to btp_getHeader RPC method.https://github.com/icon-project/goloop/blob/master/doc/btp2_extension.md#btp_getHeaderParametersparamdescriptionheightThe height of the main blocknetwork_idThe id of the BTP networkReturnsA Base64 encoded BTP block headerget_btp_proofdefget_btp_proof(self,height:int,network_id:int)->str:Returns BTP block proof for specified height and network ID.Delegates to btp_getHeader RPC method.https://github.com/icon-project/goloop/blob/master/doc/btp2_extension.md#btp_getProofParametersparamdescriptionheightThe height of the main blocknetwork_idThe id of the BTP networkReturnsA Base64 encoded BTP block proofget_btp_source_informationdefget_btp_source_information(self)->dict:Returns BTP source network information.Delegates to btp_getSourceInformation RPC method.https://github.com/icon-project/goloop/blob/master/doc/btp2_extension.md#btp_getSourceInformationReturnsA BTP network information objectReferencesQuick StartICON JSON-RPC API v3ICON NetworkLicenseThis project is available under theApache License, Version 2.0.