Socket
Socket
Sign inDemoInstall

@flashbots/matchmaker-ts

Package Overview
Dependencies
22
Maintainers
3
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.7.0 to 0.7.1

7

build/api/mungers.d.ts
import { BundleParams, SimBundleOptions, TransactionOptions } from './interfaces';
/**
* Converts user-specified parameters into parameters for a sendPrivateTransaction call to the Matchmaker API.
* @param signedTx Signed transaction to send.
* @param options Privacy/execution settings for the transaction.
* @param signedTx - Signed transaction to send.
* @param options - Privacy/execution settings for the transaction.
* @returns Single-element array containing params object for sendPrivateTransaction call.

@@ -21,3 +21,3 @@ */

* Converts user-specified parameters into parameters for a mev_sendBundle call to the Matchmaker API.
* @param params Privacy/execution parameters for the bundle
* @param params - Privacy/execution parameters for the bundle
* @returns Single-element array containing params object for sendPrivateTransaction call.

@@ -50,2 +50,3 @@ */

};
/** Convert SimBundleOptions into format required by eth_simBundle. */
export declare function mungeSimBundleOptions(params: SimBundleOptions): {

@@ -52,0 +53,0 @@ parentBlock: string | 0 | undefined;

@@ -6,3 +6,3 @@ "use strict";

* Convert name format of user-specified hints for Matchmaker API requests.
* @param hints Hints specified by the user.
* @param hints - Hints specified by the user.
*/

@@ -21,3 +21,3 @@ const mungeHintPreferences = (hints) => {

* Converts user-specified hints into the array format accepted by the API.
* @param hints Hints specified by the user.
* @param hints - Hints specified by the user.
*/

@@ -31,4 +31,4 @@ const extractSpecifiedHints = (hints) => {

* Converts user-specified parameters into parameters for a sendPrivateTransaction call to the Matchmaker API.
* @param signedTx Signed transaction to send.
* @param options Privacy/execution settings for the transaction.
* @param signedTx - Signed transaction to send.
* @param options - Privacy/execution settings for the transaction.
* @returns Single-element array containing params object for sendPrivateTransaction call.

@@ -53,3 +53,3 @@ */

* Converts user-specified parameters into parameters for a mev_sendBundle call to the Matchmaker API.
* @param params Privacy/execution parameters for the bundle
* @param params - Privacy/execution parameters for the bundle
* @returns Single-element array containing params object for sendPrivateTransaction call.

@@ -66,2 +66,3 @@ */

exports.mungeBundleParams = mungeBundleParams;
/** Convert SimBundleOptions into format required by eth_simBundle. */
function mungeSimBundleOptions(params) {

@@ -68,0 +69,0 @@ return Object.assign(Object.assign({}, params), {

@@ -12,7 +12,11 @@ /** async mutex-guarded variable */

constructor(value?: Array<T>);
/** Pushes a new item to the array. */
push(value: T): Promise<void>;
/** Filter array in-place. */
filter(filterFn: (value: T) => boolean): Promise<void>;
/** Returns true if value is included in the array. */
includes(value: T): Promise<boolean>;
/** Returns length of array. */
length(): Promise<number>;
}
//# sourceMappingURL=async.d.ts.map

@@ -44,2 +44,3 @@ "use strict";

}
/** Pushes a new item to the array. */
push(value) {

@@ -52,2 +53,3 @@ return __awaiter(this, void 0, void 0, function* () {

}
/** Filter array in-place. */
filter(filterFn) {

@@ -60,2 +62,3 @@ return __awaiter(this, void 0, void 0, function* () {

}
/** Returns true if value is included in the array. */
includes(value) {

@@ -67,2 +70,3 @@ return __awaiter(this, void 0, void 0, function* () {

}
/** Returns length of array. */
length() {

@@ -69,0 +73,0 @@ return __awaiter(this, void 0, void 0, function* () {

@@ -46,3 +46,3 @@ "use strict";

pendingTx.mevGasPrice;
if (!pendingTxHashes.includes(pendingTx.hash)) {
if (!(yield pendingTxHashes.includes(pendingTx.hash))) {
// ignore txs we didn't send. they break the bundle (nonce error) bc we're using one account to do everything

@@ -49,0 +49,0 @@ return;

@@ -13,5 +13,5 @@ import { Wallet } from "ethers";

* Standardized RPC request for talking to Bundle API (mev-geth/mev-share) directly.
* @param params JSON data params
* @param method JSON-RPC method
* @param authSigner Wallet used to sign Flashbots auth header; for reputation
* @param params - JSON data params
* @param method - JSON-RPC method
* @param authSigner - Wallet used to sign Flashbots auth header; for reputation
* @returns Parameters of payload to send to Bundle API

@@ -18,0 +18,0 @@ */

@@ -16,5 +16,5 @@ "use strict";

* Standardized RPC request for talking to Bundle API (mev-geth/mev-share) directly.
* @param params JSON data params
* @param method JSON-RPC method
* @param authSigner Wallet used to sign Flashbots auth header; for reputation
* @param params - JSON data params
* @param method - JSON-RPC method
* @param authSigner - Wallet used to sign Flashbots auth header; for reputation
* @returns Parameters of payload to send to Bundle API

@@ -21,0 +21,0 @@ */

@@ -8,4 +8,7 @@ import { Wallet } from 'ethers';

constructor(authSigner: Wallet, network: MatchmakerNetwork);
/** Connect to Flashbots Mainnet Matchmaker. */
static useEthereumMainnet(authSigner: Wallet): Matchmaker;
/** Connect to Flashbots Goerli Matchmaker. */
static useEthereumGoerli(authSigner: Wallet): Matchmaker;
/** Connect to supported networks by specifying a network with a `chainId`. */
static fromNetwork(authSigner: Wallet, { chainId }: {

@@ -16,4 +19,4 @@ chainId: number;

* Sends a POST request to the Matchmaker API and returns the data.
* @param params JSON-RPC params.
* @param method JSON-RPC method.
* @param params - JSON-RPC params.
* @param method - JSON-RPC method.
* @returns Response data from the API request.

@@ -24,4 +27,4 @@ */

* Registers the provided callback to be called when a new MEV-Share transaction is received.
* @param event The event received from the event stream.
* @param callback Async function to process pending tx.
* @param event - The event received from the event stream.
* @param callback - Async function to process pending tx.
*/

@@ -31,4 +34,4 @@ private onTransaction;

* Registers the provided callback to be called when a new MEV-Share bundle is received.
* @param event The event received from the event stream.
* @param callback Async function to process pending tx.
* @param event - The event received from the event stream.
* @param callback - Async function to process pending tx.
*/

@@ -38,4 +41,4 @@ private onBundle;

* Starts listening to the Matchmaker event stream and registers the given callback to be invoked when the given event type is received.
* @param eventType The type of event to listen for. Options specified by StreamEvent enum.
* @param callback The function to call when a new event is received.
* @param eventType - The type of event to listen for. Options specified by StreamEvent enum.
* @param callback - The function to call when a new event is received.
* @returns Stream handler. Call `.close()` on it before terminating your program.

@@ -45,4 +48,4 @@ */

/** Sends a private transaction with MEV hints to the Flashbots Matchmaker.
* @param signedTx Signed transaction to send.
* @param options Tx preferences; hints & block range.
* @param signedTx - Signed transaction to send.
* @param options - Tx preferences; hints & block range.
* @returns Transaction hash.

@@ -52,16 +55,27 @@ */

/** Sends a bundle to mev-share.
* @param params Parameters for the bundle.
* @param params - Parameters for the bundle.
* @returns Array of bundle hashes.
*/
sendBundle(params: BundleParams): Promise<ISendBundleResult>;
private simBundle;
/** Simulates a matched bundle.
/**
* Internal mev_simBundle call.
*
* Note: This may only be used on matched bundles.
* Simulating unmatched bundles (i.e. bundles with a hash present) will throw an error.
* @param params Parameters for the bundle.
* @returns Simulation data object.
* @param params - Parameters for the bundle.
* @param simOptions - Simulation options; override block header data for simulation.
* @returns Simulation result.
*/
private simBundle;
/** Simulates a bundle specified by `params`.
*
* Bundles containing pending transactions (specified by `{hash}` instead of `{tx}` in `params.body`) may
* only be simulated after those transactions have landed on chain. If the bundle contains
* pending transactions, this method will wait for the transactions to land before simulating.
* @param params - Parameters for the bundle.
* @param simOptions - Simulation options; override block header data for simulation.
* @returns Simulation result.
*/
simulateBundle(params: BundleParams, simOptions?: SimBundleOptions): Promise<ISimBundleResult>;
}
//# sourceMappingURL=matchmaker.d.ts.map

@@ -56,8 +56,11 @@ "use strict";

}
/** Connect to Flashbots Mainnet Matchmaker. */
static useEthereumMainnet(authSigner) {
return new Matchmaker(authSigner, networks_1.SupportedNetworks.mainnet);
}
/** Connect to Flashbots Goerli Matchmaker. */
static useEthereumGoerli(authSigner) {
return new Matchmaker(authSigner, networks_1.SupportedNetworks.goerli);
}
/** Connect to supported networks by specifying a network with a `chainId`. */
static fromNetwork(authSigner, { chainId }) {

@@ -69,4 +72,4 @@ const network = networks_1.SupportedNetworks.getNetwork(chainId);

* Sends a POST request to the Matchmaker API and returns the data.
* @param params JSON-RPC params.
* @param method JSON-RPC method.
* @param params - JSON-RPC params.
* @param method - JSON-RPC method.
* @returns Response data from the API request.

@@ -99,4 +102,4 @@ */

* Registers the provided callback to be called when a new MEV-Share transaction is received.
* @param event The event received from the event stream.
* @param callback Async function to process pending tx.
* @param event - The event received from the event stream.
* @param callback - Async function to process pending tx.
*/

@@ -110,4 +113,4 @@ onTransaction(event, callback) {

* Registers the provided callback to be called when a new MEV-Share bundle is received.
* @param event The event received from the event stream.
* @param callback Async function to process pending tx.
* @param event - The event received from the event stream.
* @param callback - Async function to process pending tx.
*/

@@ -121,4 +124,4 @@ onBundle(event, callback) {

* Starts listening to the Matchmaker event stream and registers the given callback to be invoked when the given event type is received.
* @param eventType The type of event to listen for. Options specified by StreamEvent enum.
* @param callback The function to call when a new event is received.
* @param eventType - The type of event to listen for. Options specified by StreamEvent enum.
* @param callback - The function to call when a new event is received.
* @returns Stream handler. Call `.close()` on it before terminating your program.

@@ -147,4 +150,4 @@ */

/** Sends a private transaction with MEV hints to the Flashbots Matchmaker.
* @param signedTx Signed transaction to send.
* @param options Tx preferences; hints & block range.
* @param signedTx - Signed transaction to send.
* @param options - Tx preferences; hints & block range.
* @returns Transaction hash.

@@ -159,3 +162,3 @@ */

/** Sends a bundle to mev-share.
* @param params Parameters for the bundle.
* @param params - Parameters for the bundle.
* @returns Array of bundle hashes.

@@ -168,2 +171,11 @@ */

}
/**
* Internal mev_simBundle call.
*
* Note: This may only be used on matched bundles.
* Simulating unmatched bundles (i.e. bundles with a hash present) will throw an error.
* @param params - Parameters for the bundle.
* @param simOptions - Simulation options; override block header data for simulation.
* @returns Simulation result.
*/
simBundle(params, simOptions) {

@@ -177,8 +189,10 @@ return __awaiter(this, void 0, void 0, function* () {

}
/** Simulates a matched bundle.
/** Simulates a bundle specified by `params`.
*
* Note: This may only be used on matched bundles.
* Simulating unmatched bundles (i.e. bundles with a hash present) will throw an error.
* @param params Parameters for the bundle.
* @returns Simulation data object.
* Bundles containing pending transactions (specified by `{hash}` instead of `{tx}` in `params.body`) may
* only be simulated after those transactions have landed on chain. If the bundle contains
* pending transactions, this method will wait for the transactions to land before simulating.
* @param params - Parameters for the bundle.
* @param simOptions - Simulation options; override block header data for simulation.
* @returns Simulation result.
*/

@@ -185,0 +199,0 @@ simulateBundle(params, simOptions) {

{
"name": "@flashbots/matchmaker-ts",
"version": "0.7.0",
"version": "0.7.1",
"description": "Matchmaker client library for Flashbots mev-share.",

@@ -27,5 +27,2 @@ "main": "build/index.js",

},
"peerDependencies": {
"ethers": "^6.3.0"
},
"scripts": {

@@ -32,0 +29,0 @@ "build": "tsc",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc