RPC/LCD API

Public RPC/LCD Endpoint

Testnet

Please refer to Current testnet to get the latest chain ID, RPC, LCD and explorer for testnet

Mainnet

Please refer to this Github repo to get the latest chain ID, RPC, LCD and explorer for testnet

RPC/LCD API

Since LikeCoin chain is based on Cosmos SDK, you may refer to the Cosmos SDK documents for most of the API:

GET /auth/accounts/{address}

Returns the information about the account.
Some commonly used fields:
response.result.value.coins ([{amount: string, denom: string}]): the balance of the account. response.result.value.account_number (string): the account number, which is needed when signing transactions. response.result.value.sequence (string): the sequence for replay protection, which is needed when signing transactions.
Example:
1
{
2
"height": "574791",
3
"result": {
4
"type": "cosmos-sdk/Account",
5
"value": {
6
"address": "cosmos1mnyn7x24xj6vraxeeq56dfkxa009tvhgknhm04",
7
"coins": [
8
{
9
"denom": "nanolike",
10
"amount": "10000000000"
11
}
12
],
13
"public_key": null,
14
"account_number": "21",
15
"sequence": "0"
16
}
17
}
18
}
Copied!

GET /txs/{hash}

Fetch the transaction information.
A transaction may contain multiple messages, and if any of them failed during execution, the whole transaction fails without any state change, i.e. previous messages will be rollbacked.
User can check if the whole transaction succeeded by checking if the last object in response.logs shows success: true or not.
Example:
1
{
2
"height": "6455",
3
"txhash": "0311566B20DDE13FD8323513E94366EFD379812EA3A7283065398BE212399B60",
4
"data": "0A060A0473656E64",
5
"raw_log": "[{\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"send\"},{\"key\":\"sender\",\"value\":\"cosmos1ww3qews2y5jxe8apw2zt8stqqrcu2tptejfwaf\"},{\"key\":\"module\",\"value\":\"bank\"}]},{\"type\":\"transfer\",\"attributes\":[{\"key\":\"recipient\",\"value\":\"cosmos1ecrze4q94n7je5jyeueeym73t47px8ev0xfjtj\"},{\"key\":\"sender\",\"value\":\"cosmos1ww3qews2y5jxe8apw2zt8stqqrcu2tptejfwaf\"},{\"key\":\"amount\",\"value\":\"1nanolike\"}]}]}]",
6
"logs": [
7
{
8
"events": [
9
{
10
"type": "message",
11
"attributes": [
12
{
13
"key": "action",
14
"value": "send"
15
},
16
{
17
"key": "sender",
18
"value": "cosmos1ww3qews2y5jxe8apw2zt8stqqrcu2tptejfwaf"
19
},
20
{
21
"key": "module",
22
"value": "bank"
23
}
24
]
25
},
26
{
27
"type": "transfer",
28
"attributes": [
29
{
30
"key": "recipient",
31
"value": "cosmos1ecrze4q94n7je5jyeueeym73t47px8ev0xfjtj"
32
},
33
{
34
"key": "sender",
35
"value": "cosmos1ww3qews2y5jxe8apw2zt8stqqrcu2tptejfwaf"
36
},
37
{
38
"key": "amount",
39
"value": "1nanolike"
40
}
41
]
42
}
43
]
44
}
45
],
46
"gas_wanted": "200000",
47
"gas_used": "64621",
48
"tx": {
49
"type": "cosmos-sdk/StdTx",
50
"value": {
51
"msg": [
52
{
53
"type": "cosmos-sdk/MsgSend",
54
"value": {
55
"from_address": "cosmos1ww3qews2y5jxe8apw2zt8stqqrcu2tptejfwaf",
56
"to_address": "cosmos1ecrze4q94n7je5jyeueeym73t47px8ev0xfjtj",
57
"amount": [
58
{
59
"denom": "nanolike",
60
"amount": "1"
61
}
62
]
63
}
64
}
65
],
66
"fee": {
67
"amount": [],
68
"gas": "200000"
69
},
70
"signatures": [],
71
"memo": "",
72
"timeout_height": "0"
73
}
74
},
75
"timestamp": "2021-08-19T02:57:22Z"
76
}
77
Copied!

POST /txs

Sends a signed transaction.
Example request body:
1
{
2
"mode":"sync",
3
"tx":{
4
"msg":[
5
{
6
"type":"cosmos-sdk/MsgSend",
7
"value":{
8
"from_address":"cosmos1mnyn7x24xj6vraxeeq56dfkxa009tvhgknhm04",
9
"to_address":"cosmos1ca0zlqxjqv5gek5qxm602umtkmu88564hpyws4",
10
"amount":[
11
{
12
"denom":"nanolike",
13
"amount":"123456789"
14
}
15
]
16
}
17
}
18
],
19
"fee":{
20
"amount":[
21
{
22
"denom":"nanolike",
23
"amount":"44000000"
24
}
25
],
26
"gas":"44000"
27
},
28
"memo":"",
29
"signatures":[
30
{
31
"signature":"yXcQvLVEHZMIzZijEgmcL5S7orusBURZoRjWuG1IpoItt5DhY8P9TUaxx31huxV200l6GcEbUlB/Y7jONuf3Bw==",
32
"account_number":"21",
33
"sequence":"0",
34
"pub_key":{
35
"type":"tendermint/PubKeySecp256k1",
36
"value":"A0ZGrlBHMWtCMNAIbIrOxofwCxzZ0dxjT2yzWKwKmo//"
37
}
38
}
39
]
40
}
41
}
Copied!
Response:
1
{
2
"height":"0",
3
"logs":[
4
{
5
"log":"",
6
"msg_index":0,
7
"success":true
8
}
9
],
10
"raw_log":"[{\"msg_index\":0,\"success\":true,\"log\":\"\"}]",
11
"txhash":"8C3A38A9F340050C459DCD9C3F52396E7C76FC286BA879C791C233580F7A64F0"
12
}
Copied!