You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.2 KiB

6 years ago
# PushTX
Push a transaction to the network.
```
POST /pushtx/
```
Parameters must be passed in the body of the request as url encoded arguments.
6 years ago
## Parameters
* **tx** - `hex string` - The raw transaction hex
* **at** - `string` (optional) - Access Token (json web token). Required if authentication is activated. Alternatively, the access token can be passed through the `Authorization` HTTP header (with the `Bearer` scheme).
* **strict_mode_vouts** (optional) - `string` - A pipe-separated list of outpoints indices. A strict verification is enforced on these outpoints before the transaction is pushed. Strict mode checks that addresses associated to these outputs aren't reused. If verifications fail, push is aborted and an error is returned.
6 years ago
6 years ago
### Example
```
POST /pushtx/
tx=abcdef0123456789
strict_mode_vouts=0|2|3
6 years ago
```
#### Success
Status code 200 with JSON response:
```json
{
"status": "ok",
"data": "<txid>"
}
```
#### Failure
Status code 400 with JSON response:
```json
{
"status": "error",
"error": "<error message>"
}
```
or status code 200 with JSON response:
```json
6 years ago
{
"status": "error",
"error": {
"message": [<vout>],
"code": "VIOLATION_STRICT_MODE_VOUTS"
6 years ago
}
}
```