Getting Started
You can access the SASEUL node with HTTP or HTTPS and use RPC in the GET or POST method.
In case of GET method, provide request parameters in query string.
- URL: {host}/{RPC_API_NAME}?{request parameters}
In case of POST method, provide request parameters in form-data with key-value format.
- URL: {host}/{RPC_API_NAME}
- Body: {request parameters}
Basic Operation
Ping
Check that the SASEUL node is active.
Return Value
1
2
3
4
| {
"code": 200,
"data": []
}
|
Info
Get the node’s status, version, mining state, and latest block information.
Return Value
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
| {
"code": 200,
"data": {
"status": "is_running",
"version": "2.2.0.3",
"mining": false,
"last_block": {
"height": 3410254,
"s_timestamp": 1773050473000000,
"previous_blockhash": "064c947b1358...",
"blockhash": "064c947b9cac...",
"transaction_count": 1
},
"last_resource_block": {
"height": 2036292,
"blockhash": "064c9478eb77...",
"previous_blockhash": "064c94722363...",
"nonce": "08e5b4126a3f...",
"timestamp": 1773050427832196,
"difficulty": "720140924964913",
"main_height": 3410247,
"main_blockhash": "064c9471e57d...",
"validator": "b910526bb3a8...",
"miner": "bd4f109b6a96...",
"receipt_count": 0
}
}
}
|
| Field | Description |
|---|
status | Node process status (e.g. is_running). |
version | SASEUL version string. |
mining | Whether mining is active. |
last_block | Latest main chain block. |
last_resource_block | Latest resource chain block. |
Tracker Operation
Peer
Get the list of nodes on the network that are associated with the SASEUL node.
Request Parameters
| Parameter | Requirements | Type | Maxlength | Description |
|---|
| register | optional | Boolean(int) | | Determines whether to send a request to the target node to register itself. |
| host | optional | String | | If the ‘register’ variable is true, enter the host variable to register. |
| authentication | optional | Boolean(int) | | Requests the network information of the target node. |
| height | optional | Int | | If the ‘authentication’ variable is true, add the verification block number to be registered. |
Return value
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| {
"code": 200,
"data": {
"peers": {
...
},
"known_hosts": [
...
],
"node": {
...
}
},
"register": true,
"registerResult": true,
"authentication": true
}
|
Round Operation
Round
Get information of a specific block height.
Request Parameters
| Parameter | Requirements | Type | Maxlength | Description |
|---|
| chain_type | optional | String | | main |
| height | optional | int | | height of recent block |
Return value
1
2
3
4
5
6
7
8
9
10
| {
"code": 200,
"data": {
"block": {
...
},
"sync_limit": 40362,
"timestamp": 1656048496844843
}
}
|
Smart Contracts and Requests
Request
Execute a smart contract read method using data stored in the local node.
Request Parameters
| Parameter | Required | Type | Description |
|---|
request | Yes | String | JSON-encoded method call: {"type":"<method_name>", ...} |
public_key | No | String | Public key for signed requests. |
signature | No | String | Signature for signed requests. |
Example
1
2
| curl -X POST main.saseul.net/request \
--data 'request={"type":"GetBalance","address":"<address>"}'
|
RawRequest
Same as request, but accepts a single JSON body instead of form-data parameters.
Request Parameters
| Parameter | Required | Type | Description |
|---|
body | Yes | Object | {"request":{"type":"<method_name>", ...}, "public_key":"...", "signature":"..."} |
Example
1
2
3
| curl -X POST main.saseul.net/rawrequest \
-H 'Content-Type: application/json' \
--data '{"request":{"type":"GetBalance","address":"<address>"}}'
|
SendTransaction
- URL:
{host}/sendtransaction
Execute a smart contract method to create and broadcast a transaction.
Request Parameters
| Parameter | Required | Type | Description |
|---|
transaction | Yes | String | JSON-encoded method call: {"type":"<method_name>", ...} |
public_key | Yes | String | Public key of the signer. |
signature | Yes | String | Signature of the transaction. |
Example
1
2
| curl -X POST main.saseul.net/sendtransaction \
--data 'transaction={"type":"Send","to":"<address>","amount":"<amount>"}&public_key=<public_key>&signature=<signature>'
|
SendRawTransaction
- URL:
{host}/sendrawtransaction
Same as sendtransaction, but accepts a single JSON body instead of form-data parameters.
Request Parameters
| Parameter | Required | Type | Description |
|---|
body | Yes | Object | {"transaction":{"type":"<method_name>", ...}, "public_key":"...", "signature":"..."} |
Example
1
2
3
| curl -X POST main.saseul.net/sendrawtransaction \
-H 'Content-Type: application/json' \
--data '{"transaction":{"type":"Send","to":"<address>","amount":"<amount>"},"public_key":"<public_key>","signature":"<signature>"}'
|
Weight
Calculate the fee weight of a transaction before broadcasting. Use this to estimate the transaction cost in advance.
Request Parameters
Same parameters as SendTransaction or SendRawTransaction.
Data Inspection
Inspect
Query contract status data directly by status key. This allows low-level access to on-chain state values.
Request Parameters
| Parameter | Required | Type | Description |
|---|
type | Yes | String | Status type: universal or local. |
key | Yes | String | Status key to look up. |
Example
1
2
| curl -X POST main.saseul.net/inspect \
--data 'type=universal&key=<status_key>'
|
How to compute a status key
A status key is derived from the contract code. For example, if a contract reads a universal status like this:
1
| let total_supply = op.read_universal('total_supply', SASEUL.Enc.ZERO_ADDRESS, '0');
|
You can compute the corresponding status key using SASEUL JS:
1
2
3
4
5
| let zero_address = SASEUL.Enc.ZERO_ADDRESS;
let system_nonce = '<nonce from ini file>';
let space = SASEUL.Enc.hash(system_nonce);
let key = 'total_supply';
let status_key = SASEUL.Enc.hash(zero_address + space + key) + zero_address;
|
The key format is: hash(writer + space + attr) + id, where writer is the contract deployer address, space is the hashed contract nonce (the nonce value is defined in the contract’s ini file), attr is the status field name, and id is the target address.