UNPKG

flashbots-cli

Version:
28 lines (27 loc) 1.15 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const core_1 = require("@oclif/core"); // lib const error_1 = require("../lib/error"); const flashbots_1 = require("../lib/flashbots"); class GetBundleStats extends core_1.Command { async catch(e) { (0, error_1.handleGenericError)(e, this); } async run() { const { args } = await this.parse(GetBundleStats); const flashbotsProvider = await (0, flashbots_1.getFlashbotsProvider)(); const res = await flashbotsProvider.getBundleStats(args.bundle_hash, args.target_block); this.log(JSON.stringify(res)); } } exports.default = GetBundleStats; GetBundleStats.description = 'Get info about a bundle.'; GetBundleStats.examples = [ `# Get bundle stats for block 14798035 <%= config.bin %> <%= command.id %> 0x47b1f5ea1b924acd88459b2e4f0ccfd2326ca0a134b982c1bc4a97e9002ff051 14798035`, ]; GetBundleStats.args = [ { name: 'bundle_hash', description: "Bundle hash returned by simulateBundle", required: true }, { name: 'target_block', description: "Block in which the bundle was targeted/executed", required: true }, ];