Tenderly / tenderly-sdk

With the Tenderly SDK, you can simulate individual transactions or bundles of transactions, manage contracts and wallets, and verify contracts from your code.
https://docs.tenderly.co/tenderly-sdk
MIT License
41 stars 12 forks source link

Add method for `/simulations/:id/share` endpoint in Simulator.ts #100

Open marcusmolchany opened 1 year ago

marcusmolchany commented 1 year ago

from docs:

  // Make the simulation publicly accessible
  if (parsedResponse?.simulation?.id) {
    await fetch(
      `https://api.tenderly.co/api/v1/account/${credentials.accountId}/project/${credentials.projectId}/simulations/${parsedResponse.simulation.id}/share`,
      {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
          'X-Access-Key': credentials.accessToken,
        },
      },
    );
  }

endpoint detailed in https://docs.tenderly.co/simulations-and-forks/integration-guides/how-to-add-transaction-preview-to-a-metamask-snap-using-tenderly-simulation-api#simulation