Getting Started - Blocks

Overview

Trustless Work React library is a collection of React hooks and entities. It combines the following packages:


Setup

1

Installation

Start by installing Trustless Work Blocks

2

Initialize Configuration

Setup your project with blocks

3

Configure Environment

The next step is to configure the Trustless Work provider. You need to configure the following:

  • baseURL: Trustless Work URL, this should be the main or development environment. We provide mainNetand developmentconstants. So you only need to import one of them and pass it to the baseURL prop.

  • apiKey: Authorization provided by our dApp to use the API.

Trustless Work React provides the TrustlessWorkConfig to provides all the custom hooks and entities to the whole project. To achieve this you'll need to create a Provider.

4

Wrap your App with Providers

Absolutely must be used: ReactQueryClientProvider | TrustlessWorkProvider | WalletProvider.

If you want to use some blocks, you should wrap your app with their providers. See more in: Dependencies

5

Add your First Component

Add wallet connectivity to your app:

Example usage in a page:

Now, you are able to interact with Trustless Work blocks.

Last updated

Was this helpful?