@hypurrquant/defi-cli 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -1012,9 +1012,11 @@ var DEFAULT_PRIORITY_FEE_WEI = 100000000n;
1012
1012
  var Executor = class _Executor {
1013
1013
  dryRun;
1014
1014
  rpcUrl;
1015
- constructor(broadcast, rpcUrl) {
1015
+ explorerUrl;
1016
+ constructor(broadcast, rpcUrl, explorerUrl) {
1016
1017
  this.dryRun = !broadcast;
1017
1018
  this.rpcUrl = rpcUrl;
1019
+ this.explorerUrl = explorerUrl;
1018
1020
  }
1019
1021
  /** Apply 20% buffer to a gas estimate */
1020
1022
  static applyGasBuffer(gas) {
@@ -1149,7 +1151,10 @@ var Executor = class _Executor {
1149
1151
  maxFeePerGas: maxFeePerGas > 0n ? maxFeePerGas : void 0,
1150
1152
  maxPriorityFeePerGas: maxPriorityFeePerGas > 0n ? maxPriorityFeePerGas : void 0
1151
1153
  });
1154
+ const txUrl = this.explorerUrl ? `${this.explorerUrl}/tx/${txHash}` : void 0;
1152
1155
  process.stderr.write(`Transaction sent: ${txHash}
1156
+ `);
1157
+ if (txUrl) process.stderr.write(`Explorer: ${txUrl}
1153
1158
  `);
1154
1159
  process.stderr.write("Waiting for confirmation...\n");
1155
1160
  const receipt = await publicClient.waitForTransactionReceipt({ hash: txHash });
@@ -1165,6 +1170,7 @@ var Executor = class _Executor {
1165
1170
  block_number: receipt.blockNumber?.toString(),
1166
1171
  gas_limit: gasLimit.toString(),
1167
1172
  gas_used: receipt.gasUsed?.toString(),
1173
+ explorer_url: txUrl,
1168
1174
  mode: "broadcast"
1169
1175
  }
1170
1176
  };
@@ -8235,7 +8241,7 @@ function makeExecutor() {
8235
8241
  const opts = program.opts();
8236
8242
  const registry = Registry.loadEmbedded();
8237
8243
  const chain = registry.getChain(opts.chain ?? "hyperevm");
8238
- return new Executor(!!opts.broadcast, chain.effectiveRpcUrl());
8244
+ return new Executor(!!opts.broadcast, chain.effectiveRpcUrl(), chain.explorer_url);
8239
8245
  }
8240
8246
  registerStatus(program, getOutputMode);
8241
8247
  registerSchema(program, getOutputMode);