1.0.3 • Published 12 months ago

sv-evm-simulator v1.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

SV-EVM-Simulator License: MIT

Simulate a transaction on the current state of the Ethereum mainnet or any other EVM based network and view the outcomes.

Prerequisites

Install dependencies

Assuming you have Node.js installed, run the following command to install the required packages.

$  npm install sv-evm-simulator

Usage

  1. Install the sv-evm-simulator packages and import the EvmSimulator.
$  var EvmSimulator =  require("./sv-evm-simulator");
  1. Verify the validity of the RPC_URL before creating a simulator instance with that URL.
$  let isValid = await EvmSimulator.utils.isRpcUrlValid(url);
  1. If the URL is valid, create a new simulator instance using the createSimulator function.
$  let  simulator  =  new EvmSimulator.createSimulator(rpc_url, port);
  1. Next, create a new transaction using the createTransaction function, providing the receiver_address and amount.
// Ex: simulator.createTransaction("0x234471783F04Ee0F6844dA5120e43dB6d9968AD4", 5);
$  let txInfo = await simulator.createTransaction(receiver_address, amount);
  1. Finally, you can access the details of the transaction using the txInfo variable.
1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago