Ell

ell_send

Send a transaction. Send ELL from one account to another account.

Private: Requires authentication.

Curl Example:

curl \ 
    -H "Authorization: Bearer xxxx.fQ.bk6c9uBbEUBDAwnPY_Gs5p7m4zgwY" 
    -X POST \
    127.0.0.1:8987 \
    --data '{"jsonrpc":"2.0",
                "method":"ell_send", 
                "params": { 
                    "fee":"0.01",
                    "from":"e2MhrMh7xvpByj3G3pKdHPfwFfNS7yRaRx",
                    "hash":"0x073a2bca8dbbac9b2dff4020314d53faa18f0530fa1c57ae9d8a7355317cda93",
                    "nonce":22,
                    "senderPubKey":"49EqPSyUhz8XnQfPajpFthKKkFUevM5CV13VgjRu8TAY9sgeYD2",
                    "sig":"0xa2cdbed94b8a30563a92fe038a112a232c68a68a06fd161b7335a635960e26bbff2b7a28b691a56b906f62738c44907a9598dd08dfa02afe0356cacab6647704",
                    "timestamp":1541769498,
                    "to":"e2Zs2nsmocrQcE1tPyVgm4deVSVVYppxum",
                    "type":1,
                    "value":"1"} , 
                "id":21}'

Console Example

> ell.send({
  "fee": "0.01",
  "from": "e2MhrMh7xvpByj3G3pKdHPfwFfNS7yRaRx",
  "hash": "0x073a2bca8dbbac9b2dff4020314d53faa18f0530fa1c57ae9d8a7355317cda93",
  "nonce": 22,
  "senderPubKey": "49EqPSyUhz8XnQfPajpFthKKkFUevM5CV13VgjRu8TAY9sgeYD2",
  "sig": "0xa2cdbed94b8a30563a92fe038a112a232c68a68a06fd161b7335a635960e26bbff2b7a28b691a56b906f62738c44907a9598dd08dfa02afe0356cacab6647704",
  "timestamp": 1541769498,
  "to": "e2Zs2nsmocrQcE1tPyVgm4deVSVVYppxum",
  "type": 1,
  "value": "1"
})

Console Example (Using Transaction Builder)

> ell.balance().
    senderPubKey("49EqPSyUhz8XnQfPajpFthKKkFUevM5CV13VgjRu8TAY9sgeYD2").
    from("e2MAm5dZS9biD31gENCoqTQd8DeTMrxoEo").
    to("e2Zs2nsmocrQcE1tPyVgm4deVSVVYppxum").
    value("1").
    fee("0.01").
    nonce("1").
    send()

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

Output:

{
  "id": 21,
  "jsonrpc": "2.0",
  "result": {
    "id": "0xe6167c8d32ca075eb2c5bbc6e87d9941bf4b2e564e85d0c447d91e98dd0bef2e"
  }
}

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

> var myBuilder = ell.balance()

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:

Full Console Example

> ell.balance().
    senderPubKey("49EqPSyUhz8XnQfPajpFthKKkFUevM5CV13VgjRu8TAY9sgeYD2").
    from("e2MAm5dZS9biD31gENCoqTQd8DeTMrxoEo").
    to("e2Zs2nsmocrQcE1tPyVgm4deVSVVYppxum").
    value("1").
    fee("0.01").
    nonce("1").
    send() // or payload() or packed(true)

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

Output:

{
  "id": 21,
  "jsonrpc": "2.0",
  "result": {
    "id": "0xe6167c8d32ca075eb2c5bbc6e87d9941bf4b2e564e85d0c447d91e98dd0bef2e"
  }
}

ell_getBalance

Get the ELL balance of an account.

Parameters:

Curl Example:

curl -X POST --data '{"jsonrpc":"2.0","method":"ell_getBalance", "params": "e2MhrMh7xvpByj3G3pKdHPfwFfNS7yRaRx", "id":21}'

Console Example

> ell.getBalance("e2MhrMh7xvpByj3G3pKdHPfwFfNS7yRaRx")

Returns:

String

Output:

{
  "id": 21,
  "jsonrpc": "2.0",
  "result": "100.000000000000000000"
}

ell_sendRaw

Send a base58 encoded transaction to the client for processing.

Parameters:

Curl Example:

curl -X POST --data '{"jsonrpc":"2.0","method":"ell_sendRaw", "params": "2ZRcZJ4LGqyMBEuAD8Cspa9h3sAoAs6vgifKEXM...ZXd9ubdWgBCkjCLewqu", "id":21}'

Console Example

> ell.sendRaw("2ZRcZJ4LGqyMBEuAD8Cspa9h3sAoAs6vgifKEXM1BSRtz" + 
                 "v2C5gshUL15zuv2x4FLDY9DywEMMLZKDWe3gUgAUWQnsfib" + 
                 "bRywBur4WApyZmBsZNjayy6zft6JnUjzv5XRbUe2UzvCwKkeRQ" + 
                 "r686p4zutSCjTK4L3cqp7Gv1LaiZT8WwdCr6ZcXxTkUPeoZyq2paZ" + 
                 "E856e27iqTWdecbeoEeR1UqK7RZZdqqJafYuUq8XaJ3MkqNznT2eD" + 
                 "jEmnwQhRH2WHCHGuCMdZHQUZ6WK7J9sgB9GoWgy3K3Q459JpjxFNw" +
                 "zJErVqnmnazZwdqmtCK5zq4kfXj9AbL86zxeKFx7xiN87raXJ6oWAQL" + 
                 "GYAphTSuWG1FgBy4d7SyUrDuDHfZwLeMPE2RZxCeHUGUrgpkiofPPpeb" + 
                 "p5SXeJiaTvJRAGntJgEXEpDBFxTpKxhaDZn1AUcYohyPXg71pCvuTc7sa" + 
                 "CmtFgWzWrQKfWXDKYeJF5RCA8LyQ4LRVheQuPTQXbQNDkcynGdkVZ2zuZLp" +
                 "qJhoFoeYrnB8u5bxzKoo4BiFfKjLVSh1RRuEZ2XzJRPKaqHYL9xBGA2cB2U6Z" +
                 "Xd9ubdWgBCkjCLewqu")

Returns:

Object

Output:

{
  "id": 21,
  "jsonrpc": "2.0",
  "result": {
    "id": "0xe6167c8d32ca075eb2c5bbc6e87d9941bf4b2e564e85d0c447d91e98dd0bef2e"
  }
}

Last updated