Giter Club home page Giter Club logo

merkle-sdk-tsjircs's Introduction

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

merkle-sdk-tsjircs's People

Contributors

theo- avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.