Ell

ell_send

Send a transaction. Send ELL from one account to another account.
Private: Requires authentication.
Curl Example:
1
curl \
2
-H "Authorization: Bearer xxxx.fQ.bk6c9uBbEUBDAwnPY_Gs5p7m4zgwY"
3
-X POST \
4
127.0.0.1:8987 \
5
--data '{"jsonrpc":"2.0",
6
"method":"ell_send",
7
"params": {
8
"fee":"0.01",
9
"from":"e2MhrMh7xvpByj3G3pKdHPfwFfNS7yRaRx",
10
"hash":"0x073a2bca8dbbac9b2dff4020314d53faa18f0530fa1c57ae9d8a7355317cda93",
11
"nonce":22,
12
"senderPubKey":"49EqPSyUhz8XnQfPajpFthKKkFUevM5CV13VgjRu8TAY9sgeYD2",
13
"sig":"0xa2cdbed94b8a30563a92fe038a112a232c68a68a06fd161b7335a635960e26bbff2b7a28b691a56b906f62738c44907a9598dd08dfa02afe0356cacab6647704",
14
"timestamp":1541769498,
15
"to":"e2Zs2nsmocrQcE1tPyVgm4deVSVVYppxum",
16
"type":1,
17
"value":"1"} ,
18
"id":21}'
Copied!

Console Example

1
> ell.send({
2
"fee": "0.01",
3
"from": "e2MhrMh7xvpByj3G3pKdHPfwFfNS7yRaRx",
4
"hash": "0x073a2bca8dbbac9b2dff4020314d53faa18f0530fa1c57ae9d8a7355317cda93",
5
"nonce": 22,
6
"senderPubKey": "49EqPSyUhz8XnQfPajpFthKKkFUevM5CV13VgjRu8TAY9sgeYD2",
7
"sig": "0xa2cdbed94b8a30563a92fe038a112a232c68a68a06fd161b7335a635960e26bbff2b7a28b691a56b906f62738c44907a9598dd08dfa02afe0356cacab6647704",
8
"timestamp": 1541769498,
9
"to": "e2Zs2nsmocrQcE1tPyVgm4deVSVVYppxum",
10
"type": 1,
11
"value": "1"
12
})
Copied!

Console Example (Using Transaction Builder)

1
> ell.balance().
2
senderPubKey("49EqPSyUhz8XnQfPajpFthKKkFUevM5CV13VgjRu8TAY9sgeYD2").
3
from("e2MAm5dZS9biD31gENCoqTQd8DeTMrxoEo").
4
to("e2Zs2nsmocrQcE1tPyVgm4deVSVVYppxum").
5
value("1").
6
fee("0.01").
7
nonce("1").
8
send()
Copied!
By default, when from() is not called, the address of the loaded account is used.
By default, then senderPubKey() is not called, the public key of the loaded account is used.
Calling nonce() is optional. The current sender account's nonce will be automatically determined and set.

Returns:

Object
Field
Type
Description
id
String
The transaction hash

Output:

1
{
2
"id": 21,
3
"jsonrpc": "2.0",
4
"result": {
5
"id": "0xe6167c8d32ca075eb2c5bbc6e87d9941bf4b2e564e85d0c447d91e98dd0bef2e"
6
}
7
}
Copied!

ell.balance

Returns a transaction builder that can be used to create a balance transaction using chain-able methods interface. The transaction builder calls ell_send when the built transaction is ready to be sent to the node.

Create a new builder

1
> var myBuilder = ell.balance()
Copied!

Transaction Builder Methods

The build is an object that includes methods required to conveniently construct and sign a full transaction. These are the available methods:
Method
Argument Type
Return Type
Required
Description
senderPubKey
String
TxBuilder
False
Set the public key of the sender/signer. (Default: Public key of the loaded account)
from
String
TxBuilder
False
Set the sender's address. (Default: Address of the loaded account)
to
String
TxBuilder
True
The recipients address.
value
String
TxBuilder
True
The amount of ELL to send.
fee
String
TxBuilder
True
The amount of fee to pay.
nonce
String
TxBuilder
False
The next nonce of the account (current nonce + 1).
send
TxResult
Finalizes and sends the transaction.
payload
Boolean
Returns the internal transaction that's being built.
packed
Base58Check
String
Finalizes and returns Base58 encoded version of the transaction
reset
Clears all collected data. Restore the builder to its zero state.

Full Console Example

1
> ell.balance().
2
senderPubKey("49EqPSyUhz8XnQfPajpFthKKkFUevM5CV13VgjRu8TAY9sgeYD2").
3
from("e2MAm5dZS9biD31gENCoqTQd8DeTMrxoEo").
4
to("e2Zs2nsmocrQcE1tPyVgm4deVSVVYppxum").
5
value("1").
6
fee("0.01").
7
nonce("1").
8
send() // or payload() or packed(true)
Copied!
Whenfrom()is not called, the address of the loaded account is used.
WhensenderPubKey()is not called, the public key of the loaded account is used.
Calling nonce() is optional. The current sender account's nonce will be automatically determined and set.
By default, the transaction type is set to 1 = Balance Transaction.

Returns:

Object
Field
Type
Description
id
String
The transaction hash

Output:

1
{
2
"id": 21,
3
"jsonrpc": "2.0",
4
"result": {
5
"id": "0xe6167c8d32ca075eb2c5bbc6e87d9941bf4b2e564e85d0c447d91e98dd0bef2e"
6
}
7
}
Copied!

ell_getBalance

Get the ELL balance of an account.
Parameters:
Argument
Type
Required
Description
address
String
True
The address of the account.
Curl Example:
1
curl -X POST --data '{"jsonrpc":"2.0","method":"ell_getBalance", "params": "e2MhrMh7xvpByj3G3pKdHPfwFfNS7yRaRx", "id":21}'
Copied!

Console Example

1
> ell.getBalance("e2MhrMh7xvpByj3G3pKdHPfwFfNS7yRaRx")
Copied!

Returns:

String

Output:

1
{
2
"id": 21,
3
"jsonrpc": "2.0",
4
"result": "100.000000000000000000"
5
}
Copied!

ell_sendRaw

Send a base58 encoded transaction to the client for processing.
Parameters:
Argument
Type
Required
Description
encodedTx
String
True
The base58 encoded transaction
Curl Example:
1
curl -X POST --data '{"jsonrpc":"2.0","method":"ell_sendRaw", "params": "2ZRcZJ4LGqyMBEuAD8Cspa9h3sAoAs6vgifKEXM...ZXd9ubdWgBCkjCLewqu", "id":21}'
Copied!

Console Example

1
> ell.sendRaw("2ZRcZJ4LGqyMBEuAD8Cspa9h3sAoAs6vgifKEXM1BSRtz" +
2
"v2C5gshUL15zuv2x4FLDY9DywEMMLZKDWe3gUgAUWQnsfib" +
3
"bRywBur4WApyZmBsZNjayy6zft6JnUjzv5XRbUe2UzvCwKkeRQ" +
4
"r686p4zutSCjTK4L3cqp7Gv1LaiZT8WwdCr6ZcXxTkUPeoZyq2paZ" +
5
"E856e27iqTWdecbeoEeR1UqK7RZZdqqJafYuUq8XaJ3MkqNznT2eD" +
6
"jEmnwQhRH2WHCHGuCMdZHQUZ6WK7J9sgB9GoWgy3K3Q459JpjxFNw" +
7
"zJErVqnmnazZwdqmtCK5zq4kfXj9AbL86zxeKFx7xiN87raXJ6oWAQL" +
8
"GYAphTSuWG1FgBy4d7SyUrDuDHfZwLeMPE2RZxCeHUGUrgpkiofPPpeb" +
9
"p5SXeJiaTvJRAGntJgEXEpDBFxTpKxhaDZn1AUcYohyPXg71pCvuTc7sa" +
10
"CmtFgWzWrQKfWXDKYeJF5RCA8LyQ4LRVheQuPTQXbQNDkcynGdkVZ2zuZLp" +
11
"qJhoFoeYrnB8u5bxzKoo4BiFfKjLVSh1RRuEZ2XzJRPKaqHYL9xBGA2cB2U6Z" +
12
"Xd9ubdWgBCkjCLewqu")
Copied!

Returns:

Object
Field
Type
Description
id
String
The transaction hash

Output:

1
{
2
"id": 21,
3
"jsonrpc": "2.0",
4
"result": {
5
"id": "0xe6167c8d32ca075eb2c5bbc6e87d9941bf4b2e564e85d0c447d91e98dd0bef2e"
6
}
7
}
Copied!