Transactions

Get a Transaction

Method

1transaction.info

Body Parameters

Name Type Description Required
jsonrpc string The protocol version. Yes
id string The identifier of the request. Yes
method string The method name. Yes
params object The parameters of the request. Yes
params.id string The identifier of the transaction to be retrieved. Yes

Request

1{
2 "jsonrpc": "2.0",
3 "id": "unique-request-id",
4 "method": "transactions.info",
5 "params": {
6 "id": "49a4cc2b931e75da4676c5b06649543d3ea30f1097e944549e2ab3d67bc91e6a"
7 }
8}

Response

1{
2 "jsonrpc": "2.0",
3 "id": "unique-request-id",
4 "result": {
5 "id": "49a4cc2b931e75da4676c5b06649543d3ea30f1097e944549e2ab3d67bc91e6a",
6 "blockId": "1957735382338577043",
7 "type": 0,
8 "amount": 1000000000,
9 "fee": 10000000,
10 "sender": "ANBkoGqWeTSiaEVgVzSKZd3jS7UWzv9PSo",
11 "recipient": "ANBkoGqWeTSiaEVgVzSKZd3jS7UWzv9PSo",
12 "signature": "304502210084484fc57bd1c0af1e6bf2fc79e1d5c210b29d7651e3482cc764d2160bbd887a0220776362194a30f4c04365061344dd4b4ac2cc6f5efc479afcda07d26be9621e04",
13 "confirmations": 1,
14 "timestamp": {
15 "epoch": 50271515,
16 "unix": 1540372715,
17 "human": "2018-10-24T09:18:35Z"
18 }
19 }
20}

Error Response

1{
2 "jsonrpc": "2.0",
3 "id": "unique-request-id",
4 "error": {
5 "code": "unique-error-code",
6 "message": "descriptive-error-message",
7 "data": "detailed-error-information"
8 }
9}

Broadcast Transactions

In order to broadcast transactions via the JSON-RPC they also need to be created through it. If you are looking to just broadcast any transactions you should take a look at Transactions for the public API.

Method

1transactions.broadcast

Body Parameters

Name Type Description Required
jsonrpc string The protocol version. Yes
id string The identifier of the request. Yes
method string The method name. Yes
params object The parameters of the request. Yes
params.transactions array The list of transactions to be broadcast. Yes

Request

1{
2 "jsonrpc": "2.0",
3 "id": "unique-request-id",
4 "method": "transactions.broadcast",
5 "params": {
6 "id": "49a4cc2b931e75da4676c5b06649543d3ea30f1097e944549e2ab3d67bc91e6a"
7 }
8}

Response

1{
2 "jsonrpc": "2.0",
3 "id": "unique-request-id",
4 "result": {
5 "id": "49a4cc2b931e75da4676c5b06649543d3ea30f1097e944549e2ab3d67bc91e6a",
6 "signature": "304502210084484fc57bd1c0af1e6bf2fc79e1d5c210b29d7651e3482cc764d2160bbd887a0220776362194a30f4c04365061344dd4b4ac2cc6f5efc479afcda07d26be9621e04",
7 "timestamp": 50271515,
8 "type": 0,
9 "fee": 10000000,
10 "senderPublicKey": "03287bfebba4c7881a0509717e71b34b63f31e40021c321f89ae04f84be6d6ac37",
11 "amount": 1000000000,
12 "recipientId": "ANBkoGqWeTSiaEVgVzSKZd3jS7UWzv9PSo"
13 }
14}

Error Response

1{
2 "jsonrpc": "2.0",
3 "id": "unique-request-id",
4 "error": {
5 "code": "unique-error-code",
6 "message": "descriptive-error-message",
7 "data": "detailed-error-information"
8 }
9}

Create a Transaction

Method

1transactions.create

Body Parameters

Name Type Description Required
jsonrpc string The protocol version. Yes
id string The identifier of the request. Yes
method string The method name. Yes
params object The parameters of the request. Yes
params.recipientId string The address of the recipient. Yes
params.amount string The amount to be send. Yes
params.passphrase string The passphrase of the sender. Yes
params.vendorField string Optional field with custom content. No
params.fee string Transaction Fee. If not set the average fee is read from the network. No

Information

Parameter params.fee is optional. If the parameter is not set, transaction is created by using the current public network average fee.

Warning

Make sure to check the network for average fee values, before signing and sending a transaction. This is to handle edge case of them being higher than the current static ones.

Request

1{
2 "jsonrpc": "2.0",
3 "id": "unique-request-id",
4 "method": "transactions.create",
5 "params": {
6 "passphrase": "this is a top secret passphrase",
7 "amount": 1000000000,
8 "recipientId": "ANBkoGqWeTSiaEVgVzSKZd3jS7UWzv9PSo"
9 }
10}

Response

1{
2 "jsonrpc": "2.0",
3 "id": "unique-request-id",
4 "result": {
5 "id": "58f4f8ed866d2c6a42fc2b48d49fc5c949af6768b55d307376aaac61f930d8b6",
6 "signature": "304402201ace9afcaf9d0ec64a31fd98c589767c76b5360d5b22dfe3cde2dfffdfef61dc022026d276a6140e6abbd80775541479cc71cf52590895bd24c0c577a9c57ecae581",
7 "timestamp": 50686854,
8 "type": 0,
9 "fee": 10000000,
10 "senderPublicKey": "034151a3ec46b5670a682b0a63394f863587d1bc97483b1b6c70eb58e7f0aed192",
11 "amount": 1000000000,
12 "recipientId": "ANBkoGqWeTSiaEVgVzSKZd3jS7UWzv9PSo"
13 }
14}

Error Response

1{
2 "jsonrpc": "2.0",
3 "id": "unique-request-id",
4 "error": {
5 "code": "unique-error-code",
6 "message": "descriptive-error-message",
7 "data": "detailed-error-information"
8 }
9}

Create a Transaction from a BIP38

Method

1transactions.list

Body Parameters

Name Type Description Required
jsonrpc string The protocol version. Yes
id string The identifier of the request. Yes
method string The method name. Yes
params object The parameters of the request. Yes
params.recipientId string The address of the recipient. Yes
params.amount string The amount to be send. Yes
params.bip38 string The bip38 of the sender. Yes
params.userId string The identifier of the sender. Yes
params.vendorField string Optional field with custom content. No
params.fee string Transaction Fee. If not set the average fee is read from the network. No

Information

Parameter params.fee is optional. If the parameter is not set, transaction is created by using the current public network average fee.

Warning

Make sure to check the network for average fee values, before signing and sending a transaction. This is to handle edge case of them being higher than the current static ones.

Request

1{
2 "jsonrpc": "2.0",
3 "id": "unique-request-id",
4 "method": "transactions.bip38.create",
5 "params": {
6 "bip38": "this is a top secret passphrase",
7 "userId": "123",
8 "amount": 1000000000,
9 "recipientId": "ANBkoGqWeTSiaEVgVzSKZd3jS7UWzv9PSo"
10 }
11}

Response

1{
2 "jsonrpc": "2.0",
3 "id": "unique-request-id",
4 "result": {
5 "id": "729d8f1974bd1eb517619fe9a4c45c3e769f49bbe1b682237ef3f049038c5421",
6 "signature": "304402207a4877d3515b2dc3c2d8bc337b767cea62718e80d4b9ba02d8f2f873c82e2987022067951e8aa731fed8223b650419c29ef7e71460807920604ea23d3c2872328217",
7 "timestamp": 50686826,
8 "type": 0,
9 "fee": 10000000,
10 "senderPublicKey": "022cf1c9de60c22c0b5a138b6545777cb2edaf82fe3906faa345580352000f84b6",
11 "amount": 1000000000,
12 "recipientId": "ANBkoGqWeTSiaEVgVzSKZd3jS7UWzv9PSo"
13 }
14}

Error Response

1{
2 "jsonrpc": "2.0",
3 "id": "unique-request-id",
4 "error": {
5 "code": "unique-error-code",
6 "message": "descriptive-error-message",
7 "data": "detailed-error-information"
8 }
9}
Last updated 2 years ago
Edit Page
Share: