# @mkl3/sdk

Latest version **1.0.32** (published 2024-08-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mkl3/sdk
pnpm add @mkl3/sdk
yarn add @mkl3/sdk
bun add @mkl3/sdk
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.32 |
| Published | 2024-08-22 |
| First published | 2023-04-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 328.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Maintainers | theomerkle |

## Links

- npm: https://www.npmjs.com/package/@mkl3/sdk
- Repository: https://github.com/merkle3/merkle-sdk-ts
- Homepage: https://github.com/merkle3/merkle-sdk-ts#readme
- Issues: https://github.com/merkle3/merkle-sdk-ts/issues
- npm.io page: https://npm.io/package/@mkl3/sdk

## Dependencies (5)

- [ws](https://npm.io/package/ws.md) ^8.13.0
- [ethers](https://npm.io/package/ethers.md) ^6.3.0
- [@types/ws](https://npm.io/package/@types/ws.md) ^8.5.4
- [node-fetch](https://npm.io/package/node-fetch.md) 2.6.7
- [@types/node-fetch](https://npm.io/package/@types/node-fetch.md) ^2.6.3

## Recent versions

- 1.0.32 (latest) — 2024-08-22
- 1.0.31 — 2024-03-17
- 1.0.30 — 2024-03-15
- 1.0.29 — 2024-03-12
- 1.0.28 — 2024-03-07
- 1.0.27 — 2024-03-04
- 1.0.26 — 2024-01-26
- 1.0.25 — 2023-11-17
- 1.0.24 — 2023-11-05
- 1.0.23 — 2023-10-26
- 1.0.22 — 2023-10-24
- 1.0.21 — 2023-10-24
- 1.0.20 — 2023-10-19
- 1.0.19 — 2023-10-09
- 1.0.17 — 2023-09-12
- … 17 more at https://npm.io/package/@mkl3/sdk/versions

## README

<img src="public/merkle-large.png" width="80" height="80" style="border-radius: 4px"/>

**merkle is building crypto infrastructure**. [Join us on discord](https://discord.gg/Q9Dc7jVX6c).

# merkle SDK

The merkle SDK is a great way to access our products.

## Install

Install the merkle SDK package:

```
yarn add @mkl3/sdk
```

## Features

### Stream auctions

Stream auctions from merkle's private pool. [Learn more](https://docs.merkle.io/private-pool/what-is-merkle-private-pool)

```typescript
import Merkle from "@mkl3/sdk";

const merkle = new Merkle("<API KEY>"); // optional, get one at mbs.merkle.io

// stream auctions and make bids
merkle.pool.auctions().on("auction", (auction) => {
  console.log("new auction: ", auction);

  // construct a backrun
  const backrun = "0x....";

  // make a bid
  merkle.pool.bid(auction.transaction.hash, backrun);
});

// send new transactions for auctions
merkle.pool.send(tx, {
  // a signed ethers.Transaction
  // optional parameters
  feeRecipient: "0x", // where to receive the bid revenue, defaults to the tx.from
  hints: [], // what hints to provide to searchers, see https://docs.merkle.io/private-pool/privacy
});
```

### Stream public mempool transactions

Stream public mempool transactions from merkle's ultra fast network on Ethereum, Polygon and BSC. [Learn more](https://docs.merkle.io/transaction-stream/what-is-merkle-transaction-stream)

Typescript:

```typescript
import Merkle from "@mkl3/sdk";

const merkle = new Merkle("<API KEY>"); // get one at mbs.merkle.io

// stream ethereum transactions
merkle.transactions.stream().on("transaction", (tx) => {
  console.log("tx from: ", tx.from);
});

// stream polygon transactions
merkle.transactions.stream(137).on("transaction", (tx) => {
  console.log("tx from: ", tx.from);
});

// stream bnb transactions
merkle.transactions.stream(56).on("transaction", (tx) => {
  console.log("tx from: ", tx.from);
});
```

Javascript:

```javascript
const Merkle = require("@mkl3/sdk");

const merkle = new Merkle("<API KEY>"); //get one at mbs.merkle.io

// stream ethereum transactions
merkle.transactions.stream().on("transaction", (tx) => {
  console.log("tx from: ", tx.from);
});

// stream polygon transactions
merkle.transactions.stream(137).on("transaction", (tx) => {
  console.log("tx from: ", tx.from);
});

// stream bnb transactions
merkle.transactions.stream(56).on("transaction", (tx) => {
  console.log("tx from: ", tx.from);
});
```

### Transaction tracing

Know exactly when and where a transaction was broadcasted. [Learn more](https://docs.merkle.io/transaction-network/tracing)

```typescript
import Merkle from "@mkl3/sdk";

const merkle = new Merkle("<API KEY>"); //get one at mbs.merkle.io

// trace a transaction with its hash
merkle.transactions.trace("0x...").then((trace) => {
  console.log("trace: ", trace);
});
```

---
_Source: https://npm.io/package/@mkl3/sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
