Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
9
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
TZIP
tzip
Commits
21fb73fe
Commit
21fb73fe
authored
Dec 30, 2020
by
Seb Mondet
☕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
016: switch all JSON to “CamelCase”
parent
b99c8acb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
proposals/tzip-16/tzip-16.md
proposals/tzip-16/tzip-16.md
+12
-12
No files found.
proposals/tzip-16/tzip-16.md
View file @
21fb73fe
...
...
@@ -327,7 +327,7 @@ Example:
{
"error"
:
{
"int"
:
"42"
},
"expansion"
:
{
"bytes"
:
"0x7175656c7175652063686f7365206e276120706173206d61726368c3a9"
},
"languages"
:
[
"fr"
]
},
{
"view"
:
"translate
-s
tring
-e
rror"
}
{
"view"
:
"translate
S
tring
E
rror"
}
],
"views"
:
[
//
...
see
below
...
...
...
@@ -348,7 +348,7 @@ An off-chain view object has at least 2 fields:
-
`"implementations"`
: a list of implementation objects: usable definitions of
the views. Each implementation is a one-field object where the field name
discriminates between various kinds of views. Below, this standard defines 2
of those kinds,
`"michelson
-s
torage
-v
iew"`
and
`"rest
-api-q
uery"`
, further
of those kinds,
`"michelson
S
torage
V
iew"`
and
`"rest
ApiQ
uery"`
, further
deriving standards may add new ones.
-
`"pure"`
(optional, default:
`false`
): a boolean “tag” advertising that the
view should be considered
*a (pure) function*
of the storage of the contract
...
...
@@ -365,8 +365,8 @@ Example:
"description"
:
"Get the current allowance for a user of the contract."
,
"pure"
:
"true"
,
"implementations"
:
[
{
"michelson
-s
torage
-v
iew"
:
{
/*
,,,
see
below
...
*/
}
},
{
"rest
-api-q
uery"
:
{
/*
,,,
see
below
...
*/
}
},
{
"michelson
S
torage
V
iew"
:
{
/*
,,,
see
below
...
*/
}
},
{
"rest
ApiQ
uery"
:
{
/*
,,,
see
below
...
*/
}
},
//
...
potential
extensions
...
]
}
...
...
@@ -374,7 +374,7 @@ Example:
##### Michelson Storage Views
The
`"michelson
-s
torage
-v
iew"`
field is a JSON object describing a sequence of
The
`"michelson
S
torage
V
iew"`
field is a JSON object describing a sequence of
Michelson instructions to run on a pair formed by a given parameter and the
storage of the contract being queried in order to leave the execution stack with
the queried value. For this object we define 3 fields and a custom type
...
...
@@ -383,7 +383,7 @@ the queried value. For this object we define 3 fields and a custom type
-
`"parameter"`
(optional): an (annotated) Michelson type of the potential
external parameters required by the view code; if the field is absent the view
does not require any external input parameter.
-
`"return
-t
ype"`
(required): the type of the result of the view (i.e. for the
-
`"return
T
ype"`
(required): the type of the result of the view (i.e. for the
value left on the stack); the type can also be annotated.
-
`"code"`
(required): the Michelson code expression implementing the view.
-
`"annotations"`
: a list of objects documenting the annotations used in the 3
...
...
@@ -408,7 +408,7 @@ Example:
{
"prim"
:
"string"
,
"annots"
:
[
"user"
]}
]
},
"return
-t
ype"
:
{
"prim"
:
"nat"
},
"return
T
ype"
:
{
"prim"
:
"nat"
},
"code"
:
[
{
"prim"
:
"DUP"
},
{
"prim"
:
"DIP"
,
"args"
:
[
...
...
@@ -452,13 +452,13 @@ There are limitations on the contents of the `"code"` field:
#### Rest API Views
The
`"rest
-api-q
uery"`
field is an object describing how to map the view to an
The
`"rest
ApiQ
uery"`
field is an object describing how to map the view to an
[
Open API
](
https://github.com/OAI/OpenAPI-Specification
)
description of a
REST-API.
-
`"specification
-u
ri"`
(required): a string giving the location (URI) of the
-
`"specification
U
ri"`
(required): a string giving the location (URI) of the
full Open API specification.
-
`"base
-u
ri"`
(optional): The recommended
`"server"`
to use.
-
`"base
U
ri"`
(optional): The recommended
`"server"`
to use.
-
`"path"`
(required): The API path within the Open API specification that
implements the view.
-
`"method"`
(optional, default:
`"GET"`
): The method used for the view.
...
...
@@ -467,8 +467,8 @@ Example:
```
json
{
"specification
-u
ri"
:
"https://example.com/openapi/my-token"
,
"base
-u
ri"
:
"https://example.com/my-token/v2"
,
"specification
U
ri"
:
"https://example.com/openapi/my-token"
,
"base
U
ri"
:
"https://example.com/my-token/v2"
,
"path"
:
"/allowances"
,
}
```
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment