mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-04-23 03:20:19 +08:00
first pass at blueprint compatible api doc
This commit is contained in:
@@ -1,150 +1,489 @@
|
||||
# Blockstack Specifications
|
||||
# Group Authorization
|
||||
|
||||
## Dashboard Endpoints
|
||||
## Auth Request View [GET /auth?authRequest={authRequestToken}]
|
||||
|
||||
| Method | API Call | API family | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| Dashboard Home | GET / | identity | Serves the identity management panel |
|
||||
| Auth Request View | GET /auth?authRequest={authRequestToken} | identity | Serves the auth request view |
|
||||
When the user clicks “login” in an application, the app should
|
||||
redirect the user to this endpoint. If the user already has an
|
||||
account, they will be redirected along with requested data. If the
|
||||
user doesn’t have an account, the user will be presented with each of
|
||||
the app’s requested permissions, then will satisfy or deny them. The
|
||||
dashboard will then redirect the user back with a JWT. The response
|
||||
JWT contains a signature and an API token that the app can use for
|
||||
future authorization of endpoints.
|
||||
|
||||
#### Explanation of the auth request view:
|
||||
Each application specifies in advance which family of API calls it
|
||||
will need to make to function properly. This list is passed along to
|
||||
the dashboard endpoint when creating an application account. The
|
||||
account-creation page shows this list of API endpoints and what they
|
||||
do, and allows the user to line-item approve or deny them. The list
|
||||
is stored by the API server in the local account structure, and the
|
||||
list is given to the application as part of the session JWT. The API
|
||||
server will NACK requests to endpoints in API families absent from the
|
||||
session JWT.
|
||||
|
||||
When the user clicks “login” in an application, the app should redirect the user to this endpoint. If the user already has an account, they will be redirected along with requested data. If the user doesn’t have an account, the user will be presented with each of the app’s requested permissions, then will satisfy or deny them. The dashboard will then redirect the user back with a JWT. The response JWT contains a signature and an API token that the app can use for future authorization of endpoints.
|
||||
+ Requires full `Authorization:` header
|
||||
|
||||
Each application specifies in advance which family of API calls it will need to make to function properly. This list is passed along to the dashboard endpoint when creating an application account. The account-creation page shows this list of API endpoints and what they do, and allows the user to line-item approve or deny them. The list is stored by the API server in the local account structure, and the list is given to the application as part of the session JWT. The API server will NACK requests to endpoints in API families absent from the session JWT.
|
||||
+ Parameters
|
||||
+ authRequestToken: a jwt token (TODO: describe better)
|
||||
|
||||
## Administrative API
|
||||
# Group Node Administration API
|
||||
## Ping the node [GET /v1/node/ping]
|
||||
Ping the blockstack node to see if it's alive.
|
||||
|
||||
### Node
|
||||
+ Response 200 (application/json)
|
||||
+ Body
|
||||
|
||||
{
|
||||
"status": "alive",
|
||||
"version": "0.14.2"
|
||||
}
|
||||
|
||||
| Method | API Call | API family | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| Ping the node | GET /v1/node/ping | - | Requires pre-shared secret in the `Authorization:` header |
|
||||
| - | - | - | - |
|
||||
| Get the node's config | GET /v1/node/config | - | Requires pre-shared secret in the `Authorization:` header. Returns a dict with the config file |
|
||||
| Set one or more config fields in a config section | POST /v1/node/config/{section}?{key}={value} | - | Requires pre-shared secret in the `Authorization:` header. |
|
||||
| Delete a config field | DELETE /v1/node/config/{section}/{key} | - | Requires pre-shared secret in the `Authorization:` header. |
|
||||
| Delete a config section | DELETE /v1/node/config/{section} | - | Requires pre-shared secret in the `Authorization:` header. |
|
||||
| - | - | - | - |
|
||||
| Get registrar state | GET /v1/node/registrar/state | - | Requires pre-shared secret in the `Authorization:` header. |
|
||||
## Get the node's config [GET /v1/node/config]
|
||||
## Set config field [POST /v1/node/config/{section}?{key}={value}]
|
||||
Set one or more config fields in a config section.
|
||||
|
||||
### Wallet
|
||||
+ Parameters
|
||||
+ section: blockstack-client (string) - configuration section
|
||||
+ key: server (string) - configuration variable to set
|
||||
+ value: node.blockstack.org (string) - value to set
|
||||
|
||||
| Method | API Call | API family | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| Get wallet payment address | GET /v1/wallet/payment_address | wallet_read | - |
|
||||
| Get wallet owner address | GET /v1/wallet/owner_address | wallet_read | - |
|
||||
| Get wallet data public key | GET /v1/wallet/data_pubkey | wallet_read | - |
|
||||
| - | - | - | - |
|
||||
| Set the wallet | PUT /v1/wallet/keys | - | Requires a pre-shared secret in the `Authorization:` header |
|
||||
| Get the wallet | GET /v1/wallet/keys | - | Requires a pre-shared secret in the `Authorization:` header |
|
||||
| - | - | - | - |
|
||||
| Get the wallet balance | GET /v1/wallet/balance | wallet_read | - |
|
||||
| Get the wallet balance, specifying the minconfs for txns included | GET /v1/wallet/balance/{minconfs} | wallet_read | - |
|
||||
| Withdraw funds from the wallet | POST /v1/wallet/balance | wallet_write | Payload: `{'address': str, 'amount': int, 'min_confs': int, 'tx_only': bool} |
|
||||
| - | - | - | - |
|
||||
| Change wallet password | PUT /v1/wallet/password | wallet_write | Payload: `{'password': ..., 'new_password': ...}`|
|
||||
## Delete a config field [DELETE /v1/node/config/{section}/{key}]
|
||||
|
||||
### Authorization
|
||||
+ Parameters
|
||||
+ section: blockstack-client (string) - configuration section
|
||||
+ key: server (string) - configuration variable to set
|
||||
|
||||
| Method | API Call | API family | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| Create an authorization token | GET /v1/auth?authRequest={authRequestToken} | - | Requires a pre-shared secret in the `Authorization:` header. |
|
||||
## Delete a config section [DELETE /v1/node/config/{section}]
|
||||
Deletes a whole section from the node's config
|
||||
+ Parameters
|
||||
+ section: blockstack-client (string) - configuration section
|
||||
|
||||
TODO: authRequestToken format
|
||||
## Get registrar state [GET /v1/node/registrar/state]
|
||||
|
||||
## Naming API
|
||||
# Group Core Wallet Management
|
||||
|
||||
### Names
|
||||
## Get wallet payment address [GET /v1/wallet/payment_address]
|
||||
+ Authorization Family: `wallet_read`
|
||||
## Get wallet owner address [GET /v1/wallet/owner_address]
|
||||
+ Authorization Family: `wallet_read`
|
||||
## Get wallet data public key [GET /v1/wallet/data_pubkey]
|
||||
+ Authorization Family: `wallet_read`
|
||||
## Wallet key interactions [/v1/wallet/keys]
|
||||
+ Requires full `Authorization:` header
|
||||
### Set the wallet [PUT]
|
||||
### Get the wallet [GET]
|
||||
## Set a specific wallet key [PUT /v1/wallet/keys/{keyname}]
|
||||
+ Requires full `Authorization:` header
|
||||
+ Parameters
|
||||
+ keyname: owner (string) - which key to set (one of 'owner', 'data', 'payment')
|
||||
|
||||
| Method | API Call | API family | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| Get all names | GET /v1/names | names | - |
|
||||
| Register name | POST /v1/names | register | Payload: {"name": NAME, "zonefile" : ZONEFILE, "owner_address" : OWNER, "min_confs" : MIN_PAYMENT_CONFS, "unsafe" : REGISTRATION_SAFETY} Required: "name" |
|
||||
| Get name info | GET /v1/names/{name} | names | - |
|
||||
| Get name history | GET /v1/names/{name}/history | names | - |
|
||||
| Get historical zone file | GET /names/{name}/zonefile/{zoneFileHash} | zonefiles | - |
|
||||
| Revoke name | DELETE /v1/names/{name} | revoke | - |
|
||||
| Transfer name | PUT /v1/names/{name}/owner | transfer | Payload: {"owner": OWNER } |
|
||||
| Set zone file | PUT /v1/names/{name}/zonefile | update | Payload: {"zonefile": ZONE_FILE } |
|
||||
| Set zone file hash | PUT /v1/names/{name}/zonefile | update | Payload: {"zonefile_hash": ZONE_FILE_HASH } |
|
||||
+ Request (application/json)
|
||||
+ Schema
|
||||
|
||||
{
|
||||
"anyOf": [
|
||||
{
|
||||
"anyOf": [
|
||||
{
|
||||
"pattern": "^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+)$",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"pattern": "^([0-9a-fA-F]+)$",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"address": {
|
||||
"pattern": "^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+)$",
|
||||
"type": "string"
|
||||
},
|
||||
"private_keys": {
|
||||
"items": {
|
||||
"anyOf": [
|
||||
{
|
||||
"pattern": "^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+)$",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"pattern": "^([0-9a-fA-F]+)$",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"redeem_script": {
|
||||
"pattern": "^([0-9a-fA-F]+)$",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"address",
|
||||
"redeem_script",
|
||||
"private_keys"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
### Addresses
|
||||
## Get the wallet balance [/v1/wallet/balance]
|
||||
### Get the wallet balance [GET]
|
||||
+ Authorization Family: `wallet_read`
|
||||
Fetches wallet balance.
|
||||
### Withdraw funds from the wallet [POST]
|
||||
+ Authorization Family: `wallet_write`
|
||||
+ Request (application/json)
|
||||
+ Body
|
||||
|
||||
{'address' : 'mF12..',
|
||||
'amount' : 100,
|
||||
'min_confs' : 6,
|
||||
'tx_only' : false}
|
||||
|
||||
| Method | API Call | API family | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| Get names owned by address | GET /v1/addresses/{address} | names | - |
|
||||
## Get wallet balance, specifying minconfs [GET /v1/wallet/balance/{minconfs}]
|
||||
|
||||
### Namespaces
|
||||
Fetches wallet balance, including UTXOs from transactions with at
|
||||
least a specified number of confirmations.
|
||||
|
||||
| Method | API Call | API family | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| Get all namespaces | GET /v1/namespaces | namespaces | - |
|
||||
| Create namespace | POST /v1/namespaces | namespace_registration | NOT IMPLEMENTED |
|
||||
| Launch namespace | PUT /v1/namespaces/{tld} | namespace_registration | NOT IMPLEMENTED |
|
||||
| Get namespace names | GET /v1/namespaces/{tld}/names | namespaces | - |
|
||||
| Pre-register a name | POST /v1/namespaces/{tld}/names | namespace_registration | NOT IMPLEMENTED |
|
||||
| Update pre-registered name | PUT /v1/namespaces/{tld}/names/{name} | namespace_registration | NOT IMPLEMENTED |
|
||||
+ Parameters
|
||||
+ minconfs: 0 (number) - the minimum confs of transactions to include in balance
|
||||
## Change wallet password [PUT /v1/wallet/password]
|
||||
+ Authorization Family: `wallet_write`
|
||||
+ Request (application/json)
|
||||
+ Body
|
||||
|
||||
{'password' : 'foobarbar',
|
||||
'new_password' : 'barfoobar'}
|
||||
|
||||
### Prices
|
||||
# Group Names API
|
||||
This family of API endpoints deals with querying name information, but
|
||||
also registering, updating, transfering, and revoking names.
|
||||
|
||||
| Method | API Call | API family | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| Get namespace price | GET /v1/prices/namespaces/{tld} | prices | May return a warning if the wallet does not have enough funds |
|
||||
| Get name price | GET /v1/prices/names/{name} | prices | May return a warning if the wallet does not have enough funds |
|
||||
## Get all names [GET /v1/names?page={page}]
|
||||
Fetch a list of all names known to the node.
|
||||
|
||||
+ Parameters
|
||||
+ page: 23 (number) - names are returned in pages of size 100,
|
||||
so specify the page number.
|
||||
+ Response 200 (application/json)
|
||||
+ Body
|
||||
|
||||
### Blockchains
|
||||
[ "aldenquimby.id", "aldeoryn.id",
|
||||
"alderete.id", "aldert.id",
|
||||
"aldi.id", "aldighieri.id", ... ]
|
||||
|
||||
| Method | API Call | API family | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| Get block operations | GET /v1/blockchains/{blockchainName}/block/{blockHeight} | blockchain | - |
|
||||
| Get raw name history | GET /v1/blockchains/{blockchainName}/names/{nameID}/history | blockchain | - |
|
||||
| Get consensus hash | GET /v1/blockchains/{blockchainName}/consensusHash | blockchain | - |
|
||||
| Get pending transactions | GET /v1/blockchains/{blockchainName}/pending | blockchain | - |
|
||||
## Register a name [POST /v1/names]
|
||||
+ Authorization Family: `register`
|
||||
+ Request (application/json)
|
||||
+ Schema
|
||||
|
||||
| Method | API Call | API family | Notes |
|
||||
| ------ | -------- | ---------- | ----- |
|
||||
| Get unspent outputs | GET /v1/blockchains/{blockchainName}/{address}/unspent | blockchain | Returns `{"transaction_hash": str, "output_index": int, "value": int (satoshis), "script_hex": str, "confirmations": int}` |
|
||||
| Broadcast transaction | POST /v1/blockchains/{blockchainName}/txs | blockchain | Takes `{"tx": str}` as its payload |
|
||||
{
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
"name": {
|
||||
'type': 'string',
|
||||
'pattern': OP_NAME_PATTERN
|
||||
},
|
||||
"zonefile": {
|
||||
'type': 'string',
|
||||
'maxLength': RPC_MAX_ZONEFILE_LEN,
|
||||
},
|
||||
"owner_address": {
|
||||
'type': 'string',
|
||||
'pattern': OP_BASE58CHECK_PATTERN,
|
||||
},
|
||||
'min_confs': {
|
||||
'type': 'integer',
|
||||
'minimum': 0,
|
||||
},
|
||||
'tx_fee': {
|
||||
'type': 'integer',
|
||||
'minimum': 0,
|
||||
'maximum': TX_MAX_FEE,
|
||||
},
|
||||
'cost_satoshis': {
|
||||
'type': 'integer',
|
||||
'minimum': 0,
|
||||
},
|
||||
'unsafe': {
|
||||
'type': 'boolean'
|
||||
}
|
||||
},
|
||||
'required': [
|
||||
'name'
|
||||
],
|
||||
'additionalProperties': False,
|
||||
}
|
||||
|
||||
## Identity API
|
||||
## Get name info [/v1/names/{name}]
|
||||
+ Parameters
|
||||
+ name: muneeb.id (string) - fully-qualified name
|
||||
### Get name info [GET]
|
||||
+ Response 200 (application/json)
|
||||
+ Body
|
||||
|
||||
### Profiles
|
||||
{
|
||||
"address": "1QJQxDas5JhdiXhEbNS14iNjr8auFT96GP",
|
||||
"blockchain": "bitcoin",
|
||||
"expire_block": 489247,
|
||||
"last_txid": "1edfa419f7b83f33e00830bc9409210da6c6d1db60f99eda10c835aa339cad6b",
|
||||
"status": "registered",
|
||||
"zonefile": "$ORIGIN muneeb.id\n$TTL 3600\n_http._tcp IN URI 10 1 \"https://blockstack.s3.amazonaws.com/muneeb.id\"\n",
|
||||
"zonefile_hash": "b100a68235244b012854a95f9114695679002af9"
|
||||
}
|
||||
|
||||
TODO: this is not decided
|
||||
### Revoke name [DELETE]
|
||||
+ Requires Authorization Family: `revoke`
|
||||
## Get name history [GET /v1/names/{name}/history]
|
||||
Get a history of all blockchain records of a registered name.
|
||||
|
||||
| Method | API Call | API family | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| Create profile | POST /v1/profiles | profile_write | Payload: `{"name": NAME, "profile": PROFILE}`. Wallet must own the name. |
|
||||
| Get profile | GET /v1/profiles/{name} | profile_read | - |
|
||||
| Delete profile | DELETE /v1/profiles/{name} | profile_write | Wallet must own {name} |
|
||||
| Update profile | PATCH /v1/profiles/{name} | profile_write | Payload: `{"blockchain_id": NAME, "profile": PROFILE }`. Wallet must own the name |
|
||||
+ Response 200 (application/json)
|
||||
+ Body
|
||||
|
||||
### Datastores
|
||||
{
|
||||
"373821": [
|
||||
{
|
||||
"address": "1QJQxDas5JhdiXhEbNS14iNjr8auFT96GP",
|
||||
"block_number": 373821,
|
||||
"consensus_hash": null,
|
||||
"first_registered": 373821,
|
||||
"importer": "76a9143e2b5fdd12db7580fb4d3434b31d4fe9124bd9f088ac",
|
||||
"importer_address": "16firc3qZU97D1pWkyL6ZYwPX5UVnWc82V",
|
||||
"last_creation_op": ";",
|
||||
"last_renewed": 373821,
|
||||
"name": "muneeb.id",
|
||||
"name_hash128": "deb7fe99776122b77925cbf0a24ab6f8",
|
||||
"namespace_block_number": 373601,
|
||||
"namespace_id": "id",
|
||||
"op": ";",
|
||||
"op_fee": 100000.0,
|
||||
"opcode": "NAME_IMPORT",
|
||||
"preorder_block_number": 373821,
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
| Method | API Call | API family | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| Create store for this session | POST /v1/stores | store_write | Creates a datastore for the application indicated by the session |
|
||||
| Get store metadata | GET /v1/stores/{storeID} | store_admin | - |
|
||||
| Delete store | DELETE /v1/stores/{storeID} | store_write | Deletes all files and directories in the store as well |
|
||||
| - | - | - | - |
|
||||
| Get inode info (stat) | GET /v1/stores/{storeID}/inodes?path={path} | store_read | - |
|
||||
| - | - | - | - |
|
||||
| Get directory files (ls) | GET /v1/stores/{storeID}/directories?path={path} | store_read | Returns structured inode data |
|
||||
| Create directory (mkdir) | POST /v1/stores/{storeID}/directories?path={path} | store_write | Only works on the datastore for the application indicated by the session |
|
||||
| Delete directory (rmdir) | DELETE /v1/stores/{storeID}/directories?path={path} | store_write | Only works on the datastore for the application indicated by the session |
|
||||
| - | - | - | - |
|
||||
| Get file data (cat) | GET /v1/stores/{storeID}/files?path={path} | store_read | Returns `application/octet-stream` data |
|
||||
| Create file | POST /v1/stores/{storeID}/files?path={path} | store_write | Uploads `application/octet-stream` raw file data. Only works on the datastore for the application indicated by the session. |
|
||||
| Update file | PUT /v1/stores/{storeID}/files?path={path} | store_write | Uploads `application/octet-stream` raw file data. Only works on the datastore for the application indicated by the session. |
|
||||
| Delete file (rm) | DELETE /v1/stores/{storeID}/files?path={path} | store_write | Only works on the datastore for the application indicated by the session |
|
||||
## Get historical zone file [GET /names/{name}/zonefile/{zoneFileHash}]
|
||||
## Transfer name [PUT /v1/names/{name}/owner]
|
||||
+ Requires Authorization Family: `transfer`
|
||||
## Set zone file [PUT /v1/names/{name}/zonefile]
|
||||
Sets the user's zonefile hash, and, if supplied, propagates the
|
||||
zonefile. If you supply the zonefile, the hash will be calculated from
|
||||
that. Ultimately, your requests should only supply one of `zonefile`,
|
||||
`zonefile_b64`, or `zonefile_hash`.
|
||||
|
||||
### Collections
|
||||
+ Requires Authorization Family: `update`
|
||||
+ Request (application/json)
|
||||
+ Schema
|
||||
|
||||
| Method | API Call | API family | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| Create collection | POST /v1/collections | collection_admin | NOT IMPLEMENTED |
|
||||
| Get all collection items | GET /v1/collections/{collectionID} | collection_read | NOT IMPLEMENTED |
|
||||
| Create collection item | POST /v1/collections/{collectionID} | collection_write | NOT IMPLEMENTED |
|
||||
| Get collection item | GET /v1/{collectionID}/{itemID} | collection_read | NOT IMPLEMENTED |
|
||||
request_schema = {
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
"zonefile": {
|
||||
'type': 'string',
|
||||
'maxLength': RPC_MAX_ZONEFILE_LEN,
|
||||
},
|
||||
'zonefile_b64': {
|
||||
'type': 'string',
|
||||
'maxLength': (RPC_MAX_ZONEFILE_LEN * 4) / 3 + 1,
|
||||
},
|
||||
'zonefile_hash': {
|
||||
'type': 'string',
|
||||
'pattern': OP_ZONEFILE_HASH_PATTERN,
|
||||
},
|
||||
'tx_fee': {
|
||||
'type': 'integer',
|
||||
'minimum': 0,
|
||||
'maximum': TX_MAX_FEE
|
||||
},
|
||||
},
|
||||
'additionalProperties': False,
|
||||
}
|
||||
|
||||
+ Response 202 (application/json)
|
||||
+ Body
|
||||
|
||||
{'transaction_hash' : '...'}
|
||||
|
||||
## Get names owned by address [GET /v1/addresses/{blockchain}/{address}]
|
||||
Retrieves a list of names owned by the address provided.
|
||||
|
||||
+ Parameters
|
||||
+ blockchain: bitcoin (string) - the layer-1 blockchain for the address
|
||||
+ address: 1QJQxDas5JhdiXhEbNS14iNjr8auFT96GP (string) - the address to lookup
|
||||
|
||||
+ Response 200 (application/json)
|
||||
+ Body
|
||||
|
||||
{
|
||||
"names": ["muneeb.id"]
|
||||
}
|
||||
|
||||
# Group Namespace APIs
|
||||
## Get all namespaces [GET /v1/namespaces]
|
||||
+ Response 200 (application/json)
|
||||
+ Body
|
||||
|
||||
{
|
||||
"namespaces": [
|
||||
".id"
|
||||
]
|
||||
}
|
||||
|
||||
## Get namespace names [GET /v1/namespaces/{tld}/names?page={page}]
|
||||
Fetch a list of names from the namespace.
|
||||
+ Parameters
|
||||
+ tld: id (string) - the namespace to fetch names from
|
||||
+ page: 23 (number) - names are returned in pages of size 100,
|
||||
so specify the page number.
|
||||
+ Response 200 (application/json)
|
||||
+ Body
|
||||
|
||||
[ "aldenquimby.id", "aldeoryn.id",
|
||||
"alderete.id", "aldert.id",
|
||||
"aldi.id", "aldighieri.id", ... ]
|
||||
|
||||
## Create namespace [POST /v1/namespaces]
|
||||
Not yet implemented.
|
||||
## Pre-register a name [POST /v1/namespaces/{tld}/names]
|
||||
Not implemented.
|
||||
## Update pre-registered name [POST /v1/namespaces/{tld}/names/{name}]
|
||||
Not implemented.
|
||||
## Launch namespace [PUT /v1/namespaces/{tld}]
|
||||
Not implemented.
|
||||
|
||||
# Group Price Checking Endpoints
|
||||
## Get namespace price [GET /v1/prices/namespaces/{tld}]
|
||||
## Get name price [GET /v1/prices/names/{name}]
|
||||
+ Parameters
|
||||
+ name: muneeb.id (string) - name to query price information for
|
||||
+ Response 200 (application/json)
|
||||
+ Body
|
||||
|
||||
{
|
||||
"name_price": {
|
||||
"satoshis": 100000,
|
||||
"btc": 0.001
|
||||
},
|
||||
"total_tx_fees": 519209,
|
||||
"register_tx_fee": {
|
||||
"satoshis": 159110,
|
||||
"btc": 0.0015911
|
||||
},
|
||||
"preorder_tx_fee": {
|
||||
"satoshis": 163703,
|
||||
"btc": 0.00163703
|
||||
},
|
||||
"warnings": [
|
||||
"Insufficient funds; fees are rough estimates."
|
||||
],
|
||||
"total_estimated_cost": {
|
||||
"satoshis": 619209,
|
||||
"btc": 0.00619209
|
||||
},
|
||||
"update_tx_fee": {
|
||||
"satoshis": 196396,
|
||||
"btc": 0.00196396
|
||||
}
|
||||
}
|
||||
|
||||
# Group Blockchain Operations#
|
||||
## Get consensus hash [GET /v1/blockchains/{blockchainName}/consensus]
|
||||
Get the current Blockstack consensus hash on a blockchain.
|
||||
+ Parameters
|
||||
+ blockchainName : bitcoin (string) - the given blockchain
|
||||
+ Response 200 (application/json)
|
||||
+ Body
|
||||
|
||||
{
|
||||
"consensus_hash": "2fcbdf66c350894fe03b42c6a2e8a6ac"
|
||||
}
|
||||
|
||||
## Get pending transactions [GET /v1/blockchains/{blockchainName}/pending]
|
||||
Get the current transactions that the node has issued and are still pending.
|
||||
+ Parameters
|
||||
+ blockchainName : bitcoin (string) - the given blockchain
|
||||
+ Response 200 (application/json)
|
||||
+ Body
|
||||
|
||||
{
|
||||
"queues": {}
|
||||
}
|
||||
## Get unspent outputs [GET /v1/blockchains/{blockchainName}/{address}/unspent]
|
||||
+ Requires Authorization Family: `blockchain`
|
||||
+ Parameters
|
||||
+ blockchainName : bitcoin (string) - the given blockchain
|
||||
+ address : 1GuKR3nJi2VH3E1ZSPvuX8nAu3jNnr7xzq (string) - the address to get unspents for
|
||||
+ Response 200 (application/json)
|
||||
+ Body
|
||||
|
||||
[
|
||||
{
|
||||
"confirmations": 18,
|
||||
"out_script": "76a914ae6ee3760fccb8225541ca89f08c927930adf97b88ac",
|
||||
"outpoint": {
|
||||
"hash": "977d3a025790e2cbdb50f63761872f36e78fbb9c53d515cb4c53155a1964932d",
|
||||
"index": 1
|
||||
},
|
||||
"transaction_hash": "977d3a025790e2cbdb50f63761872f36e78fbb9c53d515cb4c53155a1964932d",
|
||||
"value": 76779
|
||||
}
|
||||
]
|
||||
|
||||
## Broadcast transaction [POST /v1/blockchains/{blockchainName}/txs]
|
||||
+ Requires Authorization Family: `blockchain`
|
||||
+ Parameters
|
||||
+ blockchainName : bitcoin (string) - the blockchain to broadcast on
|
||||
+ Request (application/json)
|
||||
+ Schema
|
||||
|
||||
{
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'tx': {
|
||||
'type': 'string',
|
||||
'pattern': OP_HEX_PATTERN,
|
||||
},
|
||||
},
|
||||
'additionalProperties': False,
|
||||
'required': [
|
||||
'tx'
|
||||
],
|
||||
}
|
||||
|
||||
+ Response 200 (application/json)
|
||||
+ Body
|
||||
|
||||
{ 'status' : True, 'tx_hash' : '...' }
|
||||
|
||||
# Get block operations [GET /v1/blockchains/{blockchainName}/block/{blockHeight}]
|
||||
Not implemented
|
||||
## Get raw name history [GET /v1/blockchains/{blockchainName}/names/{nameID}/history]
|
||||
Not implemented
|
||||
|
||||
# Group Gaia Endpoints
|
||||
## Create "store" for this session [POST /v1/stores]
|
||||
## "Store" operations [/v1/stores/{storeID}]
|
||||
### Get "store" metadata [GET]
|
||||
### Delete "store" [DELETE]
|
||||
## Get inode info (stat) [GET /v1/stores/{storeID}/inodes?path={path}]
|
||||
## Directory operations [/v1/stores/{storeID}/directories?path={path}]
|
||||
### Get directory files (ls) [GET]
|
||||
### Create directory (mkdir) [POST]
|
||||
### Delete directory (rmdir) [DELETE]
|
||||
## File Operations [/v1/stores/{storeID}/files?path={path}]
|
||||
### Get file data (cat) [GET]
|
||||
### Create file [POST]
|
||||
### Update file [PUT]
|
||||
### Delete file (rm) [DELETE]
|
||||
|
||||
# Proposed Collection APIs
|
||||
## Create collection [POST /v1/collections]
|
||||
## Get all collection items [/v1/collections/{collectionID}]
|
||||
### Get all collection items [GET]
|
||||
### Create collection item [POST]
|
||||
## Get collection item [GET /v1/collections/{collectionID}/{itemID}]
|
||||
|
||||
Reference in New Issue
Block a user