open-index/open-npm huggingface dataset:
npm package: @polymarket/builder-signing-sdk
Description: Polymarket SDK for creating builder headers
Latest version: 1.0.0

# builder-signing-sdk

A TypeScript SDK for creating authenticated builder headers


## Installation

```bash
pnpm install @polymarket/builder-signing-sdk
```

## Quick Start

```typescript
import { BuilderSigner } from '@polymarket/builder-signing-sdk';

// Create a builder config for signing

// Local
const builderConfig = new BuilderConfig(
  {
    localBuilderCreds: {
      key: "xxxxxxx-xxx-xxxx-xxx-xxxxxxxxx",
      secret: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
      passphrase: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    },
  },
);

const headers = await builderConfig.generateBuilderHeaders(
  'POST'                  // HTTP method
  '/order',               // API endpoint path
  '{"marketId": "0x123"}' // Request body
);

// Remote
const builderConfig = new BuilderConfig(
  {
    remoteBuilderConfig: {
      url: remoteSignerUrl,
      token: `${process.env.MY_AUTH_TOKEN}`
    }
  },
);

const headers = await builderConfig.generateBuilderHeaders(
  'POST'                  // HTTP method
  '/order',               // API endpoint path
  '{"marketId": "0x123"}' // Request body
);
```
npm package: @polymarket/chainlink-asset-converter
Description: Asset conversion utils powered by Chainlink price feeds
Latest version: 0.0.1

# chainlink-asset-converter

Easy conversion between any of the assets currently supported by [Chainlink's price feeds network](https://data.chain.link/)

## Installation

`yarn add @tomfrench/chainlink-asset-converter`

## Basic Usage

```typescript
import { exchangeRate } from '@tomfrench/chainlink-asset-converter';

// Your Ethereum JSON-RPC endpoint*
const provider = new JsonRpcProvider('https://mainnet.infura.io/v3/ab01ab01ab01ab01ab01ab01')

const ethBtcRatio = await exchangeRate(
  'ETH',
  'BTC',
  provider,
);
```
npm package: @polymarket/ctf-utils
Description: Utilities for handling CTF ERC1155 positions
Latest version: 1.0.1

# Utility to calculate CTF ERC1155 token IDs

```ts
import { calculatePositionId } from "@polymarket/ctf-utils";

const conditionId = "0xbd31dc8a20211944f6b70f31557f1001557b59905b7738480ca09bd4532f84af";
const collateral = "0x2E8DCfE708D44ae2e406a1c02DFE2Fa13012f961";
const outcomeSlotCount = 2;
const outcomeIndex = 0;

// 1343197538147866997676250008839231694243646439454152539053893078719042421992
const positionId = calculatePositionId(conditionId, collateral, outcomeSlotCount, outcomeIndex);

```
npm package: @polymarket/distributor-sdk
Description: SDK to simplify common interactions with the Polymarket Merkle Distributors
Author: Matt Walker
Latest version: 1.0.5

# Polymarket liq mining SDK

This repo contains an SDK that helps interact with our Merkle Distributor contracts for claiming rewards.

### Instantiate the SDK

```typescript
const sdk = new DistributorSdk(
    yourSigner, // signer from ethers or web3, etc.
    137, // this is the chainId for Polygon
    "usdc", // can be "usdc" or "uma"
);
```

> **Note**: Contract addresses and supported chains can be found in `.src/networks`

### Distributor Info:

The information about the amounts, claim index and merkle proofs for each account is stored in `../snapshots/snapshots/`

### To Claim:

You may claim to the proxy address associated with your Polymarket account by using...

```typescript
await sdk.claim(
	claimIndex,
	address,
	amount,
	proof
)
```

You may claim and transfer from your proxy address to the recipient address of your choice using...

```typescript
await sdk.claimAndTransfer(
	claimIndex,
	amount,
	proof,
	proxyAddress,
	recipientAddress,
)
```

You may also populate these transactions and sign them yourself by calling these methods. Note, these will also return a `typeCode: "1"` property as well as `to`, `data` and `value` properties.

```typescript
const sdk = new DistributorSdk(
    yourSigner, // signer from ethers or web3, etc.
    137, // this is the chainId for Polygon
    "usdc", // can be "usdc" or "uma"
);

const claimTx = sdk.populateClaimTx(
	claimIndex,
	address,
	amount,
	proof
);

const claimAndTransferTx = sdk.populateClaimAndTransferTx(
	claimIndex,
	amount,
	proof,
	proxyAddress,
	recipientAddress,
);
```

Tests with more information about how to interact with this SDK can be found in `../merkle-distributor/test/DistributorSdk.spec.ts`