Search…
IISS Extension

Introduction

This document explains JSON-RPC APIs (version 3) for IISS available to interact with Goloop nodes.
This document was written based on IISS 3.1

IISS APIs

API path : <scheme>://<host>/api/v3
  • All IISS APIs follow SCORE API call convention
  • Target SCORE Address for IISS APIs: cx0000000000000000000000000000000000000000
  • Each IISS API TX method section explains the content of data field in icx_sendTransaction
  • Each IISS API QUERY method section explains the content of data field in icx_call
1
{
2
"jsonrpc": "2.0",
3
"id": 1234,
4
"method": "icx_sendTransaction",
5
"params": {
6
"version": "0x3",
7
"from": "hx8f21e5c54f016b6a5d5fe65486908592151a7c57",
8
"to": "cx0000000000000000000000000000000000000000",
9
"stepLimit": "0x7e3a85",
10
"timestamp": "0x563a6cf330136",
11
"nid": "0x3",
12
"nonce": "0x0",
13
"value": "0x0",
14
"signature": "VAia7YZ2Ji6igKWzjR2YsGa2m5...",
15
"dataType": "call",
16
"data": {
17
"method": "setStake",
18
"params": {
19
"value": "0x1"
20
}
21
}
22
}
23
}
Copied!

setStake

Stake some amount of ICX
Request
1
{
2
"jsonrpc": "2.0",
3
"id": 1234,
4
"method": "icx_sendTransaction",
5
"params": {
6
"data": {
7
"method": "setStake",
8
"params": {
9
"value": "0xde0b6b3a7640000"
10
}
11
},
12
...
13
}
14
}
Copied!

Parameters

Key
VALUE Type
Required
Description
value
T_INT
true
Amount of ICX icons in loop to stake

getStake

Returns the stake status of a given address
Request
1
{
2
"jsonrpc": "2.0",
3
"id": 1234,
4
"method": "icx_call",
5
"params": {
6
"to": "cx0000000000000000000000000000000000000000",
7
"dataType": "call",
8
"data": {
9
"method": "getStake",
10
"params": {
11
"address": "hxe7af5fcfd8dfc67530a01a0e403882687528dfcb"
12
}
13
}
14
}
15
}
Copied!

Parameters

Key
VALUE Type
Required
Description
address
T_ADDR_EOA
true
Address to query
Example responses
1
{
2
"jsonrpc": "2.0",
3
"id": 1234,
4
"result": {
5
"stake": "0x4e1003b28d9280000",
6
"unstakes": [
7
{
8
"unstake": "0x8ac7230489e80000",
9
"unstakeBlockHeight": "0x19",
10
"remainingBlocks": "0x11"
11
}
12
]
13
}
14
}
Copied!

Returns

Key
VALUE Type
Required
Description
stake
T_INT
true
ICX amount of stake in loop
unstakes
T_LIST[T_DICT]
false
Unstake info list
unstakes.unstake
T_INT
false
ICX amount of unstake in loop
unstakes.unstakeBlockHeight
T_INT
false
BlockHeight when unstake will be done

setDelegation

Delegate some ICX amount of stake to P-Reps
  • Maximum number of P-Reps to delegate is 100
  • The transaction which has duplicated P-Rep addresses will be failed
  • This transaction overwrites the previous delegate information
Request
1
{
2
"jsonrpc": "2.0",
3
"id": 1234,
4
"method": "icx_sendTransaction",
5
"params": {
6
"data": {
7
"method": "setDelegation",
8
"params": {
9
"delegations": [
10
{
11
"address": "hx1d6463e4628ee52a7f751e9d500a79222a7f3935",
12
"value": "0x3200000000"
13
},
14
{
15
"address": "hxb6bc0bf95d90cb3cd5b3abafd9682a62f36cc826",
16
"value": "0x1000000000"
17
}
18
]
19
}
20
},
21
...
22
}
23
}
Copied!
Request to revoke all delegations
1
{
2
"jsonrpc": "2.0",
3
"id": 1234,
4
"method": "icx_sendTransaction",
5
"params": {
6
"data": {
7
"method": "setDelegation",
8
"params": {
9
"delegations": []
10
}
11
},
12
...
13
}
14
}
Copied!

Parameters

Key
VALUE Type
Required
Description
delegations
T_LIST(T_DICT)
true
List of delegation dict (MAX: 100 entries)
delegations.address
T_ADDR_EOA
true
Address of P-Rep to delegate
delegations.value
T_INT
true
Delegation amount in loop

getDelegation

Returns the delegation status of a given address
Request
1
{
2
"jsonrpc": "2.0",
3
"id": 1234,
4
"method": "icx_call",
5
"params": {
6
"to": "cx0000000000000000000000000000000000000000",
7
"dataType": "call",
8
"data": {
9
"method": "getDelegation",
10
"params": {
11
"address": "hxe7af5fcfd8dfc67530a01a0e403882687528dfcb"
12
}
13
}
14
}
15
}
Copied!

Parameters

Key
VALUE Type
Required
Description
address
T_ADDR_EOA
true
Address to query
Example responses
1
{
2
"jsonrpc": "2.0",
3
"id": 1234,
4
"result": {
5
"totalDelegated": "0xa688906bd8b0000",
6
"votingPower": "0x3782dace9d90000",
7
"delegations": [
8
{
9
"address": "hx1d6463e4628ee52a7f751e9d500a79222a7f3935",
10
"value": "0x3782dace9d90000"
11
},
12
{
13
"address": "hxb6bc0bf95d90cb3cd5b3abafd9682a62f36cc826",
14
"value": "0x6f05b59d3b20000"
15
}
16
]
17
}
18
}
Copied!

Returns

Key
VALUE Type
Required
Description
totalDelegated
T_INT
true
The sum of delegation amount
votingPower
T_INT
true
Remaining amount of stake that ICONist can delegate to other P-Reps
delegations
T_LIST(T_DICT)
true
List of delegation dict (MAX: 100 entries)
delegations.address
T_ADDR_EOA
true
Address of P-Rep to delegate
delegations.value
T_INT
true
Delegation amount in loop

setBond

Bond some ICX amount of stake to P-Reps
  • Maximum number of P-Reps to bond is 100
  • The transaction which has duplicated P-Rep addresses will be failed
  • This transaction overwrites the previous bond information
Request
1
{
2
"jsonrpc": "2.0",
3
"id": 1234,
4
"method": "icx_sendTransaction",
5
"params": {
6
"data": {
7
"method": "setBond",
8
"params": {
9
"bonds": [
10
{
11
"address": "hx1d6463e4628ee52a7f751e9d500a79222a7f3935",
12
"value": "0x3200000000"
13
},
14
{
15
"address": "hxb6bc0bf95d90cb3cd5b3abafd9682a62f36cc826",
16
"value": "0x1000000000"
17
}
18
]
19
}
20
},
21
...
22
}
23
}
Copied!

Parameters

Key
VALUE Type
Required
Description
bonds
T_LIST(T_DICT)
true
List of bond dict (MAX: 100 entries)
bonds.address
T_ADDR_EOA
true
Address of P-Rep to bond
bonds.value
T_INT
true
Bond amount in loop

getBond

Returns the bond status of a given address
Request
1
{
2
"jsonrpc": "2.0",
3
"id": 1234,
4
"method": "icx_call",
5
"params": {
6
"to": "cx0000000000000000000000000000000000000000",
7
"dataType": "call",
8
"data": {
9
"method": "getBond",
10
"params": {
11
"address": "hxe7af5fcfd8dfc67530a01a0e403882687528dfcb"
12
}
13
}
14
}
15
}
Copied!

Parameters

Key
VALUE Type
Required
Description
address
T_ADDR_EOA
true
Address to query
Example responses
1
{
2
"jsonrpc": "2.0",
3
"id": 1234,
4
"result": {
5
"bonds": [
6
{
7
"address": "hx1d6463e4628ee52a7f751e9d500a79222a7f3935",
8
"value": "0x3782dace9d90000"
9
},
10
{
11
"address": "hxb6bc0bf95d90cb3cd5b3abafd9682a62f36cc826",
12
"value": "0x6f05b59d3b20000"
13
}
14
],
15
"unbonds": [
16
{
17
"address": "hx1d6463e4628ee52a7f751e9d500a79222a7f3935",
18
"unbonding": "0x3782dace9d90000",
19
"expireBlockHeight": "0xa"
20
},
21
{
22
"address": "hxb6bc0bf95d90cb3cd5b3abafd9682a62f36cc826",
23
"unbonding": "0x6f05b59d3b20000",
24
"expireBlockHeight": "0xa"
25
}
26
]
27
}
28
}
Copied!

Returns

Key
VALUE Type
Required
Description
bonds
T_LIST(T_DICT)
true
List of bond dict
bonds.address
T_ADDR_EOA,T_ADDR_SCORE
true
Address of P-Rep to delegate
bonds.value
T_INT
true
Bond amount in loop
unbonds
T_LIST(T_DICT)
true
List of unbond dict
unbonds.address
T_ADDR_EOA,T_ADDR_SCORE
true
Address of P-Rep to delegate
unbonds.value
T_INT
true
Unbonding amount in loop
unbonds.expireBlockHeight
T_INT
true
BlockHeight when unBonding will be done

claimIScore

Claim the total reward that a ICONist has received
Request
1
{
2
"jsonrpc": "2.0",
3
"id": 1234,
4
"method": "icx_sendTransaction",
5
"params": {
6
"data": {
7
"method": "claimIScore"
8
},
9
...
10
}
11
}
Copied!

Parameters

N/A

EventLog

Name
Data Type
Indexed
Description
IScoreClaimedV2(Address,int,int)
T_STRING
true
Signature
IScore
T_INT
false
Reward amount in IScore
ICX
T_INT
false
Reward amount in loop

queryIScore

Returns the amount of I-Score that a ICONist has received as a reward
Request
1
{
2
"jsonrpc": "2.0",
3
"id": 1234,
4
"method": "icx_call",
5
"params": {
6
"to": "cx0000000000000000000000000000000000000000",
7
"dataType": "call",
8
"data": {
9
"method": "queryIScore",
10
"params": {
11
"address": "hxe7af5fcfd8dfc67530a01a0e403882687528dfcb"
12
}
13
}
14
}
15
}
Copied!

Parameters

Key
VALUE Type
Required
Description
address
T_ADDR_EOA
true
Address to query
Example responses
1
{
2
"jsonrpc": "2.0",
3
"id": 1234,
4
"result": {
5
"blockHeight": "0xe3d2",
6
"iscore": "0x3e8",
7
"estimatedICX": "0x1"
8
}
9
}
Copied!

Returns

Key
VALUE Type
Required
Description
blockHeight
T_INT
true
Block height when I-Score is estimated
iscore
T_INT
true
Amount of I-Score
estimatedICX
T_INT
true
Estimated amount in loop 1000 I-Score == 1 loop

registerPRep

Register an address as a P-Rep to Blockchain
  • 2000 ICX are required as a registration fee
Request
1
{
2
"jsonrpc": "2.0",
3
"id": 1234,
4
"method": "icx_sendTransaction",
5
"params": {
6
"value": "0x6c6b935b8bbd400000",
7
"data": {
8
"method": "registerPRep",
9
"params": {
10
"name": "ABC Node",
11
"country": "KOR",
12
"city": "Seoul",
13
"email": "[email protected]",
14
"website": "https://abc.example.com/",
15
"details": "https://abc.example.com/details/",
16
"p2pEndpoint": "abc.example.com:7100",
17
"nodeAddress": "hxe7af5fcfd8dfc67530a01a0e403882687528dfcb"
18
}
19
},
20
...
21
}
22
}
Copied!

