Skip to content

Instantly share code, notes, and snippets.

@stdevMac
Created March 9, 2019 03:57
Show Gist options
  • Select an option

  • Save stdevMac/2df88707fbbe652424cc35e043be828b to your computer and use it in GitHub Desktop.

Select an option

Save stdevMac/2df88707fbbe652424cc35e043be828b to your computer and use it in GitHub Desktop.
basePath: /
consumes:
- application/json
- application/xml
host: 127.0.0.1:6420
info:
contact:
email: [email protected]
name: Skycoin project
url: http://127.0.0.1:6420
description: Skycoin is a next-generation cryptocurrency.
title: Skycoin REST API.
version: 0.25.1
paths:
/api/v1/address_uxouts:
get:
description: Returns the historical, spent outputs associated with an address
operationId: addressUxouts
parameters:
- description: address to filter by
in: query
name: address
required: true
type: string
produces:
- application/json
responses:
"200":
description: Response for endpoint /api/v1/address_uxouts
schema:
items:
properties:
coins:
format: integer
type: integer
hours:
format: int64
type: integer
owner_address:
type: string
spent_block_seq:
format: in64
type: integer
spent_tx:
type: string
src_block_seq:
format: int64
type: integer
src_tx:
type: string
time:
format: int64
type: integer
uxid:
type: string
type: array
default:
$ref: '#/responses/genericError'
/api/v1/addresscount:
get:
operationId: addressCount
produces:
- application/json
responses:
"200":
description: This endpoint Returns the total number of unique address that
have coins.
schema:
properties:
count:
format: int64
type: integer
default:
$ref: '#/responses/genericError'
summary: Returns the total number of unique address that have coins.
/api/v1/balance:
get:
operationId: balanceGet
parameters:
- description: command separated list of addresses
in: query
name: addrs
required: true
type: string
produces:
- application/json
responses:
"200":
description: Returns the balance of one or more addresses
schema:
properties:
addresses:
additionalProperties:
properties:
coins:
format: int64
type: integer
hours:
format: int64
type: integer
type: object
type: object
confirmed:
properties:
coins:
format: int64
type: integer
hours:
format: int64
type: integer
type: object
predicted:
properties:
coins:
format: int64
type: integer
hours:
format: int64
type: integer
type: object
default:
$ref: '#/responses/genericError'
summary: Returns the balance of one or more addresses, both confirmed and predicted.
The predicted balance is the confirmed balance minus the pending spends.
post:
operationId: balancePost
parameters:
- description: command separated list of addresses
in: query
name: addrs
required: true
type: string
produces:
- application/json
responses:
"200":
description: Returns the balance of one or more addresses
schema:
properties:
addresses:
additionalProperties:
properties:
coins:
format: int64
type: integer
hours:
format: int64
type: integer
type: object
type: object
confirmed:
properties:
coins:
format: int64
type: integer
hours:
format: int64
type: integer
type: object
predicted:
properties:
coins:
format: int64
type: integer
hours:
format: int64
type: integer
type: object
default:
$ref: '#/responses/genericError'
security:
- csrfAuth: []
summary: Returns the balance of one or more addresses, both confirmed and predicted.
The predicted balance is the confirmed balance minus the pending spends.
/api/v1/block:
get:
description: 'Returns a block by hash or seq. Note: only one of hash or seq
is allowed'
operationId: block
parameters:
- in: query
name: hash
type: string
- in: query
name: seq
type: integer
produces:
- application/json
responses:
"200":
description: BlockVerbose represents a readable block with verbose data.
schema:
properties:
body:
properties:
txns:
items:
properties:
inner_hash:
type: string
inputs:
items:
type: string
type: array
length:
format: int32
type: integer
outputs:
items:
properties:
coins:
type: string
dst:
type: string
hours:
format: int64
type: integer
uxid:
type: string
type: array
sigs:
items:
type: string
type: array
timestamp:
format: int64
type: integer
txid:
type: string
type:
format: int32
type: integer
type: array
type: object
header:
properties:
block_hash:
type: string
fee:
format: int32
type: integer
previous_block_hash:
type: string
seq:
format: int32
type: integer
timestamp:
format: int64
type: integer
tx_body_hash:
type: string
ux_hash:
type: string
version:
format: int32
type: integer
type: object
size:
format: int32
type: integer
default:
$ref: '#/responses/genericError'
/api/v1/blockchain/metadata:
get:
operationId: blockchainMetadata
produces:
- application/json
responses:
"200":
description: This endpoint returns the blockchain metadata.
schema:
properties:
head:
properties:
block_hash:
type: string
fee:
format: int64
type: integer
previous_block_hash:
type: string
seq:
type: string
timestamp:
format: int64
type: integer
tx_body_hash:
type: string
ux_hash:
type: string
version:
format: int64
type: integer
type: object
unconfirmed:
format: int64
type: integer
unspents:
format: int64
type: integer
default:
$ref: '#/responses/genericError'
summary: Returns the blockchain metadata.
/api/v1/blockchain/progress:
get:
operationId: blockchainProgress
produces:
- application/json
responses:
"200":
description: This endpoint returns the blockchain sync progress
schema:
properties:
current:
format: int64
type: integer
highest:
format: int64
type: integer
peers:
items:
properties:
address:
type: string
height:
format: int64
type: integer
type: array
default:
$ref: '#/responses/genericError'
summary: Returns the blockchain sync progress.
/api/v1/blocks:
get:
description: |-
or an explicit list of sequences.
If using start and end, the block sequences include both the start and end point.
Explicit sequences cannot be combined with start and end.
Without verbose.
operationId: blocksGet
parameters:
- in: query
name: start
type: integer
- in: query
name: end
type: integer
- in: query
items:
type: integer
name: seqs
type: array
produces:
- application/json
responses:
"200":
description: Returns blocks between a start and end point.
schema:
properties:
blocks:
items:
properties:
body:
properties:
txns:
items:
properties:
inner_hash:
type: string
inputs:
items:
type: string
type: array
length:
format: int32
type: integer
outputs:
items:
properties:
coins:
type: string
dst:
type: string
hours:
format: int64
type: integer
uxid:
type: string
type: array
sigs:
items:
type: string
type: array
timestamp:
format: int32
type: integer
txid:
type: string
type:
format: int32
type: integer
type: array
type: object
header:
properties:
block_hash:
type: string
fee:
format: int64
type: integer
previous_block_hash:
type: string
seq:
format: int64
type: integer
timestamp:
format: int64
type: integer
tx_body_hash:
type: string
ux_hash:
type: string
version:
format: int32
type: integer
type: object
size:
format: int32
type: integer
type: array
default:
$ref: '#/responses/genericError'
summary: blocksHandler returns blocks between a start and end point,
post:
description: |-
or an explicit list of sequences.
If using start and end, the block sequences include both the start and end point.
Explicit sequences cannot be combined with start and end.
Without verbose
operationId: blocksPost
parameters:
- in: query
name: start
type: integer
- in: query
name: end
type: integer
- in: query
items:
type: integer
name: seqs
type: array
produces:
- application/json
responses:
"200":
description: Returns blocks between a start and end point.
schema:
properties:
blocks:
items:
properties:
body:
properties:
txns:
items:
properties:
inner_hash:
type: string
inputs:
items:
type: string
type: array
length:
format: int32
type: integer
outputs:
items:
properties:
coins:
type: string
dst:
type: string
hours:
format: int64
type: integer
uxid:
type: string
type: array
sigs:
items:
type: string
type: array
timestamp:
format: int32
type: integer
txid:
type: string
type:
format: int32
type: integer
type: array
type: object
header:
properties:
block_hash:
type: string
fee:
format: int64
type: integer
previous_block_hash:
type: string
seq:
format: int64
type: integer
timestamp:
format: int64
type: integer
tx_body_hash:
type: string
ux_hash:
type: string
version:
format: int32
type: integer
type: object
size:
format: int32
type: integer
type: array
default:
$ref: '#/responses/genericError'
security:
- csrfAuth: []
summary: blocksHandler returns blocks between a start and end point,
/api/v1/coinSupply:
get:
description: coinSupplyHandler returns coin distribution supply stats
operationId: coinSupply
produces:
- application/json
responses:
"200":
$ref: '#/responses/coinSupply'
default:
$ref: '#/responses/genericError'
schemes:
- http
- https
/api/v1/csrf:
get:
operationId: csrf
produces:
- application/json
responses:
"200":
description: Return a csrf Token.
schema:
properties:
csrf_token:
type: string
type: object
default:
$ref: '#/responses/genericError'
summary: Creates a new CSRF token. Previous CSRF tokens are invalidated by this
call.
/api/v1/explorer/address:
get:
description: Returns all transactions (confirmed and unconfirmed) for an address
operationId: explorerAddress
parameters:
- description: tags to filter by
in: query
name: address
type: string
produces:
- application/json
responses:
"200":
description: Response for endpoint /api/v1/explorer/address
schema:
items:
properties:
fee:
format: in64
type: integer
inner_hash:
type: string
inputs:
items:
properties:
calculated_hours:
format: int64
type: integer
coins:
type: string
hours:
format: int64
type: integer
owner:
type: string
uxid:
type: string
type: array
length:
format: int64
type: integer
outputs:
items:
properties:
coins:
type: string
dst:
type: string
hours:
format: int64
type: integer
uxid:
type: string
type: array
sigs:
items:
type: string
type: array
status:
properties:
block_seq:
format: int64
type: integer
confirmed:
type: boolean
label:
format: int64
type: integer
unconfirmed:
type: boolean
type: object
timestamp:
format: integer
type: integer
txid:
type: string
type:
format: in64
type: integer
type: array
default:
$ref: '#/responses/genericError'
/api/v1/health:
get:
operationId: health
produces:
- application/json
responses:
"200":
description: This endpoint returns node health data.
schema:
properties:
blockchain:
properties:
head:
properties:
block_hash:
type: string
fee:
format: int64
type: integer
previous_block_hash:
type: string
seq:
format: int64
type: integer
timestamp:
format: int64
type: integer
tx_body_hash:
type: string
ux_hash:
type: string
version:
format: int64
type: integer
type: object
time_since_last_block:
type: string
unconfirmed:
format: int64
type: integer
unspents:
format: int64
type: integer
type: object
coin:
type: string
csp_enabled:
type: boolean
csrf_enabled:
type: boolean
gui_enabled:
type: boolean
incoming_connections:
format: int64
type: integer
json_rpc_enabled:
type: boolean
open_connections:
format: int64
type: integer
outgoing_connections:
format: int64
type: integer
started_at:
format: int64
type: integer
unconfirmed_verify_transaction:
properties:
burn_factor:
format: int64
type: integer
max_decimal:
format: int64
type: integer
max_transaction_size:
format: int64
type: integer
type: object
unversioned_api_enabled:
type: boolean
uptime:
type: string
user_agent:
type: string
user_verify_transaction:
properties:
burn_factor:
format: int64
type: integer
max_decimal:
format: int64
type: integer
max_transaction_size:
format: int64
type: integer
type: object
version:
properties:
branch:
type: string
commit:
type: string
version:
type: string
type: object
wallet_api_enabled:
type: boolean
default:
$ref: '#/responses/genericError'
summary: Returns node health data.
/api/v1/last_blocks:
get:
description: Returns the most recent N blocks on the blockchain
operationId: lastBlocks
parameters:
- in: query
name: num
required: true
type: integer
produces:
- application/json
responses:
"200":
description: Returns the most recent N blocks on the blockchain.
schema:
properties:
blocks:
items:
properties:
body:
items:
properties:
inner_hash:
type: string
inputs:
items:
type: string
type: array
length:
format: int32
type: integer
outputs:
items:
properties:
coins:
type: string
dst:
type: string
hours:
format: int64
type: integer
uxid:
type: string
type: array
sigs:
items:
type: string
type: array
timestamp:
format: int32
type: integer
txid:
type: string
type:
format: int32
type: integer
type: array
header:
properties:
block_hash:
type: string
fee:
format: int64
type: integer
previous_block_hash:
type: string
seq:
format: int64
type: integer
timestamp:
format: int64
type: integer
tx_body_hash:
type: string
ux_hash:
type: string
version:
format: int32
type: integer
type: object
size:
format: int32
type: integer
type: array
default:
$ref: '#/responses/genericError'
/api/v1/network/connection:
get:
operationId: networkConnection
parameters:
- description: Address port
in: query
name: addr
required: true
type: string
produces:
- application/json
responses:
"200":
description: This endpoint return a connection struct
schema:
properties:
address:
type: string
connected_at:
format: int64
type: integer
height:
format: int64
type: integer
id:
format: int64
type: integer
is_trusted_peer:
type: boolean
last_received:
format: int64
type: integer
last_sent:
format: int64
type: integer
listen_port:
format: int32
type: integer
mirror:
format: int32
type: integer
outgoing:
type: boolean
state:
enum:
- pending
- connected
- introduced
type: string
unconfirmed_verify_transaction:
description: Represent unconfirmed transactions
properties:
burn_factor:
format: int32
type: integer
max_decimals:
format: int32
type: integer
max_transaction_size:
format: int32
type: integer
type: object
user_agent:
type: string
type: object
default:
$ref: '#/responses/genericError'
summary: This endpoint returns a specific connection.
/api/v1/network/connection/disconnect:
post:
description: This endpoint disconnects a connection by ID or address
operationId: networkConnectionsDisconnect
parameters:
- description: Address id.
in: query
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: This endpoint
default:
$ref: '#/responses/genericError'
security:
- csrfAuth: []
/api/v1/network/connections:
get:
operationId: networkConnections
parameters:
- description: Connection status.
enum:
- pending
- connected
- introduced
in: query
name: states
type: string
- description: Direction of the connection.
enum:
- connected
- introduced
in: query
name: direction
type: string
produces:
- application/json
responses:
"200":
description: This endpoint return a connection struct
schema:
items:
properties:
address:
type: string
connected_at:
format: int64
type: integer
height:
format: int64
type: integer
id:
format: int64
type: integer
is_trusted_peer:
type: boolean
last_received:
format: int64
type: integer
last_sent:
format: int64
type: integer
listen_port:
format: int32
type: integer
mirror:
format: int32
type: integer
outgoing:
type: boolean
state:
enum:
- pending
- connected
- introduced
type: string
unconfirmed_verify_transaction:
description: Represent unconfirmed transactions
properties:
burn_factor:
format: int32
type: integer
max_decimals:
format: int32
type: integer
max_transaction_size:
format: int32
type: integer
type: object
user_agent:
type: string
type: array
default:
$ref: '#/responses/genericError'
security:
- csrfAuth: []
summary: This endpoint returns all outgoings connections.
/api/v1/network/connections/exchange:
get:
description: This endpoint returns all connections found through peer exchange
operationId: networkConnectionsExchange
produces:
- application/json
responses:
"200":
description: This endpoint return a list of all connections found through
peer exchange.
schema:
items:
type: string
type: array
default:
$ref: '#/responses/genericError'
/api/v1/network/connections/trust:
get:
operationId: networkConnectionsTrust
produces:
- application/json
responses:
"200":
description: This endpoint return a list of trusted connections.
schema:
items:
type: string
type: array
default:
$ref: '#/responses/genericError'
security:
- csrfAuth: []
summary: trustConnectionsHandler returns all trusted connections.\n They are
not necessarily connected to. In the default configuration, these will be
a subset of the default hardcoded bootstrap addresses.
/api/v1/network/defaultConnections:
get:
operationId: defaultConnections
produces:
- application/json
responses:
"200":
description: This endpoint return an list of default connections.
schema:
items:
type: string
type: array
default:
$ref: '#/responses/genericError'
summary: defaultConnectionsHandler returns the list of default hardcoded bootstrap
addresses.\n They are not necessarily connected to.
/api/v1/outputs:
get:
operationId: outputsGet
parameters:
- in: query
items:
type: string
name: address
type: array
- in: query
items:
type: string
name: hash
type: array
produces:
- application/json
responses:
"200":
description: UnspentOutputsSummary records unspent outputs in different
status.
schema:
properties:
head:
properties:
fee:
format: int64
type: integer
hash:
type: string
previous_block_hash:
type: string
seq:
format: int64
type: integer
timestamp:
format: int64
type: integer
tx_body_hash:
type: string
ux_hash:
type: string
version:
format: int64
type: integer
type: object
head_outputs:
description: HeadOutputs are unspent outputs confirmed in the blockchain
items:
properties:
address:
type: string
block_seq:
format: int64
type: integer
calculated_hours:
format: int64
type: integer
coins:
type: string
hash:
type: string
hours:
format: int64
type: integer
src_tx:
type: string
time:
format: int64
type: integer
type: array
incoming_outputs:
description: IncomingOutputs are unspent outputs being created by
unconfirmed transactions
items:
properties:
address:
type: string
block_seq:
format: int64
type: integer
calculated_hours:
format: int64
type: integer
coins:
type: string
hash:
type: string
hours:
format: int64
type: integer
src_tx:
type: string
time:
format: int64
type: integer
type: array
outgoing_outputs:
description: OutgoingOutputs are unspent outputs being spent in unconfirmed
transactions
items:
properties:
address:
type: string
block_seq:
format: int64
type: integer
calculated_hours:
format: int64
type: integer
coins:
type: string
hash:
type: string
hours:
format: int64
type: integer
src_tx:
type: string
time:
format: int64
type: integer
type: array
default:
$ref: '#/responses/genericError'
summary: If neither addrs nor hashes are specificed, return all unspent outputs.
If only one filter is specified, then return outputs match the filter. Both
filters cannot be specified.
post:
operationId: outputsPost
parameters:
- in: query
name: address
type: string
- in: query
name: hash
type: string
produces:
- application/json
responses:
"200":
description: UnspentOutputsSummary records unspent outputs in different
status.
schema:
properties:
head:
properties:
fee:
format: int64
type: integer
hash:
type: string
previous_block_hash:
type: string
seq:
format: int64
type: integer
timestamp:
format: int64
type: integer
tx_body_hash:
type: string
ux_hash:
type: string
version:
format: int64
type: integer
type: object
head_outputs:
description: HeadOutputs are unspent outputs confirmed in the blockchain
items:
properties:
address:
type: string
block_seq:
format: int64
type: integer
calculated_hours:
format: int64
type: integer
coins:
type: string
hash:
type: string
hours:
format: int64
type: integer
src_tx:
type: string
time:
format: int64
type: integer
type: array
incoming_outputs:
description: IncomingOutputs are unspent outputs being created by
unconfirmed transactions
items:
properties:
address:
type: string
block_seq:
format: int64
type: integer
calculated_hours:
format: int64
type: integer
coins:
type: string
hash:
type: string
hours:
format: int64
type: integer
src_tx:
type: string
time:
format: int64
type: integer
type: array
outgoing_outputs:
description: OutgoingOutputs are unspent outputs being spent in unconfirmed
transactions
items:
properties:
address:
type: string
block_seq:
format: int64
type: integer
calculated_hours:
format: int64
type: integer
coins:
type: string
hash:
type: string
hours:
format: int64
type: integer
src_tx:
type: string
time:
format: int64
type: integer
type: array
default:
$ref: '#/responses/genericError'
security:
- csrfAuth: []
summary: If neither addrs nor hashes are specificed, return all unspent outputs.
If only one filter is specified, then return outputs match the filter. Both
filters cannot be specified.
/api/v1/pendingTxs:
get:
description: Returns pending (unconfirmed) transactions without verbose
operationId: pendingTxs
produces:
- application/json
responses:
"200":
description: Returns a transaction identified by its txid hash.
schema:
items:
properties:
announced:
type: string
checked:
type: string
is_valid:
type: boolean
received:
type: string
transaction:
description: BlockTransactionVerbose has readable transaction data
for transactions inside a block. It differs from Transaction in
that it includes metadata for transaction inputs and the calculated
coinhour fee spent by the block
properties:
inner_hash:
type: string
inputs:
items:
type: string
type: array
length:
format: int32
type: integer
outputs:
items:
properties:
coins:
type: string
dst:
type: string
hours:
format: int64
type: integer
uxid:
type: string
type: array
sigs:
items:
type: string
type: array
timestamp:
format: int32
type: integer
txid:
type: string
type:
format: int32
type: integer
type: object
type: array
default:
$ref: '#/responses/genericError'
/api/v1/resendUnconfirmedTxns:
post:
consumes:
- application/json
description: Broadcasts all unconfirmed transactions from the unconfirmed transaction
pool
operationId: resendUnconfirmedTxns
produces:
- application/json
responses:
"200":
description: OK, Broadcasts all unconfirmed transactions from the unconfirmed
transaction pool
default:
$ref: '#/responses/genericError'
security:
- csrfAuth: []
/api/v1/richlist:
get:
operationId: richlist
parameters:
- description: include distribution addresses or not, default value false
in: query
name: include-distribution
type: boolean
- description: include distribution addresses or not, default value false
in: query
name: "n"
type: string
produces:
- application/json
responses:
"200":
description: Response for endpoint /api/v1/address_uxouts
schema:
properties:
richlist:
items:
properties:
address:
type: string
coins:
type: string
locked:
type: boolean
type: array
default:
$ref: '#/responses/genericError'
summary: Returns the top skycoin holders.
/api/v1/transaction:
get:
description: Returns a transaction identified by its txid hash with just id
operationId: transaction
parameters:
- description: transaction hash
in: query
name: txid
required: true
type: string
- description: return as a raw encoded transaction.
in: query
name: encoded
type: boolean
produces:
- application/json
responses:
"200":
description: Returns a transaction identified by its txid hash.
schema:
properties:
status:
properties:
block_seq:
description: If confirmed, the sequence of the block in which
the transaction was executed
format: int64
type: integer
confirmed:
type: boolean
height:
description: If confirmed, how many blocks deep in the chain it
is. Will be at least 1 if confirmed
format: int64
type: integer
unconfirmed:
type: boolean
type: object
time:
format: int64
type: integer
txn:
description: TransactionVerbose has readable transaction data. It
adds TransactionStatus to a BlockTransactionVerbose
properties:
inner_hash:
type: string
inputs:
items:
type: string
type: array
length:
format: int32
type: integer
outputs:
items:
properties:
coins:
type: string
dst:
type: string
hours:
format: int64
type: integer
uxid:
type: string
type: array
sigs:
items:
type: string
type: array
timestamp:
format: int64
type: integer
txid:
type: string
type:
format: int32
type: integer
type: object
default:
$ref: '#/responses/genericError'
/api/v1/transactions:
get:
operationId: transactionsGet
parameters:
- description: command separated list of addresses
in: query
name: addrs
type: string
- description: Whether the transactions should be confirmed [optional, must
be 0 or 1; if not provided, returns all]
in: query
name: confirmed
type: string
produces:
- application/json
responses:
"200":
description: Returns transactions that match the filters.
schema:
properties:
txns:
items:
properties:
status:
properties:
block_seq:
description: If confirmed, the sequence of the block in
which the transaction was executed
format: int64
type: integer
confirmed:
type: boolean
height:
description: If confirmed, how many blocks deep in the chain
it is. Will be at least 1 if confirmed
format: int64
type: integer
unconfirmed:
type: boolean
type: object
time:
format: int64
type: integer
txn:
description: TransactionVerbose has readable transaction data.
It adds TransactionStatus to a BlockTransactionVerbose
properties:
inner_hash:
type: string
inputs:
items:
type: string
type: array
length:
format: int32
type: integer
outputs:
items:
properties:
coins:
type: string
dst:
type: string
hours:
format: int64
type: integer
uxid:
type: string
type: array
sigs:
items:
type: string
type: array
timestamp:
format: int64
type: integer
txid:
type: string
type:
format: int32
type: integer
type: object
type: array
default:
$ref: '#/responses/genericError'
summary: Returns transactions that match the filters.
post:
operationId: transactionsPost
parameters:
- description: command separated list of addresses
in: query
name: addrs
type: string
- description: Whether the transactions should be confirmed [optional, must
be 0 or 1; if not provided, returns all]
in: query
name: confirmed
type: string
produces:
- application/json
responses:
"200":
description: Returns transactions that match the filters.
schema:
properties:
txns:
items:
properties:
status:
properties:
block_seq:
description: If confirmed, the sequence of the block in
which the transaction was executed
format: int64
type: integer
confirmed:
type: boolean
height:
description: If confirmed, how many blocks deep in the chain
it is. Will be at least 1 if confirmed
format: int64
type: integer
unconfirmed:
type: boolean
type: object
time:
format: int64
type: integer
txn:
description: TransactionVerbose has readable transaction data.
It adds TransactionStatus to a BlockTransactionVerbose
properties:
inner_hash:
type: string
inputs:
items:
type: string
type: array
length:
format: int32
type: integer
outputs:
items:
properties:
coins:
type: string
dst:
type: string
hours:
format: int64
type: integer
uxid:
type: string
type: array
sigs:
items:
type: string
type: array
timestamp:
format: int64
type: integer
txid:
type: string
type:
format: int32
type: integer
type: object
type: array
default:
$ref: '#/responses/genericError'
security:
- csrfAuth: []
summary: Returns transactions that match the filters.
/api/v1/uxout:
get:
operationId: uxout
parameters:
- description: uxid to filter by
in: query
name: uxid
type: string
produces:
- application/json
responses:
"200":
description: Response for endpoint /api/v1/uxout
schema:
properties:
coins:
format: integer
type: integer
hours:
format: int64
type: integer
owner_address:
type: string
spent_block_seq:
format: in64
type: integer
spent_tx:
type: string
src_block_seq:
format: int64
type: integer
src_tx:
type: string
time:
format: int64
type: integer
uxid:
type: string
default:
$ref: '#/responses/genericError'
summary: Returns an unspent output by ID.
/api/v1/version:
get:
description: versionHandler returns the application version info
operationId: version
produces:
- application/json
responses:
"200":
$ref: '#/responses/buildInfo'
default:
$ref: '#/responses/genericError'
schemes:
- http
- https
/api/v1/wallet:
get:
operationId: wallet
parameters:
- description: tags to filter by
in: query
name: id
required: true
type: string
x-go-name: Id
produces:
- application/json
responses:
"200":
description: Response for endpoint /api/v1/wallet
schema:
properties:
entries:
items:
properties:
address:
type: string
public_key:
type: string
type: array
meta:
properties:
coin:
type: string
crypto_type:
type: string
encrypted:
type: boolean
filename:
type: string
label:
type: string
timestamp:
format: int64
type: integer
type:
type: string
version:
type: string
type: object
default:
$ref: '#/responses/genericError'
summary: Returns a wallet by id.
/api/v1/wallet/balance:
get:
operationId: walletBalance
parameters:
- description: tags to filter by
in: query
name: id
required: true
type: string
x-go-name: Id
produces:
- application/json
responses:
"200":
description: Returns the wallets balance
schema:
properties:
addresses:
additionalProperties:
properties:
coins:
format: int64
type: integer
hours:
format: int64
type: integer
type: object
type: object
confirmed:
properties:
coins:
format: int64
type: integer
hours:
format: int64
type: integer
type: object
predicted:
properties:
coins:
format: int64
type: integer
hours:
format: int64
type: integer
type: object
default:
$ref: '#/responses/genericError'
summary: Returns the wallet's balance, both confirmed and predicted. The predicted
balance is the confirmed balance minus the pending spends.
/api/v1/wallet/create:
post:
description: |-
Loads wallet from seed, will scan ahead N address and
load addresses till the last one that have coins.
operationId: walletCreate
parameters:
- description: Wallet seed.
in: header
name: seed
required: true
type: string
- description: Wallet label.
in: header
name: label
required: true
type: string
- description: The number of addresses to scan ahead for balances.
in: header
minimum: 1
name: scan
type: integer
- description: Encrypt wallet.
in: header
name: encrypt
type: boolean
- description: Wallet Password
in: header
name: password
type: string
produces:
- application/json
responses:
"200":
description: This endpoint loads wallets from seed
schema:
properties:
entries:
items:
properties:
address:
type: string
public_key:
type: string
type: array
meta:
properties:
coin:
type: string
crypto_type:
type: string
encrypted:
type: boolean
filename:
type: string
label:
type: string
timestamp:
format: int64
type: integer
type:
type: string
version:
type: string
type: object
default:
$ref: '#/responses/genericError'
security:
- csrfAuth: []
/api/v1/wallet/decrypt:
post:
operationId: walletDecrypt
parameters:
- description: Wallet id.
in: header
name: id
required: true
type: string
- description: Wallet password.
in: header
name: password
required: true
type: string
produces:
- application/json
responses:
"200":
description: This endpoint decrypts wallets.
schema:
properties:
entries:
items:
properties:
address:
type: string
public_key:
type: string
type: array
meta:
properties:
coin:
type: string
crypto_type:
type: string
encrypted:
type: boolean
filename:
type: string
label:
type: string
timestamp:
format: int64
type: integer
type:
type: string
version:
type: string
type: object
default:
$ref: '#/responses/genericError'
security:
- csrfAuth: []
summary: Decrypts wallet.
/api/v1/wallet/encrypt:
post:
operationId: walletEncrypt
parameters:
- description: Wallet id.
in: header
name: id
required: true
type: string
- description: Wallet password.
in: header
name: password
required: true
type: string
produces:
- application/json
responses:
"200":
description: This endpoint encrypt wallets.
schema:
properties:
entries:
items:
properties:
address:
type: string
public_key:
type: string
type: array
meta:
properties:
coin:
type: string
crypto_type:
type: string
encrypted:
type: boolean
filename:
type: string
label:
type: string
timestamp:
format: int64
type: integer
type:
type: string
version:
type: string
type: object
default:
$ref: '#/responses/genericError'
security:
- csrfAuth: []
summary: Encrypt wallet.
/api/v1/wallet/newAddress:
post:
description: Generates new addresses
operationId: walletNewAddress
parameters:
- description: Wallet Id
in: query
name: id
required: true
type: string
- description: The number you want to generate
in: query
name: num
type: string
- description: Wallet Password
in: query
name: password
type: string
produces:
- application/json
responses:
"200":
description: This endpoint generate new addresses
schema:
properties:
addresses:
items:
type: string
type: array
default:
$ref: '#/responses/genericError'
security:
- csrfAuth: []
/api/v1/wallet/newSeed:
get:
description: Returns the wallet directory path
operationId: walletNewSeed
parameters:
- description: Entropy bitSize.
enum:
- 128
- 256
in: query
name: entropy
type: string
produces:
- application/json
responses:
"200":
description: Generates wallet seed
schema:
properties:
seed:
type: string
default:
$ref: '#/responses/genericError'
/api/v1/wallet/seed:
post:
operationId: walletSeed
parameters:
- description: Wallet Id.
in: query
name: id
required: true
type: string
- description: Wallet password.
in: query
name: password
required: true
type: string
produces:
- application/json
responses:
"200":
description: This endpoint Returns seed of wallet of given id
schema:
properties:
seed:
type: string
default:
$ref: '#/responses/genericError'
security:
- csrfAuth: []
summary: This endpoint only works for encrypted wallets. If the wallet is unencrypted,
The seed will be not returned.
/api/v1/wallet/spend:
post:
description: |-
Creates and broadcasts a transaction sending money from one of our wallets
to destination address.
operationId: walletSpent
parameters:
- description: Wallet id
in: header
name: id
required: true
type: string
- description: Recipient address
in: header
name: dst
required: true
type: string
- description: Number of coins to spend, in droplets. 1 coin equals 1e6 droplets.
in: header
name: coins
required: true
type: string
- description: Wallet password.
in: header
name: password
required: true
type: string
produces:
- application/json
responses:
"200":
description: Creates and broadcasts a transaction sending money from one
of our wallets to destination address.
schema:
properties:
balance:
properties:
confirmed:
properties:
coins:
format: int64
type: integer
hours:
format: int64
type: integer
type: object
predicted:
properties:
coins:
format: int64
type: integer
hours:
format: int64
type: integer
type: object
type: object
error:
type: string
txn:
properties:
hash:
type: string
inner_hash:
type: string
inputs:
items:
type: string
type: array
length:
format: int32
type: integer
outputs:
items:
properties:
coins:
type: string
dst:
type: string
hours:
format: int64
type: integer
uxid:
type: string
type: array
sigs:
items:
type: string
type: array
timestamp:
format: int64
type: integer
type:
format: int32
type: integer
type: object
default:
$ref: '#/responses/genericError'
security:
- csrfAuth: []
/api/v1/wallet/transaction:
post:
description: Creates a signed transaction
operationId: walletTransaction
parameters:
- in: body
name: body
required: true
schema:
properties:
change_address:
type: string
hours_selection:
properties:
mode:
type: string
share_factor:
type: string
type:
type: string
type: object
ignore_unconfirmed:
type: boolean
to:
items:
properties:
address:
type: string
coins:
format: int64
type: integer
hours:
format: int64
type: integer
type: array
wallet:
properties:
addresses:
items:
type: string
type: array
id:
type: string
password:
type: string
unspents:
items:
type: string
type: array
type: object
produces:
- application/json
responses:
"200":
description: Returns blocks between a start and end point.
schema:
properties:
encoded_transaction:
type: string
transaction:
properties:
fee:
type: string
inner_hash:
type: string
inputs:
items:
properties:
address:
type: string
block:
format: int64
type: integer
calculated_hours:
type: string
coins:
type: string
hours:
type: string
timestamp:
format: int64
type: integer
txid:
type: string
uxid:
type: string
type: array
length:
format: int64
type: integer
outputs:
items:
properties:
address:
type: string
coins:
type: string
hours:
type: string
uxid:
type: string
type: array
sigs:
items:
type: string
type: array
txid:
type: string
type:
format: int32
type: integer
type: object
default:
$ref: '#/responses/genericError'
security:
- csrfAuth: []
/api/v1/wallet/transactions:
get:
description: Returns returns all unconfirmed transactions for all addresses
in a given wallet verbose
operationId: walletTransactions
parameters:
- description: Wallet id.
in: query
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: Returns returns all unconfirmed transactions for all addresses
in a given wallet
schema:
properties:
transactions:
items:
properties:
announced:
type: string
checked:
type: string
is_valid:
type: boolean
received:
type: string
transaction:
properties:
fee:
format: int64
type: integer
inner_hash:
type: string
inputs:
properties:
calculated_hours:
format: int64
type: integer
coins:
type: string
dst:
type: string
hours:
format: int64
type: integer
uxid:
type: string
type: object
length:
format: int32
type: integer
outputs:
properties:
coins:
type: string
dst:
type: string
hours:
format: int64
type: integer
uxid:
type: string
type: object
sigs:
items:
type: string
type: array
txid:
type: string
type:
format: int32
type: integer
type: object
type: array
default:
$ref: '#/responses/genericError'
/api/v1/wallet/unload:
post:
operationId: walletUnload
parameters:
- description: Wallet Id.
in: query
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: This endpoint returns nothing.
default:
$ref: '#/responses/genericError'
security:
- csrfAuth: []
summary: Unloads wallet from the wallet service.
/api/v1/wallet/update:
post:
operationId: walletUpdate
parameters:
- description: Wallet Id.
in: header
name: id
required: true
type: string
- description: The label the wallet will be updated to.
in: header
name: label
required: true
type: string
produces:
- application/json
responses:
"200":
description: This endpoint Returns the label the wallet will be updated
to .
default:
$ref: '#/responses/genericError'
security:
- csrfAuth: []
summary: Update the wallet.
/api/v1/wallets:
get:
description: Returns all loaded wallets
operationId: wallets
produces:
- application/json
responses:
"200":
description: This endpoint return all loaded wallets
schema:
items:
properties:
entries:
items:
properties:
address:
type: string
public_key:
type: string
type: array
meta:
properties:
coin:
type: string
crypto_type:
type: string
encrypted:
type: boolean
filename:
type: string
label:
type: string
timestamp:
type: integer
type:
type: string
version:
type: string
type: object
type: array
default:
$ref: '#/responses/genericError'
/api/v1/wallets/folderName:
get:
description: Returns the wallet directory path
operationId: walletFolder
parameters:
- description: Address port
in: query
name: addr
required: true
type: string
produces:
- application/json
responses:
"200":
description: This endpoint return the wallet directory path
schema:
properties:
address:
type: string
type: object
default:
$ref: '#/responses/genericError'
/api/v2/address/verify:
post:
operationId: verifyAddress
parameters:
- description: Address id.
in: query
name: address
required: true
type: string
produces:
- application/json
responses:
"200":
description: Response verifies a Skycoin address
schema:
properties:
data:
properties:
version:
format: int64
type: integer
type: object
error:
type: object
type: object
default:
$ref: '#/responses/genericError'
security:
- csrfAuth: []
summary: Verifies a Skycoin address.
/api/v2/transaction/inject:
post:
operationId: transactionInject
parameters:
- description: hex-encoded serialized transaction string.
in: header
name: rawtx
required: true
type: string
produces:
- application/json
responses:
"200":
description: Ok, returns the transaction.
schema:
properties:
data:
properties:
transaction:
description: Represents a readable transaction
properties:
hash:
type: string
inner_hash:
type: string
inputs:
items:
type: string
type: array
length:
format: int32
type: integer
outputs:
items:
properties:
coins:
type: string
dst:
type: string
hours:
format: int64
type: integer
uxid:
type: string
type: array
sigs:
items:
type: string
type: array
timestamp:
format: int64
type: integer
type:
format: int32
type: integer
type: object
type: object
error:
properties:
code:
format: int64
type: integer
message:
type: string
type: object
default:
$ref: '#/responses/genericError'
security:
- csrfAuth: []
summary: Broadcast a hex-encoded, serialized transaction to the network.
/api/v2/transaction/raw:
get:
operationId: transactionRaw
parameters:
- description: Transaction id hash
in: query
name: txid
type: string
produces:
- application/json
responses:
"200":
description: Returns the hex-encoded byte serialization of a transaction
schema:
properties:
rawtx:
type: string
default:
$ref: '#/responses/genericError'
summary: Returns the hex-encoded byte serialization of a transaction. The transaction
may be confirmed or unconfirmed.
/api/v2/transaction/verify:
post:
description: Decode and verify an encoded transaction
operationId: transactionVerify
produces:
- application/json
responses:
"200":
description: Responses ok
schema:
properties:
data:
properties:
confirmed:
type: boolean
transaction:
properties:
fee:
type: string
inner_hash:
type: string
inputs:
items:
properties:
address:
type: string
block:
format: int64
type: integer
calculated_hours:
type: string
coins:
type: string
hours:
type: string
timestamp:
format: int64
type: integer
txid:
type: string
uxid:
type: string
type: array
length:
format: int32
type: integer
outputs:
items:
properties:
address:
type: string
coins:
type: string
hours:
type: string
uxid:
type: string
type: array
sigs:
items:
type: string
type: array
txid:
type: string
type:
format: int32
type: integer
type: object
type: object
error:
properties:
code:
format: int64
type: integer
message:
type: string
type: object
default:
$ref: '#/responses/genericError'
security:
- csrfAuth: []
/api/v2/wallet/recover:
post:
operationId: walletRecover
parameters:
- description: Wallet id.
in: header
name: id
required: true
type: string
- description: Wallet seed.
in: header
name: seed
required: true
type: string
- description: Wallet password.
in: header
name: password
type: string
produces:
- application/json
responses:
"200":
description: This endpoint decrypts wallets.
schema:
properties:
data:
properties:
entries:
items:
properties:
address:
type: string
public_key:
type: string
type: array
meta:
properties:
coin:
type: string
crypto_type:
type: string
encrypted:
type: boolean
filename:
type: string
label:
type: string
timestamp:
format: int64
type: integer
type:
type: string
version:
type: string
type: object
type: object
default:
$ref: '#/responses/genericError'
security:
- csrfAuth: []
summary: Recovers an encrypted wallet by providing the seed. The first address
will be generated from seed and compared to the first address of the specified
wallet. If they match, the wallet will be regenerated with an optional password.
If the wallet is not encrypted, an error is returned.
/api/v2/wallet/seed/verify:
post:
consumes:
- application/json
operationId: walletSeedVerify
parameters:
- description: Seed to be verified.
in: header
name: seed
type: string
produces:
- application/json
responses:
"200":
description: Verifies a wallet seed.
schema:
properties:
data:
description: Empty
type: object
"422":
description: Wrong Seed
default:
$ref: '#/responses/genericError'
security:
- csrfAuth: []
summary: Verifies a wallet seed.
produces:
- application/json
- application/xml
responses:
buildInfo:
description: BuildInfo represents the build info
headers:
branch:
description: git branch name
type: string
commit:
description: git commit id
type: string
version:
description: version number
type: string
coinSupply:
description: CoinSupply records the coin supply info.
headers:
current_coinhour_supply:
description: CurrentCoinHourSupply is coins hours in non distribution addresses.
type: string
current_supply:
description: Coins distributed beyond the project.
type: string
locked_distribution_addresses:
description: Distribution addresses which are locked and do not count towards
total supply.
items:
type: string
type: array
max_supply:
description: MaxSupply is the maximum number of coins to be distributed ever.
type: string
total_coinhour_supply:
description: TotalCoinHourSupply is coin hours in all addresses including
unlocked distribution addresses.
type: string
total_supply:
description: TotalSupply is CurrentSupply plus coins held by the distribution
addresses that are spendable.
type: string
unlocked_distribution_addresses:
description: Distribution addresses which count towards total supply.
items:
type: string
type: array
genericError:
description: |-
A GenericError is the default error message that is generated.
For certain status codes there are more appropriate error structures.
schema:
properties:
code:
format: int32
type: integer
x-go-name: Code
message:
type: string
x-go-name: Message
type: object
schemes:
- http
- https
securityDefinitions:
csrfAuth:
in: header
name: X-CSRF-TOKEN
type: apiKey
swagger: "2.0"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment