1.0.31 • Published 2 months ago

@mkl3/sdk v1.0.31

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

merkle is building crypto infrastructure. Join us on discord.

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

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

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:

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

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);
});
1.0.31

2 months ago

1.0.30

2 months ago

1.0.29

2 months ago

1.0.28

2 months ago

1.0.27

2 months ago

1.0.26

4 months ago

1.0.19

7 months ago

1.0.17

8 months ago

1.0.16

8 months ago

1.0.22

7 months ago

1.0.21

7 months ago

1.0.20

7 months ago

1.0.25

6 months ago

1.0.24

6 months ago

1.0.23

7 months ago

1.0.15

8 months ago

1.0.14

8 months ago

1.0.13

8 months ago

1.0.12

9 months ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.5

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago