class
ICONServiceICONService
is a class which provides APIs to communicate with ICON nodes. It enables you to easily use ICON JSON-RPC APIs (version 3). All methods of IconService
returns a Request<T, ICError>
instance.Request
are executed as synchronized and asynchronized.execute()
function of Request
.Result<T, ICError>
async()
function of Request
.async()
is a closure. Passing Result<T, ICError>
.Transaction
class is used to make a transaction instance. There are 3 types of Transaction class.Transaction
class.Transaction
class.String
String
func
getLastBlockRequest
- Request instance for icx_getLastBlock
JSON-RPC API request. If the execution is successful, returns Result<Response.Block, ICError>
.func
getBlockUInt64
String
Request
- Request instance for icx_getBlockByHeight
| icx_getBlockByHash
. If the execution is successful, returns Result<Response.Block, ICError>
.func
callCall
Request<T>
- Request instance for icx_call
JSON-RPC request. If the execution is successful, returns Result<T, ICError>
.Call
generic value, input the type of function call. The generic value should follow Codable protocol.String
, input String
like this.String
, you can choice return types String
or BigUInt
.Call<String>
, return an original hex String value.Call<BigUInt>
return converted BigUInt value.func
getBalanceString
Request
- Request instance for icx_getBalance
JSON-RPC API request. If the execution is successful, returns Result<BigUInt, ICError>
.func
getScoreAPIString
Request
- Request instance for icx_getScoreApi
JSON-RPC API request. If the execution is successful, returns Result<[Response.ScoreAPI], ICError>
.func
getTotalSupplyRequest
- Request instance for icx_getTotalSupply
JSON-RPC API request. If the execution is successful, returns Result<BigUInt, ICError>
.func
getTransactionString
Request
- Request instnace for icx_getTransactionByHash
JSON-RPC API request. If the execution is successful, returns Result<Response.TransactionByHashResult, ICError>
.func
getTransactionResultString
Request
- Request instance for icx_getTransactionResult
JSON-RPC API request. If the execution is successful, returns Result<Response.TransactionResult, ICError>
.func
sendTransactionRequest
- Request instance for icx_sendTransaction
JSON-RPC request. If the execution is successful, returns Result<String, ICError>
.class
WalletPrivateKey
Wallet
- Wallet instance.func
getSignatureData
String
- A signature string.(Base64 encoded)String
class
TransactionTransaction
is a class representing a transaction data used for sending ICX.func
fromfrom
property.String
Transaction
itself.func
toto
property.String
Transaction
itself.func
stepLimitsetpLimit
property.BigUInt
Transaction
itself.func
nidnid
property.Transaction
itself.func
valuevalue
property.BigUInt
Transaction
itself.func
noncenonce
property.String
Transaction
itself.class
CallTransactionCallTransaction
class is used for invoking a state-transition function of SCORE. It extends Transaction
class, so instance parameters and methods of the class are mostly identical to Transaction
class, except for the following:func
methoddataType
will be fixed with call
String
CallTransaction
itself.call
function.Dictionary<String: Any>
CallTransaction
itself.class
MessageTransactionMessageTransaction
class is used for sending message data. It extends Transaction
class, so instance parameters and methods of the class are mostly identical to Transaction
class, except for the following:func
messagedataType
will be fixed with message
.String
MessageTransaction
itself.class
SignedTransactionSignedTransaction
is a class to make a signed transaction.Transaction
PrivateKey
1 ICX = 109 gLoop = 1018 loop
Unit
.icx
, .gLoop
, .loop
). Default value is .icx
.BigUInt
- The value that converted to loop.BigUInt
value to hex String
.Unit
.icx
, .gLoop
, .loop
). Default value is .loop
.String
- The value converted to a hex String.String
to BigUInt
.Unit
.icx
, .gLoop
, .loop
). Default value is .loop
.BigUInt
- The value that converted to hex String.nil
.