Learn how to build on the decentralized web
NFTs
Create pier client

Create tRPC client

pier backend is written using tRPC (opens in a new tab) framework. You can create a client using @trpc/client.

First install dependencies:

npm i @pier-wallet/relayer @pier-wallet/utils @trpc/client ethers@^5.7.2 decimal.js

Then create a client:

import type { Trpc10AppRouter } from "@pier-wallet/relayer";
import { trpcTransformer } from "@pier-wallet/utils";
import {
  CreateTRPCProxyClient,
  createTRPCProxyClient,
  httpBatchLink,
} from "@trpc/client";
import { BigNumber } from "ethers";
import Decimal from "decimal.js";
 
const client = createTRPCProxyClient<Trpc10AppRouter>({
  transformer: trpcTransformer({ BigNumber, Decimal }),
  links: [
    httpBatchLink({
      url: `https://nobank-relayer-production.herokuapp.com/trpc10`,
    }),
  ],
});