Getting Started
Overview
Trustless Work Blocks is a set of React UI blocks, hooks, and providers.
It bundles (or expects) these core libraries:
react-hook-form β Performant, flexible library for managing forms in React.
zod β TypeScript-first schema validation library.
@trustless-work/escrow β SDK for handling escrow logic in decentralized apps.
@tanstack/react-query β Data-fetching and caching library for React.
@tanstack/react-query-devtools β Developer tools for inspecting React Query state.
@hookform/resolvers β Resolvers for integrating validation libraries (like Zod) with React Hook Form.
@creit.tech/stellar-wallets-kit β Wallet connection toolkit for Stellar blockchain.
axios β Promise-based HTTP client for making API requests.
@tanstack/react-table β Headless table library for building flexible data grids.
react-day-picker β Lightweight date picker component for React.
recharts β Charting library built with React and D3.
Links
Setup
Configure Environment
The next step is to configure the Trustless Work provider. You need to configure the following:
baseURL: Trustless Work API URL. UsemainNetordevelopment.apiKey: Authorization provided by our dApp to use the API.
Create a provider that wraps your app with TrustlessWorkConfig.
Read-only flows can work without an API key. Write flows (deploy/fund/release/β¦) require a valid key.
Wrap your app with providers
You must wrap your app with these providers:
ReactQueryClientProviderTrustlessWorkProviderWalletProvider
If you want to use some blocks, you should wrap your app with their providers. See more in: Dependencies
Now, you are able to interact with Trustless Work blocks.
Last updated
Was this helpful?