API Authentication

You can read more about API authentication here: Authenticating with the Tenderly API.

<aside> ℹ️ The rest of this document assumes you have authenticated with one of the two previously mentioned methods.


To start off you'll need to get your account_id and project_slug. To do so, simply navigate to the dashboard and look at the address bar:


1. Creating an environment

After you have that, you need to create an environment where the states will be stored. You can do that by calling the following endpoint:

Link: https://api.tenderly.co/api/v1/account/{{account_id}}/project/{{project_slug}}/fork

Request type: POST


    "network_id": "1",
		"block_number": 15107216,
    "transaction_index": 1,
		"initial_balance": 10000

Payload explanation



In the response we notice 2 main entities:

  1. simulation_fork From this you will need to store the id field.
  2. root_transaction This will not be relevant to the Metamast use case.

2. Connecting to Metamask