Parameters

Key
VALUE Type
Required
Description
name
T_STRING
true
P-Rep name "ABC Node"
email
T_STRING
true
P-Rep email "[email protected]"
country
T_STRING
true
ISO 3166-1 ALPHA-3 "KOR", "USA", "CHN"
city
T_STRING
true
"Seoul", "New York", "Paris"
website
T_STRING
true
P-Rep homepage url "https://abc.example.com"
detailes
T_STRING
true
Url including P-Rep detail information "https://abc.example.com/details/"
p2pEndpoint
T_STRING
true
Network info used for connecting among P-Rep nodes "123.45.67.89:7100", "node.example.com:7100"
nodeAddress
T_STRING
False
Node Key for only consensus "hxe7af5fcfd8dfc67530a01a0e403882687528dfcb"

EventLog

Name
Data Type
Indexed
Description
PRepRegistered(Address)
T_STRING
true
Signature
Address
T_ADDR_EOA
false
P-Rep address

unregisterPRep

Unregister a P-Rep
Request
1
{
2
"jsonrpc": "2.0",
3
"id": 1234,
4
"method": "icx_sendTransaction",
5
"params": {
6
"data": {
7
"method": "unregisterPRep"
8
},
9
...
10
}
11
}
Copied!

Parameters

N/A

EventLog

Name
Data Type
Indexed
Description
PRepUnregistered(Address)
T_STRING
true
Signature
Address
T_ADDR_EOA
false
P-Rep address

setPRep

Update P-Rep register information
Request
1
{
2
"jsonrpc": "2.0",
3
"id": 1234,
4
"method": "icx_sendTransaction",
5
"params": {
6
"data": {
7
"method": "setPRep",
8
"params": {
9
"name": "Banana Node",
10
"email": "[email protected]",
11
"nodeAddress": "hxe7af5fcfd8dfc67530a01a0e403882687528dfcb"
12
}
13
},
14
...
15
}
16
}
Copied!

Parameters

Key
VALUE Type
Required
Description
name
T_STRING
false
P-Rep name "ABC Node"
email
T_STRING
false
P-Rep email "[email protected]"
country
T_STRING
false
ISO 3166-1 ALPHA-3 "KOR", "USA", "CHN"
city
T_STRING
false
"Seoul", "New York", "Paris"
website
T_STRING
false
P-Rep homepage url "https://abc.example.com"
detailes
T_STRING
false
Url including P-Rep detail information "https://abc.example.com/details/"
p2pEndpoint
T_STRING
false
Network info used for connecting among P-Rep nodes "123.45.67.89:7100", "node.example.com:7100"
nodeAddress
T_STRING
false
Node Key for only consensus "hxe7af5fcfd8dfc67530a01a0e403882687528dfcb"

EventLog

Name
Data Type
Indexed
Description
PRepSet(Address)
T_STRING
true
Signature
Address
T_ADDR_EOA
false
P-Rep address

getPRep

Returns P-Rep register information
Request
1
{
2
"jsonrpc": "2.0",
3
"id": 1234,
4
"method": "icx_call",
5
"params": {
6
"to": "cx0000000000000000000000000000000000000000",
7
"dataType": "call",
8
"data": {
9
"method": "getPRep",
10
"params": {
11
"address": "hxe7af5fcfd8dfc67530a01a0e403882687528dfcb"
12
}
13
}
14
}
15
}
Copied!

Parameters

Key
VALUE Type
Required
Description
address
T_ADDR_EOA
true
Address to query
Example responses
1
{
2
"jsonrpc": "2.0",
3
"id": 1234,
4
"result": {
5
"status": "0x0",
6
"grade": "0x2",
7
"address": "hxe7af5fcfd8dfc67530a01a0e403882687528dfcb",
8
"name": "banana",
9
"country": "KOR",
10
"city": "Seoul",
11
"email": "[email protected]",
12
"website": "https://icon.banana.com",
13
"details": "https://icon.banana.com/json",
14
"p2pEndpoint": "123.45.67.89:7100",
15
"nodeAddress": "hxe7af5fcfd8dfc67530a01a0e403882687528dfcb",
16
"irep": "0xa968163f0a57b400000",
17
"irepUpdateBlockHeight": "0x847ea",
18
"stake": "0x38372",
19
"delegated": "0x74287392847",
20
"totalBlocks": "0x83261e7",
21
"validatedBlocks": "0x83258a9"
22
}
23
}
Copied!

Returns

Key
VALUE Type
Required
Description
status
T_INT
true
0: active 1: unregistered
grade
T_INT
true
0: Main P-Rep 1: Sub P-Rep 2: P-Rep candidate
address
T_ADDR_EOA
true
P-Rep address
name
T_STRING
true
P-Rep name "ABC Node"
email
T_STRING
true
P-Rep email "[email protected]"
country
T_STRING
true
ISO 3166-1 ALPHA-3 "KOR", "USA", "CHN"
city
T_STRING
true
"Seoul", "New York", "Paris"
website
T_STRING
true
P-Rep homepage url "https://abc.example.com"
detailes
T_STRING
true
Url including P-Rep detail information "https://abc.example.com/details/"
p2pEndpoint
T_STRING
true
Network info used for connecting among P-Rep nodes "123.45.67.89:7100", "node.example.com:7100"
nodeAddress
T_STRING
true
Node Key for only consensus "hxe7af5fcfd8dfc67530a01a0e403882687528dfcb"
irep
T_INT
true
Incentive rep used to calculate the reward for P-Rep Limit: +- 20% of the previous value Unit: loop
irepUpdatedBlockHeight
T_INT
true
Block height when a P-Rep changed I-Rep value
lastGenerateBlockHeight
T_INT
true
Height of the last block which a P-Rep generated
stake
T_INT
true
Amount of stake that a P-Rep has
delegated
T_INT
true
Delegation amount that a P-Rep receives from ICONists
totalBlocks
T_INT
true
The number of blocks that a P-Rep received when running as a Main P-Rep
validatedBlocks
T_INT
true
The number of blocks that a P-Rep validated when running as a Main P-Rep

getPReps

Returns the status of all registered P-Rep candidates in descending order by delegated ICX amount
  • Unregistered or disqualified P-Reps are not included
Request
1
{
2
"jsonrpc": "2.0",
3
"id": 1234,
4
"method": "icx_call",
5
"params": {
6
"to": "cx0000000000000000000000000000000000000000",
7
"dataType": "call",
8
"data": {
9
"method": "getPReps",
10
"params": {
11
"startRanking": "0x1",
12
"endRanking": "0xa"
13
}
14
}
15
}
16
}
Copied!

Parameters

