Introduction
The Tenderly SDK provides an easy-to-use interface for interacting with Tenderly via its API. Key features of the SDK include:Installation
The Tenderly SDK is available as an npm package. Install it by running the following command in your project directory: npmexample
example
example
Quickstart
The example below shows you how to do a simple simulation in less than 5 minutes. To learn more about the concepts behind the SDK, see Tenderly SDK FAQs.Initializing the SDK
To use the Tenderly SDK, you must first import the necessary libraries and create a new instance of theTenderly class. This is where you pass in your Tenderly configuration details.
The configuration object should include your account name, project name, access key, and network.
example.jsx
example.jsx
The list of supported networks can be
found here.
How to get the account name, project slug, and secret key
Follow these step-by-step guides to obtain the necessary configuration details:- How to obtain the account name
- How to obtain the organization name
- How to obtain the project slug/name
- How to find, create, and manage API keys
Example transaction simulation
The SDK provides aSimulator class for simulating transactions. To run a simulation, call the simulateTransaction method in the simulator namespace on the Tenderly instance:
example.jsx
example.js