Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
255 lines (211 sloc) 11.9 KB

Transfers

Transfers endpoint manages wallet transfers. You should use it to send and checks the state of your transfers. It saves all transfers you make in a database. Therefore it is possible to retrieve your funds if the hub goes down, satisfying the non-custodian property.

Send

Send a transfer to :recipient of :amount wei.

Endpoint

.. http:post:: /transfers

Request

Name Required Description Default Value Example
recipient required Ethereum address to sent the transaction to   0x62730609 0abaB3A6e14 00e9345bC60 c78a8BEf57
amount required Amount to be transfered in wei   1000000000 000000000

Response

Name Required Description Default Value Example
sender required Ethereum address used to perform the transaction   0x62730609 0abaB3A6e14 00e9345bC60 c78a8BEf57
recipient required Ethereum address of the recipient   0x62730609 0abaB3A6e14 00e9345bC60 c78a8BEf57
amount required Amount to be transfered in wei   1000000000 000000000
created_on required Date the transaction has been performed (ISO format)   1970-01-01 T00:00:00.0 00Z
nonce required Identifier generated from transaction   *1270040570 *
transactionId required Unique identifier of the transaction   1
status required Status of the transaction   confirmed, pending

Example

POST /transfers HTTP/1.1
Content-Type: application/json

{
    "recipient": "0x627306090abaB3A6e1400e9345bC60c78a8BEf57",
    "amount": 1
}
HTTP/1.1 200 OK
Content-Type: application/json

{
   "sender": "0x627306090abaB3A6e1400e9345bC60c78a8BEf57",
   "recipient": "0x627306090abaB3A6e1400e9345bC60c78a8BEf57",
   "amount": "1",
   "created_on": "1970-01-01T00:00:00.000Z",
   "nonce": "1270040570",
   "txId": 1,
   "status": "pending",
}

List

List all transfer performed by the daemon during this round. Filters can be applied.

Endpoint

.. http:get:: /transfers

Request

Name Required Description Default Value Example
count optional Amount to be transfered in wei 100 50
recipient optional Ethereum address to sent the transaction to   0x62730609 0abaB3A6e14 00e9345bC60 c78a8BEf57
sender optional Ethereum address used to perform the transaction SDK's ethereum address 0x62730609 0abaB3A6e14 00e9345bC60 c78a8BEf57
amount optional Amount to be transfered in wei   1000000000 000000000
transactionId optional Unique identifier of the transaction   1
status optional Status of the transaction confirmed confirmed, pending

Response

Array

Name Required Description Default Value Example
recipient required Ethereum address to sent the transaction to   0x62730609 0abaB3A6e14 00e9345bC60 c78a8BEf57
sender required Ethereum address used to perform the transaction SDK's ethereum address 0x62730609 0abaB3A6e14 00e9345bC60 c78a8BEf57
amount required Amount to be transfered in wei   1000000000 000000000
transactionId required Unique identifier of the transaction   1
status required Status of the transaction   confirmed, pending
nonce required Identifier generated from transaction   *1270040570 *
created_on required Date the transaction has been performed (ISO format)   1970-01-01 T00:00:00.0 00Z

Example

GET /transfers?status=pending HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json

[
   {
       "sender": "0x627306090abaB3A6e1400e9345bC60c78a8BEf57",
       "recipient": "0x627306090abaB3A6e1400e9345bC60c78a8BEf57",
       "amount": "1",
       "created_on": "1970-01-01T00:00:00.000Z",
       "nonce": "1270040570",
       "txId": 1,
       "status": "pending",
   }
]