Transactions

https://img.shields.io/badge/auth-required-orange.svg

Hint

The rules for generating node queries are given in module How to use REST API.

GET /transactions/info/{id}

Query transaction information by its ID.

Query Parameters:

"id" - Transaction ID

Method Response:

{
  "type": 4,
  "id": "52GG9U2e6foYRKp5vAzsTQ86aDAABfRJ7synz7ohBp19",
  "sender": "3NBVqYXrapgJP9atQccdBPAgJPwHDKkh6A8",
  "senderPublicKey": "CRxqEuxhdZBEHX42MU4FfyJxuHmbDBTaHMhM3Uki7pLw",
  "recipient": "3NBVqYXrapgJP9atQccdBPAgJPwHDKkh6A8",
  "assetId": "E9yZC4cVhCDfbjFJCc9CqkAtkoFy5KaCe64iaxHM2adG",
  "amount": 100000,
  "fee": 100000,
  "timestamp": 1549365736923,
  "attachment": "string",
  "signature": "GknccUA79dBcwWgKjqB7vYHcnsj7caYETfncJhRkkaetbQon7DxbpMmvK9LYqUkirJp17geBJCRTNkHEoAjtsUm",
  "height": 7782
}

GET /transactions/address/{address}/limit/{limit}

Returns latest {limit} transactions from address {address}.

Method Response:

[
  [
    {
      "type": 2,
      "id": "4XE4M9eSoVWVdHwDYXqZsXhEc4q8PH9mDMUBegCSBBVHJyP2Yb1ZoGi59c1Qzq2TowLmymLNkFQjWp95CdddnyBW",
      "fee": 100000,
      "timestamp": 1549365736923,
      "signature": "4XE4M9eSoVWVdHwDYXqZsXhEc4q8PH9mDMUBegCSBBVHJyP2Yb1ZoGi59c1Qzq2TowLmymLNkFQjWp95CdddnyBW",
      "sender": "3NBVqYXrapgJP9atQccdBPAgJPwHDKkh6A8",
      "senderPublicKey": "CRxqEuxhdZBEHX42MU4FfyJxuHmbDBTaHMhM3Uki7pLw",
      "recipient": "3N9iRMou3pgmyPbFZn5QZQvBTQBkL2fR6R1",
      "amount": 1000000000
    }
  ]
]

GET /transactions/unconfirmed

Returns all unconfirmed transactions from node utx-pool.

Method Response:

[
  {
    "type": 4,
    "id": "52GG9U2e6foYRKp5vAzsTQ86aDAABfRJ7synz7ohBp19",
    "sender": "3NBVqYXrapgJP9atQccdBPAgJPwHDKkh6A8",
    "senderPublicKey": "CRxqEuxhdZBEHX42MU4FfyJxuHmbDBTaHMhM3Uki7pLw",
    "recipient": "3NBVqYXrapgJP9atQccdBPAgJPwHDKkh6A8",
    "assetId": "E9yZC4cVhCDfbjFJCc9CqkAtkoFy5KaCe64iaxHM2adG",
    "amount": 100000,
    "fee": 100000,
    "timestamp": 1549365736923,
    "attachment": "string",
    "signature": "GknccUA79dBcwWgKjqB7vYHcnsj7caYETfncJhRkkaetbQon7DxbpMmvK9LYqUkirJp17geBJCRTNkHEoAjtsUm"
  }
]

GET /transactions/unconfirmed/size

Return the number of transactions available in UTX pool.

GET /unconfirmed/info/{id}

Query transaction details from UTX pool by its ID.

POST /transactions/calculateFee

Calculates fee amount for transferred transaction.

Query Parameters

"type" - Transaction type
"senderPublicKey" - Public key of sender
"sender" is ignored
"fee" is ignored and all the other parameters appropriate for a transaction of the given type.

Method Query

{
 "type": 10,
 "timestamp": 1549365736923,
 "sender": "3MtrNP7AkTRuBhX4CBti6iT21pQpEnmHtyw",
 "alias": "ALIAS",
}

or

{
  "type": 4,
  "sender": "3MtrNP7AkTRuBhX4CBti6iT21pQpEnmHtyw",
  "recipient": "3P8JYPHrnXSfsWP1LVXySdzU1P83FE1ssDa",
  "amount": 1317209272,
  "feeAssetId": "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS",
  "attachment": "string"
}

Method Response

{
  "feeAssetId": null,
  "feeAmount": 10000
}

or

{
  "feeAssetId": "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS",
  "feeAmount": 10000
}

POST /transactions/sign

Signs a transaction with sender’s private key stored in node keystore. After signing, method response must be sent to method input Broadcast.

It is necessary to enter the password into the password field in order to sign requests with the key from keystore node.

Sample queries

ID

Transaction type

3

Issue

4

Transfer

5

Reissue

6

Burn

7

Exchange

8

Lease

9

Lease Cancel

10

Alias

11

Mass Transfer

12

Data

13

Set Script

14

Sponsorship

101

Permission (for Genesis block)

102

PermissionTransaction

103

CreateContractTransaction

104

CallContractTransaction

105

ExecutedContractTransaction

106

DisableContractTransaction

107

UpdateContractTransaction

110

GenesisRegisterNode Transaction

111

RegisterNode Transaction

112

CreatePolicy Transaction

113

UpdatePolicy Transaction

114

PolicyDataHash Transaction

3. Issue

{
   "type": 3,
   "version":2,
   "name": "Test Asset 1",
   "quantity": 100000000000,
   "description": "Some description",
   "sender": "3FSCKyfFo3566zwiJjSFLBwKvd826KXUaqR",
   "decimals": 8,
   "reissuable": true,
   "fee": 100000000
}

4. Transfer

{
  "type": 4,
  "version": 2,
  "sender": "3M6dRZXaJY9oMA3fJKhMALyYKt13D1aimZX",
  "password": "",
  "recipient": "3M6dRZXaJY9oMA3fJKhMALyYKt13D1aimZX",
  "amount": 40000000000,
  "fee": 100000
}

10. Alias

{
   "type": 10,
   "version": 2,
   "fee": 100000,
   "sender": "3N9vL3apA4j2L5PojHW8TYmfHx9Lo2ZaKPB",
   "alias": "hodler"
}

12. Data

{
   "type": 12,
   "version": 1,
   "sender": "3N9vL3apA4j2L5PojHW8TYmfHx9Lo2ZaKPB",
   "senderPublicKey": "Fbt5fKHesnQG2CXmsKf4TC8v9oB7bsy2AY56CUopa6H3",
   "author": "3N9vL3apA4j2L5PojHW8TYmfHx9Lo2ZaKPB",
   "data":
   [
      {
      "key": "objectId",
      "type": "string",
      "value": "obj:123:1234"
      }
   ],
   "fee": 100000
}

13. Set Script

{
   "type": 13,
   "version": 1,
   "sender": "3N9vL3apA4j2L5PojHW8TYmfHx9Lo2ZaKPB",
   "fee": 1000000,
   "name": "faucet",
   "script": "base64:AQQAAAAHJG1hdGNoMAUAAAACdHgG+RXSzQ=="
}

.. _tx-sponsorship:

14. Sponsorship

{
   "sender": "3JWDUsqyJEkVa1aivNPP8VCAa5zGuxiwD9t",
   "assetId": "G16FvJk9vabwxjQswh9CQAhbZzn3QrwqWjwnZB3qNVox",
   "fee": 100000000,
   "isEnabled": false,
   "type": 14,
   "password": "1234",
   "version": 1
}

102. PermissionTransaction

Sample query

{
   "type":102,
   "sender":"3GLWx8yUFcNSL3DER8kZyE4TpyAyNiEYsKG",
   "senderPublicKey":"4WnvQPit2Di1iYXDgDcXnJZ5yroKW54vauNoxdNeMi2g",
   "fee":0,
   "proofs":[""],
   "target":"3GPtj5osoYqHpyfmsFv7BMiyKsVzbG1ykfL",
   "opType":"add",
   "role":"contract_developer",
   "dueTimestamp":null
}

103. CreateContractTransaction

Sample query

{
  "fee": 100000000,
  "image": "stateful-increment-contract:latest",
  "imageHash": "7d3b915c82930dd79591aab040657338f64e5d8b842abe2d73d5c8f828584b65",
  "contractName": "stateful-increment-contract",
  "sender": "3PudkbvjV1nPj1TkuuRahh4sGdgfr4YAUV2",
  "password": "",
  "params": [],
  "type": 103,
  "version": 1,
 }

Sample response

{
    "type": 103,
    "id": "ULcq9R7PvUB2yPMrmBdxoTi3bcRmQPT3JDLLLZVj4Ky",
    "sender": "3N3YTj1tNwn8XUJ8ptGKbPuEFNa9GFnhqew",
    "senderPublicKey": "3kW7vy6nPC59BXM67n5N56rhhAv38Dws5skqDsjMVT2M",
    "fee": 500000,
    "timestamp": 1550591678479,
    "proofs": [ "yecRFZm9iBLyDy93bDVaNo1PR5Qkkic7196GAgUt9TNH1cnQphq4yGQQ8Fxj4BYA4TaqYVw5qxtWzGMPQyVeKYv" ],
    "version": 1,
    "image": "stateful-increment-contract:latest",
    "imageHash": "7d3b915c82930dd79591aab040657338f64e5d8b842abe2d73d5c8f828584b65",
    "contractName": "stateful-increment-contract",
    "params": [],
    "height": 1619
}

104. CallContractTransaction

Sample query

{
   "contractId": "2sqPS2VAKmK77FoNakw1VtDTCbDSa7nqh5wTXvJeYGo2",
   "fee": 10,
   "sender": "3PKyW5FSn4fmdrLcUnDMRHVyoDBxybRgP58",
   "type": 104,
   "version": 2,
   "contractVersion": 1
   "password": "",
   "params": [
      {
            "type": "integer",
            "key": "a",
            "value": 1
      },
      {
            "type": "integer",
            "key": "b",
            "value": 100

      }
   ]
}

Sample response

{
   "type": 104,
   "id": "9fBrL2n5TN473g1gNfoZqaAqAsAJCuHRHYxZpLexL3VP",
   "sender": "3PKyW5FSn4fmdrLcUnDMRHVyoDBxybRgP58",
   "senderPublicKey": "2YvzcVLrqLCqouVrFZynjfotEuPNV9GrdauNpgdWXLsq",
   "fee": 10,
   "timestamp": 1549365736923,
   "proofs": [
      "2q4cTBhDkEDkFxr7iYaHPAv1dzaKo5rDaTxPF5VHryyYTXxTPvN9Wb3YrsDYixKiUPXBnAyXzEcnKPFRCW9xVp4v"
   ],
   "version": 2,
   "contractId": "2sqPS2VAKmK77FoNakw1VtDTCbDSa7nqh5wTXvJeYGo2",
   "params": [
      {
      "key": "a",
      "type": "integer",
      "value": 1
      },
      {
      "key": "b",
      "type": "integer",
      "value": 100
      }
   ]
}

105. ExecutedContractTransaction

Sample response

{
   "type": 105,
   "id": "2UAHvs4KsfBbRVPm2dCigWtqUHuaNQou83CXy6DGDiRa",
   "sender": "3PKyW5FSn4fmdrLcUnDMRHVyoDBxybRgP58",
   "senderPublicKey": "2YvzcVLrqLCqouVrFZynjfotEuPNV9GrdauNpgdWXLsq",
   "fee": 500000,
   "timestamp": 1549365523980,
   "proofs": [
      "4BoG6wQnYyZWyUKzAwh5n1184tsEWUqUTWmXMExvvCU95xgk4UFB8iCnHJ4GhvJm86REB69hKM7s2WLAwTSXquAs"
   ],
   "version": 1,
   "tx": {
      "type": 103,
      "id": "2sqPS2VAKmK77FoNakw1VtDTCbDSa7nqh5wTXvJeYGo2",
      "sender": "3PKyW5FSn4fmdrLcUnDMRHVyoDBxybRgP58",
      "senderPublicKey": "2YvzcVLrqLCqouVrFZynjfotEuPNV9GrdauNpgdWXLsq",
      "fee": 500000,
      "timestamp": 1549365501462,
      "proofs": [
         "2ZK1Y1ecfQXeWsS5sfcTLM5W1KA3kwi9Up2H7z3Q6yVzMeGxT9xWJT6jREQsmuDBcvk3DCCiWBdFHaxazU8pbo41"
      ],
      "version": 1,
      "image": "localhost:5000/contract256",
      "imageHash": "930d18dacb4f49e07e2637a62115510f045da55ca16b9c7c503486828641d662",
      "params": []
   },
   "results": []
}

106. DisableContractTransaction

Sample query

{
    "sender":"3N3YTj1tNwn8XUJ8ptGKbPuEFNa9GFnhqew",
    "password": "",
    "contractId":"Fz3wqAWWcPMT4M1q6H7crLKtToFJvbeLSvqjaU4ZwMpg",
    "fee":500000,
    "type":106
}

Sample response

{
 "type": 106,
 "id": "8Nw34YbosEVhCx18pd81HqYac4C2pGjyLKck8NhSoGYH",
 "sender": "3N3YTj1tNwn8XUJ8ptGKbPuEFNa9GFnhqew",
 "senderPublicKey": "3kW7vy6nPC59BXM67n5N56rhhAv38Dws5skqDsjMVT2M",
 "fee": 500000,
 "proofs": [ "5GqPQkuRvG6LPXgPoCr9FogAdmhAaMbyFb5UfjQPUKdSc6BLuQSz75LAWix1ok2Z6PC5ezPpjqzqnr15i3RQmaEc" ],
 "version": 1,
 "contractId": "Fz3wqAWWcPMT4M1q6H7crLKtToFJvbeLSvqjaU4ZwMpg",
 "height": 1632
}

107. UpdateContractTransaction

Sample query

{
  "image" : "registry.wvservices.com/we-sc/tdm-increment3:1028.1",
  "sender" : "3Mxxz9pBYS5fJMARJNQmzYUHxiWAtvMzSRT",
  "password": "",
  "fee" : 100000000,
  "contractId" : "EnsihTUHSNAB9RcWXJbiWT98X3hYtCw3SBzK8nHQRCWA",
  "imageHash" : "0e5d280b9acf6efd8000184ad008757bb967b5266e9ebf476031fad1488c86a3",
  "type" : 107,
  "version" : 1
 }

Sample response

{
  "senderPublicKey":"5qBRDm74WKR5xK7LPs8vCy9QjzzqK4KCb8PL36fm55S3kEi2XZETHFgMgp3D13AwgE8bBkYrzvEvQZuabMfEyJwW",
  "tx":
  {
  "senderPublicKey":"5qBRDm74WKR5xK7LPs8vCy9QjzzqK4KCb8PL36fm55S3kEi2XZETHFgMgp3D13AwgE8bBkYrzvEvQZuabMfEyJwW",
  "image":"registry.wvservices.com/we-sc/tdm-increment3:1028.1",
  "sender":"3Mxxz9pBYS5fJMARJNQmzYUHxiWAtvMzSRT",
  "proofs":["3tNsTyteeZrxEbVSv5zPT6dr247nXsVWR5v7Khx8spypgZQUdorCQZV2guTomutUTcyxhJUjNkQW4VmSgbCtgm1Z"],
  "fee":0,
  "contractId":"EnsihTUHSNAB9RcWXJbiWT98X3hYtCw3SBzK8nHQRCWA",
  "id":"HdZdhXVveMT1vYzGTviCoGQU3aH6ZS3YtFpYujWeGCH6",
  "imageHash":"17d72ca20bf9393eb4f4496fa2b8aa002e851908b77af1d5db6abc9b8eae0217",
  "type":107,"version":1,"timestamp":1572355661572},
  "sender":"3HfRBedCpWi3vEzFSKEZDFXkyNWbWLWQmmG",
  "proofs":["28ADV8miUVN5EFjhqeFj6MADSXYjbxA3TsxSwFVs18jXAsHVaBczvnyoUSaYJsjRNmaWgXbpbduccRxpKGTs6tro"],
  "fee":0,"id":"7niVY8mjzeKqLBePvhTxFRfLu7BmcwVfqaqtbWAN8AA2",
  "type":105,
  "version":1,
  "results":[],
  "timestamp":1572355666866
  }
 }

110. GenesisRegisterNode

Sample query

{
   "type": 110,
   "id": "2Xgbsqgfbp5fiq4nsaAoTkQsXc399tXdnKom8prEZqPW2Q7xZKNKCCqpkyMtmJMgYLpvwynbxHPTFpFEfFdyLpJ",
   "fee": 0,
   "timestamp": 1489352400000,
   "signature": "2Xgbsqgfbp5fiq4nsaAoTkQsXc399tXdnKom8prEZqPW2Q7xZKNKCCqpkyMtmJMgYLpvwynbxHPTFpFEfFdyLpJ",
   "targetPublicKey": "3JNLQYuHYSHZiHr5KjJ89wwFJpDMdrAEJpj",
   "target": "3JNLQYuHYSHZiHr5KjJ89wwFJpDMdrAEJpj"
}

Sample response

{
   "signature": "2Xgbsqgfbp5fiq4nsaAoTkQsXc399tXdnKom8prEZqPW2Q7xZKNKCCqpkyMtmJMgYLpvwynbxHPTFpFEfFdyLpJ",
   "fee": 0,
   "id": "2Xgbsqgfbp5fiq4nsaAoTkQsXc399tXdnKom8prEZqPW2Q7xZKNKCCqpkyMtmJMgYLpvwynbxHPTFpFEfFdyLpJ",
   "type": 110,
   "targetPublicKey": "3JNLQYuHYSHZiHr5KjJ89wwFJpDMdrAEJpj",
   "timestamp": 1489352400000,
   "target": "3JNLQYuHYSHZiHr5KjJ89wwFJpDMdrAEJpj",
   "height": 1
}

111. RegisterNode

Sample query

{
 "type": 111,
 "opType": "add",
 "sender":"3HYW75PpAeVukmbYo9PQ3mzSHdKUgEytUUz",
 "password": "",
 "targetPubKey": "apgJP9atQccdBPAgJPwH3NBVqYXrapgJP9atQccdBPAgJPwHapgJP9atQccdBPAgJPwHDKkh6A8",
 "nodeName": "Node #1",
 "fee": 500000,
 }

112. CreatePolicy

Sample query

{
   "sender": "3NkZd8Xd4KsuPiNVsuphRNCZE3SqJycqv8d",
   "policyName": "Policy# 7777",
   "password":"[email protected]#$fsdf()*%",
   "recipients": [
     "3NkZd8Xd4KsuPiNVsuphRNCZE3SqJycqv8d",
     "3NotQaBygbSvYZW4ftJ2ZwLXex4rTHY1Qzn",
     "3Nm84ERiJqKfuqSYxzMAhaJXdj2ugA7Ve7T",
         "3NtNJV44wyxRXv2jyW3yXLxjJxvY1vR88TF",
         "3NxAooHUoLsAQvxBSqjE91WK3LwWGjiiCxx"
   ],
   "fee": 15000000,
   "description": "Buy bitcoin by 1c",
   "owners": [
     "3NkZd8Xd4KsuPiNVsuphRNCZE3SqJycqv8d",
     "3NotQaBygbSvYZW4ftJ2ZwLXex4rTHY1Qzn",
     "3Nm84ERiJqKfuqSYxzMAhaJXdj2ugA7Ve7T"
   ],
   "type": 112
 }

113. UpdatePolicy

Sample query

{
  "policyId": "7wphGbhqbmUgzuN5wzgqwqtViTiMdFezSa11fxRV58Lm",
  "password":"[email protected]#$fsdf()*%",
  "sender": "3NkZd8Xd4KsuPiNVsuphRNCZE3SqJycqv8d",
  "proofs": [],
  "recipients": [
  "3NkZd8Xd4KsuPiNVsuphRNCZE3SqJycqv8d",
  "3NotQaBygbSvYZW4ftJ2ZwLXex4rTHY1Qzn",
  "3Nm84ERiJqKfuqSYxzMAhaJXdj2ugA7Ve7T",
      "3NtNJV44wyxRXv2jyW3yXLxjJxvY1vR88TF",
      "3NxAooHUoLsAQvxBSqjE91WK3LwWGjiiCxx",
      "3NwJfjG5RpaDfxEhkwXgwD7oX21NMFCxJHL"
   ],
   "fee": 15000000,
   "opType": "add",
  "owners": [
    "3NkZd8Xd4KsuPiNVsuphRNCZE3SqJycqv8d",
    "3NotQaBygbSvYZW4ftJ2ZwLXex4rTHY1Qzn",
    "3Nm84ERiJqKfuqSYxzMAhaJXdj2ugA7Ve7T"
  ],
  "type": 113,
 }

114. PolicyDataHash

When a user sends confidential data to the network using the POST /privacy/sendData method, the node automatically generates the 114 transaction.

POST /transactions/broadcast

Sends a signed transaction to blockchain.

Method Query

{
 "type":10,
 "senderPublicKey":"G6h72icCSjdW2A89QWDb37hyXJoYKq3XuCUJY2joS3EU",
 "fee":100000000,
 "timestamp":1550591678479,
 "signature":"4gQyPXzJFEzMbsCd9u5n3B2WauEc4172ssyrXCL882oNa8NfNihnpKianHXrHWnZs1RzDLbQ9rcRYnSqxKWfEPJG",
 "alias":"dajzmj6gfuzmbfnhamsbuxivc"
}

Method Response

{
 "type":10,
 "id":"9q7X84wFuVvKqRdDQeWbtBmpsHt9SXFbvPPtUuKBVxxr",
 "sender":"3MtrNP7AkTRuBhX4CBti6iT21pQpEnmHtyw",
 "senderPublicKey":"G6h72icCSjdW2A89QWDb37hyXJoYKq3XuCUJY2joS3EU",
 "fee":100000000,
 "timestamp":1550591678479,
 "signature":"4gQyPXzJFEzMbsCd9u5n3B2WauEc4172ssyrXCL882oNa8NfNihnpKianHXrHWnZs1RzDLbQ9rcRYnSqxKWfEPJG",
 "alias":"dajzmj6gfuzmbfnhamsbuxivc"
}

POST ​/transactions​/signAndBroadcast

Signs and sends a signed transaction to the blockchain.

Method Query

{
"sender": "3NkZd8Xd4KsuPiNVsuphRNCZE3SqJycqv8d",
"policyName": "Policy# 7777",
"password":"[email protected]#$fsdf()*%",
"recipients": [
  "3NkZd8Xd4KsuPiNVsuphRNCZE3SqJycqv8d",
  "3NotQaBygbSvYZW4ftJ2ZwLXex4rTHY1Qzn",
  "3Nm84ERiJqKfuqSYxzMAhaJXdj2ugA7Ve7T",
      "3NtNJV44wyxRXv2jyW3yXLxjJxvY1vR88TF",
      "3NxAooHUoLsAQvxBSqjE91WK3LwWGjiiCxx"
],
"fee": 15000000,
"description": "Buy bitcoin by 1c",
"owners": [
  "3NkZd8Xd4KsuPiNVsuphRNCZE3SqJycqv8d",
  "3NotQaBygbSvYZW4ftJ2ZwLXex4rTHY1Qzn",
  "3Nm84ERiJqKfuqSYxzMAhaJXdj2ugA7Ve7T"
],
"type": 112
}

Method Response

{
  "senderPublicKey": "3X6Qb6p96dY4drVt3x4XyHKCRvree4QDqNZyDWHzjJ79",
  "policyName": "Policy for sponsored v1",
  "fee": 100000000,
  "description": "Privacy for sponsored",
  "owners": [
     "3JSaKNX94deXJkywQwTFgbigTxJa36TDVg3",
     "3JWDUsqyJEkVa1aivNPP8VCAa5zGuxiwD9t"
  ],
  "type": 112,
  "version": 2,
  "sender": "3JSaKNX94deXJkywQwTFgbigTxJa36TDVg3",
  "feeAssetId": "G16FvJk9vabwxjQswh9CQAhbZzn3QrwqWjwnZB3qNVox",
  "proofs": [
     "3vDVjp6UJeN9ahtNcQWt5WDVqC9KqdEsrr9HTToHfoXFd1HtVwnUPPtJKM8tAsCtby81XYQReLj33hLEZ8qbGA3V"
  ],
  "recipients": [
     "3JSaKNX94deXJkywQwTFgbigTxJa36TDVg3",
     "3JWDUsqyJEkVa1aivNPP8VCAa5zGuxiwD9t"
  ],
  "id": "EyymzQcM2LrsgGDFFxeGn8DhahJbFYmorcBrEh8phv5S",
  "timestamp": 1585307711344
}