1.0.32 • Published 1 year ago
@mkl3/sdk v1.0.32
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/sdkFeatures
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.32
1 year ago
1.0.31
2 years ago
1.0.30
2 years ago
1.0.29
2 years ago
1.0.28
2 years ago
1.0.27
2 years ago
1.0.26
2 years ago
1.0.19
2 years ago
1.0.17
2 years ago
1.0.16
2 years ago
1.0.22
2 years ago
1.0.21
2 years ago
1.0.20
2 years ago
1.0.25
2 years ago
1.0.24
2 years ago
1.0.23
2 years ago
1.0.15
2 years ago
1.0.14
2 years ago
1.0.13
2 years ago
1.0.12
2 years ago
1.0.11
3 years ago
1.0.10
3 years ago
1.0.9
3 years ago
1.0.8
3 years ago
1.0.5
3 years ago
1.0.7
3 years ago
1.0.6
3 years ago
1.0.4
3 years ago
1.0.3
3 years ago
1.0.2
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago