open-index/open-npm huggingface dataset:
npm package: @polymarket/relayer-client
Description: Client for Polymarket relayers
Latest version: 4.1.0

## relayer-client

### Install

```bash
npm install @polymarket/relayer-client
```

### Usage

```ts
import { createWalletClient, Hex, http } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { polygon } from "viem/chains";
import { RelayClient } from "@polymarket/relayer-client";

const relayerUrl = `${process.env.POLYMARKET_RELAYER_URL}`;
const chainId = parseInt(`${process.env.CHAIN_ID}`);

const pk = privateKeyToAccount(`${process.env.PK}` as Hex);
const wallet = createWalletClient({
  account: pk,
  chain: polygon,
  transport: http(`${process.env.RPC_URL}`),
});

// Initialize Relay Client
const client = new RelayClient(relayerUrl, chainId, wallet);
```