Skip to content

Commit

Permalink
[cbermudez97] refs fibercrypto#20 Create initial specification for en…
Browse files Browse the repository at this point in the history
…dpoint

/api/transactions/broadcast/many-inputs/{operationId}
  • Loading branch information
cbermudez97 committed Feb 26, 2019
1 parent 5428b4d commit 985afe9
Showing 1 changed file with 94 additions and 10 deletions.
104 changes: 94 additions & 10 deletions cbermudez97_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,90 @@ components:
type: string

paths:
/api/transactions/broadcast/many-inputs/{operationId}:
get:
summary: 'Return broadcasted transaction by the opreationId.'
description: Should return broadcasted transaction by the opreationId. All transactions with many inputs, that were broadcasted by the should be available here.

parameters:
- name: operationId
in: path
required: true
schema:
type: string
description: Operation Id.

responses:
'200':
description: Broadcasted transaction by the opreationId.
content:
application/json:
schema:
type: object
properties:
operationId:
type: string
description: Operation ID.

state:
type: string
enum:
- inProgress
- completed
- failed
description: State of the transaction.

timestamp:
type: string
format: date-time
description: 'Transaction moment as ISO 8601 in UTC.'

inputs:
type: array
items:
type: object
properties:
fromAddress:
type: string
description: Destination address.
amount:
type: string
description: Actual amount that is transferred from the fromAddress. Integer as string, aligned to the asset accuracy.
description: Destinations. Should be non null if the state is Completed.

toAddress:
type: string
description: Destination address.

fee:
type: string
description: Fee. Is integer as string, aligned to the asset accuracy.

hash:
type: string
description: Transaction hash as base64 string. Can be empty. Should be non empty if the state is Completed.

error:
type: string
description: Error description. Can be empty. Should be non empty if the state is Error.

errorCode:
type: string
enum:
- unknown
- amountIsTooSmall
- notEnoughBalance
description: Error code. Can be empty. Should be non empty if the state is Failed.

block:
type: integer
format: int64
description: Incremental ID of the moment, when the transaction state changing is detected. It should be the same sequence as for block in the [GET] /api/balances response. In other words block number/height.


default:
$ref: '#/components/schemas/genericError'

/api/transactions/broadcast/many-outputs/{operationId}:
get:
summary: Return broadcasted transactions by operation ID.
Expand Down Expand Up @@ -125,19 +209,19 @@ paths:
- CsrfTokenAuth: []

requestBody:
description: 'A JSON object containing: The Private Keys, which were returned by the [POST] /api/wallets. Multiple keys can be used for transactions with multiple inputs. The Transaction Context in the blockchain specific format [POST] /api/transactions or [PUT] /api/transactions.'
required: true
content:
application/json:
schema:
type: object
properties:
privateKeys:
description: 'A JSON object containing: The Private Keys, which were returned by the [POST] /api/wallets. Multiple keys can be used for transactions with multiple inputs. The Transaction Context in the blockchain specific format [POST] /api/transactions or [PUT] /api/transactions.'
required: true
content:
application/json:
schema:
type: object
properties:
privateKeys:
type: array
items:
type: string
transactionContext:
type: string
transactionContext:
type: string

responses:
'200': # status code
Expand Down

0 comments on commit 985afe9

Please sign in to comment.