Skip to content

Commit

Permalink
feat(scripts): add scripts/datum/:hash endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
sorki committed Oct 12, 2021
1 parent 8ca49a9 commit 1ec1a8d
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -49,6 +49,7 @@ and this project will adhere to [Semantic Versioning](https://semver.org/spec/v2
- `/scripts` endpoint for listing all scripts
- `/scripts/{hash}` endpoint for script details
- `/scripts/{hash}/redeemers` endpoint for listing reedemers of a script
- `/scripts/datum/{hash}` endpoint
- `/txs/{hash}/redeemers` endpoint for querying transaction redeemers
- `locked` property to `/network` endpoint, representing total supply locked
by scripts
Expand Down
55 changes: 55 additions & 0 deletions swagger.yaml
Expand Up @@ -3553,6 +3553,40 @@ paths:
"500":
$ref: "#/components/responses/internal_server_error"

/scripts/datum/{datum_hash}:
get:
tags:
- Cardano » Scripts
summary: Datum value
description: Query JSON value of a datum by its hash
parameters:
- in: path
name: datum_hash
required: true
schema:
type: string
description: Hash of the datum
example: "db583ad85881a96c73fbb26ab9e24d1120bb38f45385664bb9c797a2ea8d9a2d"
responses:
"200":
description: Return the datum value
content:
application/json:
schema:
$ref: "#/components/schemas/script_datum"
"400":
$ref: "#/components/responses/bad_request"
"403":
$ref: "#/components/responses/unauthorized_error"
"404":
$ref: "#/components/responses/not_found"
"429":
$ref: "#/components/responses/overusage_limit"
"418":
$ref: "#/components/responses/autobanned"
"500":
$ref: "#/components/responses/internal_server_error"

/ipfs/add:
servers:
- url: https://ipfs.blockfrost.io/api/v0
Expand Down Expand Up @@ -6530,6 +6564,27 @@ components:
- unit_steps
- fee

script_datum:
type: object
properties:
json_value:
anyOf:
- type: string
- type: object
- type: array
items: {}
- type: integer
- type: number
- type: boolean
description: JSON content of the datum
required:
- json_value
example:
json_value:
{
"int": 42
}

metrics:
type: array
items:
Expand Down

0 comments on commit 1ec1a8d

Please sign in to comment.