Skip to content

Commit

Permalink
Merge pull request #1468 from alex-semenyuk/map_example
Browse files Browse the repository at this point in the history
Add map example to Tezos docs
  • Loading branch information
nguyer authored Feb 16, 2024
2 parents b99ba5a + a627551 commit 8b6b604
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion docs/tutorials/custom_contracts/tezos.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ The `details` field is used to encapsulate blockchain specific type information
- variant
- list
- struct
- map

#### Internal type vs Internal schema

Expand Down Expand Up @@ -203,6 +204,29 @@ The `details` field is used to encapsulate blockchain specific type information
}
```

<i>Map example:</i>

``` json
{
"details": {
"type": "schema",
"internalSchema": {
"type": "map",
"args": [
{
"name": "key",
"type": "integer"
},
{
"name": "value",
"type": "string"
}
]
}
}
}
```

#### Options

<i>Option</i> type is used to indicate a value as optional (see more at [smartpy options](https://smartpy.io/manual/syntax/options-and-variants#options))
Expand Down Expand Up @@ -665,4 +689,4 @@ To make a read-only request to the blockchain to check the current value of the
}
```

> **NOTE:** Some contracts may have queries that require input parameters. That's why the query endpoint is a `POST`, rather than a `GET` so that parameters can be passed as JSON in the request body. This particular function does not have any parameters, so we just pass an empty JSON object.
> **NOTE:** Some contracts may have queries that require input parameters. That's why the query endpoint is a `POST`, rather than a `GET` so that parameters can be passed as JSON in the request body. This particular function does not have any parameters, so we just pass an empty JSON object.

0 comments on commit 8b6b604

Please sign in to comment.