ICON Networkusing Java SDK. This document contains SDK installation, API usage guide, and code examples.
IconServicecan be initialized as follows.
IconServicewith a custom HTTP client.
Requestobject. Query requests can be executed as Synchronized or Asynchronized. Once the request has been executed, the same request object cannot be executed again.
SignedTransactionobject signs a transaction using the wallet. And the request can be executed as Synchronized or Asynchronized like a query request. Once the request has been executed, the same request object cannot be executed again.
stepLimitvalue in your transaction to make the submitted transaction executed successfully.
estimateStepAPI provides a way to estimate the Step usage of a given transaction. Using the method, you can get an estimated Step usage before sending your transaction then make a
stepLimitbased on the estimation.
RcpValue). You can convert your own class using
KeyWalletor load wallet with a private key or Keystore file.
createfunction. After creation, the address and private key can be looked up.
KeyWalletobject creation, the Keystore file can be stored by calling
store, the Keystore file’s name can be looked up with the returned value.
CommonData.PRIVATE_KEY_STRINGand transfer 1 ICX to
SignedTransactionto add the signature of the transaction.
CommonData.PRIVATE_KEY_STRING, then read the binary data from ‘sampleToken.zip’
SignedTransactionwith the same raw transaction and the estimated Step. Note that the estimation can be smaller or larger than the actual amount of step to be used by the transaction. So we need to add some margin to the estimation when you set the
IconServicewill return the transaction hash.
scoreAddressfrom the result.
scoreAddressfrom the deploy transaction result above, and use this to send the token.
CommonData.PRIVATE_KEY_STRINGjust like in the case of
IcxTransactionExample, then send 1 Token to
RpcObjectto send token.
IconServiceto check the transaction hash.
balanceOffrom the token SCORE.
getLastBlockis called periodically in order to check the new blocks,
TransactionResult, merge with
ConfirmedTransactionto send ICX or tokens. Transaction output is as follows: