Skip to content

Method: transfers/submitTransfer

POST /transfers/submit
( https://services-api.dcore.io/blockchain/transfers/submit )


When a signed transaction object has been prepared, using either the transfers/create-signed method, or by being creates and signed in your own code, the transfers/submitTransfer is used to submit it to the specified blockchain1.

The transaction must contain a signature or it will be rejected (Error 400).


Query Parameters

Name Description Type
blockchain
required
Which blockchain to use.
Values: "Bitcoin", "Ethereum", "DCore".
#/components/schemas/Blockchain

Request Body

Required

Schema Type: application/json

The request body consists of a signed transaction object of the type matching the blockchain query parameter.

Schema Body:

Depending on the blockchain selected in the blockchain query, one of the following objects will be expected as the request's body:

Request Headers

1
2
3
accept: application/json
x-api-key: <your-api-key>
Content-Type: application/json

Example Request Bodies

Example request bodies for each blockchain:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
    {
        "transactionSigned": {
            "block_height": 0,
            "block_index": 0,
            "hash": "string",
            "addresses": [
                "string"
            ],
            "total": 0,
            "fees": 0,
            "size": 0,
            "preference": "string",
            "relayed_by": "string",
            "received": "string",
            "ver": 0,
            "double_spend": true,
            "vin_sz": 0,
            "vout_sz": 0,
            "confirmations": 0,
            "inputs": [
                {
                "prev_hash": "string",
                "output_index": 0,
                "output_value": 0,
                "sequence": 0,
                "addresses": [
                    "string"
                ],
                "script_type": "string",
                "age": 0
                }
            ],
            "outputs": [
                {
                "value": 0,
                "script": "string",
                "addresses": [
                    "string"
                ],
                "script_type": "string"
                }
            ],
            "tosign": [
                "string"
            ],
            "signatures": [
                "string"
            ],
            "pubkeys": [
                "string"
            ]
        }
    }
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
    {
        "transactionSigned": {
            "block_height": 0,
            "block_index": 0,
            "hash": "string",
            "addresses": [
                "string"
            ],
            "total": 0,
            "fees": 0,
            "size": 0,
            "gas_limit": 0,
            "gas_price": 0,
            "received": "string",
            "ver": 0,
            "double_spend": true,
            "vin_sz": 0,
            "vout_sz": 0,
            "inputs": [
                {
                "sequence": 0,
                "addresses": [
                    "string"
                ]
                }
            ],
            "outputs": [
                {
                "value": 0,
                "addresses": [
                    "string"
                ]
                }
            ],
            "tosign": [
                "string"
            ],
            "signatures": [
                "string"
            ]
        }
    }
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
    {
        "transactionSigned": {
            "operations": [
            {
                "extensions": [
                "string"
                ],
                "type": 0,
                "from": "string",
                "to": "string",
                "amount": {
                "amount": 0,
                "assetId": "string"
                },
                "fee": {
                "amount": 0,
                "assetId": "string"
                }
            }
            ],
            "blockData": {
            "expiration": "string",
            "refBlockNum": 0,
            "refBlockPrefix": {
                "low": 0,
                "high": 0,
                "unsigned": true
            }
            },
            "signatures": [
            "string"
            ]
        }
    }

Responses for transfers/submitTransfer

The following response codes could be returned following a call to the transfers/submitTransfer endpoint.

200

Content Type: application/json

Example response body
"string"

A single JSON string representing the transaction hash returned by the successful submission.

Error

Click the description for more detailed information on why the error was raised, and potential fixes.

Examples

Examples of using the transfers/submitTransfer endpoint method can be found here.


  1. The blockchains supported are Bitcoin (BTC) Ethereum (ETH) and DCore (DCT)