flashbots-cli
Version:
Flashbots CLI tool.
39 lines (38 loc) • 1.81 kB
JavaScript
;
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 GetConflictingBundle extends core_1.Command {
async catch(e) {
(0, error_1.handleGenericError)(e, this);
}
async run() {
const { args, flags } = await this.parse(GetConflictingBundle);
const flashbotsProvider = await (0, flashbots_1.getFlashbotsProvider)();
let res;
if (flags['ignore-gas-pricing']) {
res = flashbotsProvider.getConflictingBundleWithoutGasPricing(JSON.parse(args.bundle_txs), parseInt(args.target_block));
}
else {
res = flashbotsProvider.getConflictingBundle(JSON.parse(args.bundle_txs), parseInt(args.target_block));
}
this.log(JSON.stringify(res));
}
}
exports.default = GetConflictingBundle;
GetConflictingBundle.description = 'Get information about competing bundles.';
GetConflictingBundle.examples = [
`# Get conflicting bundles (if any)
<%= config.bin %> <%= command.id %> '["0x02f8d37c496de...", "0x02f8d38a7bf47..."]' 14797973`,
`# Get conflicting bundles (if any) and skip gas pricing calculations
<%= config.bin %> <%= command.id %> -g '["0x02f8d37c496de...", "0x02f8d38a7bf47..."]' 14797973`,
];
GetConflictingBundle.flags = {
'ignore-gas-pricing': core_1.Flags.boolean({ char: 'g', description: "Gets conflicting bundle(s) without calculating gas pricing data" }),
};
GetConflictingBundle.args = [
{ name: 'bundle_txs', description: 'JSON string-encoded array of raw signed transactions (0x-prefixed)', required: true },
{ name: 'target_block', description: 'Block in which the conflicting bundle was mined', required: true },
];