Transactions

Get List of Transactions
List of transactions matched by provided parameters.

GET /api/transactions?blockId=blockId&senderId=senderId&recipientId=recipientId&limit=limit&offset=offset&orderBy=field

Response

 {
  "success": true,
  "transactions": [
    "list of transactions objects"
  ]
}
  • blockId: Block id of transaction. (String)
  • senderId: Sender address of transaction. (String)
  • recipientId: Recipient of transaction. (String)
  • limit: Limit of transaction to send in response. Default is 20. (Number)
  • offset: Offset to load. (Integer number)
  • orderBy: Name of column to order. After column name must go "desc" or "asc" to choose order type. Example: orderBy=timestamp:desc (String)

All parameters join by "OR" by default, to join with "AND" specify AND: in front of the parameter.

Example - blockId

curl -k -X GET http://localhost:8000/api/transactions?blockId=<blockId>

Example - senderId

curl -k -X GET http://localhost:8000/api/transactions?senderId=<senderId>

Example - recipientId

curl -k -X GET http://localhost:8000/api/transactions?recipientId=<recipientId>

Send Transaction

Send transaction to broadcast network.

PUT /api/transactions

Request

 {
    "secret" : "Secret key of account",
    "amount" : /* Amount of transaction * 10^8. Example: to send 1.1234 LISK, use 112340000 as amount */,
    "recipientId" : "Recipient of transaction. Address or username.",
    "publicKey" : "Public key of sender account, to verify secret passphrase in wallet. Optional, only for UI",
    "secondSecret" : "Secret key from second transaction, required if user uses second signature"
}

Response

 {
  "success": true,
  "transactionId": "id of added transaction"
}

Example

curl -k -H "Content-Type: application/json" \
-X PUT -d '{"secret":"<INSERT SECRET HERE>","amount":<INSERT AMOUNT HERE>,"recipientId":"<INSERT WALLET ADDRESS HERE>"}' \
http://localhost:8000/api/transactions

Example - Second Secret

curl -k -H "Content-Type: application/json" \
-X PUT -d '{"secret":"<INSERT SECRET HERE>","secondSecret":"<INSERT SECOND SECRET HERE>",
"amount":<INSERT AMOUNT HERE>,"recipientId":"<INSERT WALLET ADDRESS HERE>"}' \
http://localhost:8000/api/transactions

Get Transaction

Get transaction that matches the provided id.

GET /api/transactions/get?id=id [- id: String of transaction (String)]

Response

 {
  "success": true,
  "transaction": {
    "id": "Id of transaction. String",
    "height": "Tx blockchain height. Integer",
    "blockId" "Tx blockId. String",
    "type": "Type of transaction. Integer",
    "timestamp": "Timestamp of transaction. Integer",
    "senderPublicKey": "Sender public key of transaction. Hex",
    "senderId": "Address of transaction sender. String",
    "recipientId": "Recipient id of transaction. String",
    "amount": "Amount. Integer",
    "fee": "Fee. Integer",
    "signature": "Signature. Hex",
    "signatures": "Signatures. Array",
    "confirmations": "Number of confirmations. Integer",
    "asset": "Resources. Object"
  }
}

Example

curl -k -X GET http://localhost:8000/api/transactions/get?id=<id>

Get Unconfirmed Transaction

Get unconfirmed transaction that matches the provided id.

GET /api/transactions/unconfirmed/get?id=id [- id: String of transaction (String)]

Response

 {
  "success": true,
  "transaction": {
    "type": "Type of transaction. Integer",
    "amount": "Amount. Integer",
    "senderPublicKey": "Sender public key of transaction. Hex",
    "timestamp": "Timestamp of transaction. Integer",
    "asset": "Resources. Object"
    "recipientId": "Recipient id of transaction. String",
    "signature": "Signature. Hex",
    "id": "Id of transaction. String",
    "fee": "Fee. Integer",
    "senderId": "Address of transaction sender. String",
    "relays": "Propagation. Integer",
    "receivedAt": "Timestamp. String"
  }
}

Example

curl -k -X GET http://localhost:8000/api/transactions/unconfirmed/get?id=<id>

Get List of Unconfirmed Transactions

Gets a list of unconfirmed transactions.

GET /api/transactions/unconfirmed

Response

 {
    "success" : true,
    "transactions" : [list of transaction objects]
}

Example

curl -k -X GET http://localhost:8000/api/transactions/unconfirmed

Get List of Queued Transactions

Gets a list of queued transactions.

GET /api/transactions/queued

Response

 {
    "success" : true,
    "transactions" : [list of transaction objects]
}

Example

curl -k -X GET http://localhost:8000/api/transactions/queued

Get Specific Queued Transaction

Get queued transaction that matches the provided id.

GET /api/transactions/queued/get?id=id [- id: String of transaction (String)]

Response

 {
  "success": true,
  "transaction": {
    "id": "Id of transaction. String",
    "type": "Type of transaction. Integer",
    "subtype": "Subtype of transaction. Integer",
    "timestamp": "Timestamp of transaction. Integer",
    "senderPublicKey": "Sender public key of transaction. Hex",
    "senderId": "Address of transaction sender. String",
    "recipientId": "Recipient id of transaction. String",
    "amount": "Amount. Integer",
    "fee": "Fee. Integer",
    "signature": "Signature. Hex",
    "signSignature": "Second signature. Hex",
    "confirmations": "Number of confirmations. Integer"
  }
}

Example

curl -k -X GET http://localhost:8000/api/transactions/queued/get?id=<id>

What's next?
Peers