ICON Network
using Java SDK. This document contains SDK installation, API usage guide, and code examples.IconService
. IconService
can be initialized as follows.IconService
with a custom HTTP client.Request
object. Query requests can be executed as Synchronized or Asynchronized. Once the request has been executed, the same request object cannot be executed again.Wallet
object.SignedTransaction
object 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.stepLimit
value in your transaction to make the submitted transaction executed successfully.estimateStep
API 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 SignedTransaction
with the stepLimit
based on the estimation.stepLimit
of the SignedTransaction
.RpcItem
(RpcObject
, RpcArray
, RcpValue
). You can convert your own class using RpcConverter
.KeyWallet
or load wallet with a private key or Keystore file.create
function. After creation, the address and private key can be looked up.load
function.KeyWallet
object creation, the Keystore file can be stored by calling store
function.store
, the Keystore file’s name can be looked up with the returned value.KeyWallet
with CommonData.PRIVATE_KEY_STRING
and transfer 1 ICX to CommonData.ADDRESS_1
.SignedTransaction
to add the signature of the transaction.TransactionResult
.getBalance
function from IconService
KeyWallet
using CommonData.PRIVATE_KEY_STRING
, then read the binary data from ‘sampleToken.zip’stepLimit
value.estimateStep
API of IconService
.SignedTransaction
with 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 stepLimit
of the SignedTransaction
.sendTransaction
API of IconService
will return the transaction hash.scoreAddress
from the result.scoreAddress
from the deploy transaction result above, and use this to send the token.KeyWallet
using CommonData.PRIVATE_KEY_STRING
just like in the case of IcxTransactionExample
, then send 1 Token to CommonData.ADDRESS_1
.RpcObject
to send token.sendTransaction
from IconService
to check the transaction hash.balanceOf
from the token SCORE.getLastBlock
is called periodically in order to check the new blocks,ConfirmedTransaction
:TransactionResult
, merge with ConfirmedTransaction
to send ICX or tokens. Transaction output is as follows:name
and symbol
functions.