Key
VALUE Type
Required
Description
startRanking
T_INT
false
Default: 1 P-Rep list which starts from start ranking
endRanking
T_INT
false
Default: the last ranking
Example responses
1
{
2
"jsonrpc": "2.0",
3
"id": 1234,
4
"result": {
5
"blockHeight": "0x1234",
6
"startRanking": "0x1",
7
"totalDelegated": "0x2863c1f5cdae42f9540000000",
8
"totalStake": "0x193e5939a08ce9dbd480000000",
9
"preps": [
10
{
11
"status": "0x0",
12
"grade": "0x2",
13
"address": "hxe7af5fcfd8dfc67530a01a0e403882687528dfcb",
14
"name": "banana",
15
"country": "KOR",
16
"city": "Seoul",
17
"email": "[email protected]",
18
"website": "https://icon.banana.com",
19
"details": "https://icon.banana.com/json",
20
"p2pEndpoint": "123.45.67.89:7100",
21
"nodeAddress": "hxe7af5fcfd8dfc67530a01a0e403882687528dfcb",
22
"irep": "0xa968163f0a57b400000",
23
"irepUpdateBlockHeight": "0x847ea",
24
"stake": "0x38372",
25
"delegated": "0x74287392847",
26
"totalBlocks": "0x83261e7",
27
"validatedBlocks": "0x83258a9"
28
},
29
{
30
"status": "0x0",
31
"grade": "0x2",
32
"name": "ABC Node",
33
"address": "hx1d6463e4628ee52a7f751e9d500a79222a7f3935",
34
"country": "USA",
35
"city": "New York",
36
"email": "[email protected]",
37
"website": "https://icon.banana.com",
38
"details": "https://icon.banana.com/json",
39
"p2pEndpoint": "123.45.67.89:7100",
40
"nodeAddress": "hx1d6463e4628ee52a7f751e9d500a79222a7f3935",
41
"irep": "0xc350",
42
"irepUpdateBlockHeight": "0x1100",
43
"lastGenerateBlockHeight": "0x1200",
44
"stake": "0x28a857425466f800000",
45
"delegated": "0x9ed194db19b238c000000",
46
"totalBlocks": "0x2720",
47
"validatedBlocks": "0x2348"
48
},
49
...
50
]
51
}
52
}
Copied!

Returns

Key
VALUE Type
Required
Description
blockHeight
T_INT
true
The latest block height when this request was processed
startRanking
T_INT
true
Start ranking of P-Rep list
totalDelegated
T_INT
true
Total delegation amount that all P-Reps receive
totalStake
T_INT
true
The sum of ICX that all ICONists stake
preps
T_LIST(T_DICT)
true
P-Rep list. Details : refer to getPRep

setBonderList

Set allowed bonder list to P-Rep
  • Maximum number of allowed ICONists to bond is 10
  • This transaction overwrites the previous bonder list information
Request
1
{
2
"jsonrpc": "2.0",
3
"id": 1234,
4
"method": "icx_sendTransaction",
5
"params": {
6
"data": {
7
"method": "setBonderList",
8
"params": {
9
"bonderList": [
10
"hx1d6463e4628ee52a7f751e9d500a79222a7f3935",
11
"cxb6bc0bf95d90cb3cd5b3abafd9682a62f36cc826"
12
]
13
}
14
},
15
...
16
}
17
}
Copied!

Parameters

Key
VALUE Type
Required
Description
bonderList
T_LIST(T_ADDR_EOA,T_ADDR_SCORE)
true
List of address (MAX: 100 entries)

getBonderList

Returns the allowed bonder list
Request
1
{
2
"jsonrpc": "2.0",
3
"id": 1234,
4
"method": "icx_call",
5
"params": {
6
"to": "cx0000000000000000000000000000000000000000",
7
"dataType": "call",
8
"data": {
9
"method": "getBonderList",
10
"params": {
11
"address": "hxe7af5fcfd8dfc67530a01a0e403882687528dfcb"
12
}
13
}
14
}
15
}
Copied!

Parameters

Key
VALUE Type
Required
Description
address
T_ADDR_EOA
true
Address to query
Example responses
1
{
2
"jsonrpc": "2.0",
3
"id": 1234,
4
"result": {
5
"bonderList": [
6
"hx1d6463e4628ee52a7f751e9d500a79222a7f3935",
7
"cxb6bc0bf95d90cb3cd5b3abafd9682a62f36cc826"
8
]
9
}
10
}
Copied!

Returns

Key
VALUE Type
Required
Description
bonderList
T_LIST(T_ADDR_EOA,T_ADDR_SCORE)
true
List of address (MAX: 100 entries)

References

Last modified 13d ago