Recently we published the first demo of our Tezos Polywrapper which allows easy integration of Tezos into any application written in any language. Today, we are happy to provide an update on our progress and get you started on how to use Tezos Polywrappers in your project or create wrappers for your own Tezos dapps.

First, a recap.

What's Polywrap?

  • Polywrap is a developer toolchain that enables easy integration of web3 protocols into any kind of application, eliminating the need for client-side SDKs
  • By using dynamically loadable WebAssembly modules with a standardized and discoverable GraphQL interface, Polywrap makes dapps more lightweight and multi-platform

Why Tezos Polywrapper?

  • Tezos Polywrappers offer a plug-and-play solution that enable straightforward Tezos integration
  • By lowering the barrier to interacting with the Tezos blockchain and Tezos dapps, developer adoption is increased

Our aim with the Tezos Polywrap integration is to make it easy for developers outside of the Tezos ecosystem to work with Tezos and easy for developers already onboarded to Tezos to create wrappers for Tezos dapps. Ultimately, we provide examples of wrappers for popular Tezos dapps to inspire you to build wrappers for your own or favorite Tezos projects.

Prototype Update

Previously, we hosted the first version of our core Tezos Polywrap plugin prototype on a private repository to which we added external contributors and reviewers on demand. Now that the project is maturing, we are making it available on a public GitHub repository.

The polywrap-tezos repo is a direct fork of Polywrap's upstream repo for integrations to which we will send pull requests once our implementation becomes stable.

Since the initial announcement, we have extended our core Tezos Polywrap plugin with external wallet support. Behind the scenes, we use Temple Wallet through its Taquito implementation and export the following functions for use by wrappers (we plan on using Beacon SDK later).

Support for read-only queries to the Tezos blockchain:

- getPublicKey
- getPublicKeyHash
- getRevealEstimate
- getTransferEstimate
- getOriginateEstimate
- checkAddress
- getBalance
- getContractStorage

Support for interacting with the Tezos blockchain:

- callContractMethod
- callContractMethodAndConfirm
- signMessage
- transfer
- transferAndConfirm
- originate
- originateAndConfirm

In preparation for dapp support, we've built wrappers for two more Tezos dapps in addition to the Tezos Domains plugin. There are now:

  • Tezos Domains – as Polywrap Plugin written in TypeScript
  • Harbinger Oracles – as Polywrap Wrapper written in AssemblyScript
  • Hic et Nunc – in progress, as Polywrap Wrapper written in AssemblyScript

As part of our final milestone, we will extend this with a wrapper for the upcoming V2 of the Quipuswap DEX.

Using Wrappers

To use any Polywrapper in your application, you need to install the Polywrap JavaScript client. Note that Polywrap's goal is to support every major programming language, with upcoming support for Rust. Blockwatch is exploring developing a Go toolchain for Polywrap.

Install via npm:

npm install --save @web3api/client-js
web3api is Polywrap's former name

The Polywrap JS client works both in Node.js and browser apps. Currently, Chrome and Brave are the only supported browsers. This will be amended soon.

Initialize the client:

import { Web3ApiClient } from '@web3api/client-js';
const client = new Web3ApiClient();

Great, you can now interact with any Polywrapper from any application such as our example wrappers found in the polywrap-tezos repo's tezos directory.

Creating Wrappers

To start developing your own Tezos Polywrapper, clone our fork of the Polywrap integration repository.

git clone https://github.com/blockwatch-cc/polywrap-tezos

Note that as long as Polywrap Tezos is in alpha stage, we are hosting our code's most recent version on our own repo. Once a stable release is ready, we will make the official version available directly on the upstream Polywrap repo.

Check back for our upcoming guide on creating a Tezos Polywrapper or dive right into the code of the example wrappers.

Support

If you're interested in using or creating Tezos Polywrappers and have questions or suggestions, feel free to reach out to us via Discord or Twitter. For questions directly related to the Polywrap platform, join the Polywrap Discord.