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:
Code repo:
Wrapper
Select one of the various Tezos networks, i.e. testnet or mainnet.
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.
#import { Connection, Mutation, Query, SendParams } into Tezos from "w3://ens/tezos.web3api.eth"
#import { Query } into TezosDomainsPlugin from "w3://ens/tezosDomainsPlugin.web3api.eth"
#import { Network, CustomConnection } from "../common/schema.graphql"
Fragments (Reusable Types)
Commit Params
type CommitParams {
# domain name
label: String!
# address of owner
owner: String!
# Random number
nonce: UInt32!
}
Buy Params
type BuyParams {
# domain name
label: String!
# address of owner
owner: String!
# address of domain
address: String!
# Random number
nonce: UInt32!
# Duration of domain
duration: UInt32!
# metadata of domain
# Stringified JSON
data: String!
}
Now, link the wrapper to Tezos-plugin-js and tezos-test-env:
yarn link @web3api/tezos-plugin-js
yarn link @web3api/tezos-test-env
Install the node packages and build plugin-js
yarn
yarn build
Running Tests
The e2e tests can be found in the src/tests/e2e folder. Run the e2e tests as follows:
yarn test
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.