Tezos Domains Wrapper

circle-info

Tezos Domainsarrow-up-right is a distributed, open and extensible naming system using the Tezos blockchain.

The Tezos Domains Polywrapper allows you to search for registered Tezos domain names across Tezos testnets and mainnet. The network to search on is detected from the TLD you add, i.e. .tez for mainnet and e.g. .gra or .han for testnets.

Demo app, powered by Tezos Domains Polywrapper: https://blockwatch-cc.github.io/polywrap-tezos-demo/polydomains/arrow-up-right

Code repo: https://github.com/blockwatch-cc/polywrap-tezos/tree/main/tezos/tezos-domainsarrow-up-right

Wrapper

Select one of the various Tezos networks, i.e. testnet or mainnet.

enum Network {
  custom
  mainnet
  ghostnet
  jakartanet
}

Custom Connection

Paste custom connection parameters.

type CustomConnection {
  connection: Tezos_Connection!
  contractAddress: String!
}

Queries

Import Plugins

Import response types from the common/schema.graphql to be used in the query GraphQL.

Resolve Address

Type to resolve address to domain record.

Resolve Domain

Type is to resolve a valid domain name.

Mutations

Import Plugins

Import methods and types from w3://ens/tezos.web3api.eth, w3://ens/tezosDomainsPlugin.web3api.eth and common/schema.graphql to be used in the mutation schemas.

Fragments (Reusable Types)

Commit Params

Buy Params

Send Params

Mutation

Commit

Buy

Creating a Web3 client with Tezos Domains plugin support

A function to resolve a Tezos Domain via Polywrap + GraphQL

Wrapper Example

The Tezos Domains plugin can be found in the ./tezos/tezos-domains folder.

Remove these lines of code from the package.json file:

Now, link the wrapper to Tezos-plugin-js and tezos-test-env:

Install the node packages and build plugin-js

Running Tests

The e2e tests can be found in the src/tests/e2e folder. Run the e2e tests as follows:

Project Structure

Mutations

Can be found in the ./src/mutation folder containing the index.ts file which is the AssemblyScript mutation logic and schema.graphql file which contains the graphql schemas for the functions in the mutation's index file.

Queries

Queries are implemented in the ./src/query folder.

Tests

To test the query and mutation functions, e2e tests are available.

Last updated