Getting Started
Overview
Links
Setup
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
npm install @trustless-work/blocksyarn add @trustless-work/blocksnpx trustless-work init"use client"; // make sure this is a client component
import React from "react";
import {
// development environment = "https://dev.api.trustlesswork.com"
development,
// mainnet environment = "https://api.trustlesswork.com"
mainNet,
TrustlessWorkConfig,
} from "@trustless-work/escrow";
interface TrustlessWorkProviderProps {
children: React.ReactNode;
}
export function TrustlessWorkProvider({
children,
}: TrustlessWorkProviderProps) {
/**
* Get the API key from the environment variables
*/
const apiKey = process.env.NEXT_PUBLIC_API_KEY || "";
return (
<TrustlessWorkConfig baseURL={development} apiKey={apiKey}>
{children}
</TrustlessWorkConfig>
);
}
npx trustless-work add wallet-kitimport { WalletButton } from "@/components/tw-blocks/wallet-kit/WalletButtons";
export default function HomePage() {
return (
<div className="container mx-auto py-8">
<div className="flex justify-between items-center mb-8">
<h1 className="text-3xl font-bold">My Escrows</h1>
<WalletButton />
</div>
</div>
);
}