...
 
Commits (12)
......@@ -32,7 +32,7 @@ alternative options, opinions, and objections.
| [TZIP-11] | Contract Specification Schema | 01/10/2020 | Work In Progress |
| [TZIP-12] | `FA2` - Multi-Asset Interface | 01/24/2020 | Draft |
| [TZIP-13] | `FA1.3` - Fungible Asset Standard | 01/02/2020 | Work In Progress |
| [TZIP-14] | GraphQL interface to Tezos node data | 02/03/2020 | Work In Progress |
| [TZIP-14] | GraphQL interface to Tezos node data | 04/01/2020 | Draft |
| [TZIP-15] | Token Whitelisting | 05/01/2020 | Work In Progress |
## How to Contribute
......
......@@ -21,15 +21,16 @@ let custom_validate_receivers (p, wl : transfer_descriptor_param * (address set)
Set.fold
(fun (ops, r : (operation list) * address) ->
let hook = to_sender_hook r in
let hook, err = to_sender_hook r in
match hook with
| Some h ->
let op = Operation.transaction p 0mutez h in
let pm = transfer_descriptor_param_to_michelson p in
let op = Operation.transaction pm 0mutez h in
op :: ops
| None ->
| None ->
if Set.mem r wl
then ops
else (failwith "receiver not permitted" : operation list)
else (failwith err : operation list)
)
receivers ([] : operation list)
......@@ -39,10 +40,9 @@ let custom_transfer_hook (p, s : transfer_descriptor_param * storage) : operatio
let get_policy_descriptor (u : unit) : permissions_descriptor =
{
self = Self_transfer_permitted;
operator = Operator_transfer_permitted;
sender = Owner_no_op;
receiver = Owner_no_op ; (* overridden by the custom policy *)
operator = Owner_or_operator_transfer;
sender = Owner_no_hook;
receiver = Owner_no_hook ; (* overridden by the custom policy *)
custom = Some {
tag = "receiver_hook_and_whitelist";
config_api = (Some Current.self_address);
......
This diff is collapsed.
---
tzip: 14
title: GraphQL interface to Tezos node data - Scalars
status: Draft
type: Interface
author: Andrew Paulicek <[email protected]>, Miroslav Bodecek ([email protected])
created: 2020-04-01
---
## Summary
This document describes a set of custom scalars used in the GraphQL interface to Tezos node data.
## Motivation
Using custom scalars tailored to the Tezos types gives a lot of benefits for validation. Projects implementing Tezos GraphQL schema using these scalars will able to provide validation. It is especially useful for validating hashes and addresses, which are using `base58check` encoding.
## Specification
### Scalars
``` graphql
# Tezos address. Represented as public key hash (Base58Check-encoded) prefixed with tz1, tz2, tz3 or KT1.
scalar Address
# Timestamp specified as a ISO-8601 UTC date string (2020-02-04T15:31:39Z)
scalar DateTime
# JSON represents any valid JSON object
scalar JSON
# Raw Michelson expression represented as JSON
scalar MichelsonExpression
# Arbitrary precision number represented as string in JSON.
scalar BigNumber
# Micro tez. Positive bignumber. 1 tez = 1,000,000 micro tez.
scalar Mutez
# Operation identifier (Base58Check-encoded) prefixed with o.
scalar OperationHash
# Block identifier (Base58Check-encoded) prefixed with B.
scalar BlockHash
# Protocol identifier (Base58Check-encoded) prefixed with P.
scalar ProtocolHash
# Context identifier (Base58Check-encoded) prefixed with Co.
scalar ContextHash
# Operations identifier (Base58Check-encoded) prefixed with LLo (List of a list of operations).
scalar OperationsHash
# Chain identifier (Base58Check-encoded) prefixed with Net.
scalar ChainId
# Generic signature (Base58Check-encoded) prefixed with sig.
scalar Signature
# Public key (Base58Check-encoded) prefixed with edpk, sppk or p2pk.
scalar PublicKey
# Nonce hash (Base58Check-encoded).
scalar NonceHash
```
## Implementations
### Tezos GraphQL schema
Reference Tezos GraphQL schema using the scalars is defined here: https://gitlab.com/tezos-graphql/schema
### Scalar resolvers
Reference GraphQL scalar resolvers implementation for base58check types is available here: https://gitlab.com/tezos-graphql/tezos-graphql-nodejs/-/blob/master/src/resolvers/scalars/base58-resolvers.ts
## Related work
### TaaS-GraphQL
Reference implementation of the Tezos GraphQL schema and respective scalar resolvers is available here https://gitlab.com/tezos-graphql/tezos-graphql-nodejs.
### TezosLive.io
Publicly available endpoint exposing Tezos node data over GraphQL using a reference implementation from [tezos-graphql-nodejs](https://gitlab.com/tezos-graphql/tezos-graphql-nodejs) project is hosted at [TezosLive.io](https://www.tezoslive.io).
### EIP-1767: GraphQL interface to Ethereum node data
[EIP-1767: GraphQL interface to Ethereum node data](https://eips.ethereum.org/EIPS/eip-1767) is a specification of the GraphQL interface for Ethereum node data. There are not many similarities between the scalars or their GraphQL schemes as their respective RPCs differ greatly.
\ No newline at end of file