Getting Started
After including the file saseul.min.js in your project, please follow:
1
2
3
4
5
6
7
8
9
10
11
| <script src="saseul.min.js"></script>
<script type="text/javascript">
SASEUL.Rpc.send(
SASEUL.Rpc.request(
{
type: "GetBalance",
address: "f8df34871e7d7d4b4bcb948fd41e0d4a362a6398043e",
}
), "https://main.saseul.net"
).then(function (r) { console.dir(r); });
</script>
|
You can see the following results on the console.
1
| {"code":200,"data":{"balance":"0"}}
|
Making address
SASEUL use ed25519, ripemd160, sha256 algorithm to make private key, public key, address.
Ed25519 is used to generate key pairs.
You can hash the public key generated by the ed25519 algorithm as follows to generate an address.
address = ID_HASH(public_key)
ID_HASH = SHORT_HASH + CHECKSUM
CHECKSHUM = SHA256(SHA256(SHORT_HASH)).SUBSTRING(0,4)
SHORT_HASH = RIPEMD160(SHA256(public_key))
SASEUL.Sign.privateKey
Example
1
| var key = SASEUL.Sign.privateKey();
|
Result
| Parameter |
Type |
Maxlength |
Description |
| - |
string |
64 |
Private Key |
SASEUL.Sign.publicKey
Example
1
2
3
| var key = SASEUL.Sign.publicKey(
'bbbdd1f301b5ab75deba2a6968e1e565eb9022102565e7cfa1169660dc0e2780'
);
|
Parameters
| Parameter |
Type |
Maxlength |
Description |
| private_key |
string |
64 |
Private Key |
Result
| Parameter |
Type |
Maxlength |
Description |
| - |
string |
64 |
Public Key |
SASEUL.Sign.address
Example
1
2
3
| var key = SASEUL.Sign.address(
'a7c015d0c3630b0633de14b0c83a4851c6a43b00faa75ae234b56b00d2015295'
);
|
Parameters
| Parameter |
Type |
Maxlength |
Description |
| public_key |
string |
64 |
Public Key |
Result
| Parameter |
Type |
Maxlength |
Description |
| - |
string |
44 |
Address |
SASEUL.Sign.keyValidity
Example
1
2
3
| var key = SASEUL.Sign.keyValidity(
'a7c015d0c3630b0633de14b0c83a4851c6a43b00faa75ae234b56b00d2015295'
);
|
Parameters
| Parameter |
Type |
Maxlength |
Description |
| key |
string |
64 |
Private Key or Public Key |
Result
| Parameter |
Type |
Maxlength |
Description |
| - |
bool |
|
(true / false) |
SASEUL.Sign.addressValidity
Example
1
2
3
| var key = SASEUL.Sign.addressValidity(
'f8df34871e7d7d4b4bcb948fd41e0d4a362a6398043e'
);
|
Parameters
| Parameter |
Type |
Maxlength |
Description |
| address |
string |
44 |
Address |
Result
| Parameter |
Type |
Maxlength |
Description |
| - |
bool |
|
(true / false) |
Making signature
SASEUL use ed25519 algorithm to make signature.
SASEUL.Sign.signature
Example
1
2
3
4
| var key = SASEUL.Sign.signature(
'contents object', // target contents
'bbbdd1f301b5ab75deba2a6968e1e565eb9022102565e7cfa1169660dc0e2780' // private key
);
|
Parameters
| Parameter |
Type |
Maxlength |
Description |
| obj |
any |
|
Target Contents |
| private_key |
string |
64 |
Private Key |
Result
| Parameter |
Type |
Maxlength |
Description |
| - |
string |
128 |
Signature |
SASEUL.Sign.signatureValidity
Example
1
2
3
4
5
| var key = SASEUL.Sign.signatureValidity(
'contents object', // target contents
'a7c015d0c3630b0633de14b0c83a4851c6a43b00faa75ae234b56b00d2015295', // public key
'e89b0a4df2e9b3e78c86d6e562b77bc6003e30c869f24e583d265172d02f30d84ffb911e6ad9e13cd416f0dfa1b1f7a0633b10240b3685d46c29159b8952510c' // signature
);
|
Parameters
| Parameter |
Type |
Maxlength |
Description |
| obj |
any |
|
Target Contents |
| public_key |
string |
64 |
Public Key |
| signature |
string |
128 |
Signature |
Result
| Parameter |
Type |
Maxlength |
Description |
| - |
string |
128 |
Signature |
Making transaction, request
“transaction” changes the status of the network.
All transactions are computed by a predefined smart contract code.
“request” queries the status of the network.
All requests are also computed by a predefined smart contract code.
SASEUL.Rpc.transaction
Example
1
2
3
4
5
6
7
8
| var obj = SASEUL.Rpc.transaction(
{
type: "Send",
to: "f8df34871e7d7d4b4bcb948fd41e0d4a362a6398043e",
amount: "1"
}, // Transaction object
'bbbdd1f301b5ab75deba2a6968e1e565eb9022102565e7cfa1169660dc0e2780' // private key
);
|
Parameters
| Parameter |
Type |
Maxlength |
Description |
| data |
array |
|
Transaction data |
| private_key |
string |
64 |
Private Key |
Result
| Parameter |
Type |
Maxlength |
Description |
| - |
object |
|
Signed transaction |
SASEUL.Rpc.request
Example
1
2
3
4
5
6
| var obj = SASEUL.Rpc.request(
{
type: "GetBalance",
address: "f8df34871e7d7d4b4bcb948fd41e0d4a362a6398043e",
} // Request object
);
|
Parameters
| Parameter |
Type |
Maxlength |
Description |
| data |
array |
|
Request data |
| private_key |
string |
64 |
Private Key (Optional) |
Result
| Parameter |
Type |
Maxlength |
Description |
| - |
object |
|
Signed request |
Send transaction, request data
SASEUL.Rpc.send
Returns the “Promise” object.
Example
1
2
3
4
5
6
7
8
9
| var obj = SASEUL.Rpc.request(
{
type: "GetBalance",
address: "f8df34871e7d7d4b4bcb948fd41e0d4a362a6398043e",
}
);
SASEUL.Rpc.send(obj, "https://main.saseul.net")
.then(function (r) { console.dir(r); });
|
Parameters
| Parameter |
Type |
Maxlength |
Description |
| obj |
object |
|
Signed transaction or request object |
| host |
string |
|
Node Url or Ip |
Result
| Parameter |
Type |
Maxlength |
Description |
| code |
int |
|
200: OK, 999 or, …: Error |
| data |
object |
|
Response datas |
| msg |
string |
|
Error message |
Search for Peers
SASEUL Public Network will probably contain the following three addresses:
- main.saseul.net
- aroma.saseul.net
- blanc.saseul.net
Test Network (Americano) will probably contain the following address:
If you want to know the address of the custom network,
the default address of the custom network will be provided by the creator of the custom network.
SASEUL.Rpc.searchPeers
Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
| var obj = SASEUL.Rpc.request(
{
type: "GetBalance",
address: "f8df34871e7d7d4b4bcb948fd41e0d4a362a6398043e",
}
);
SASEUL.Rpc.searchPeers(
[
"https://main.saseul.net",
"https://aroma.saseul.net",
"https://blanc.saseul.net",
]
).then(function (r) { console.dir(r); });
|
Parameters
| Parameter |
Type |
Maxlength |
Description |
| host_array |
array |
|
Default hosts |
Result
| Parameter |
Type |
Maxlength |
Description |
| - |
array |
|
Peers array |