Giter Site home page Giter Site logo

tenderly / tenderly-sdk Goto Github PK

View Code? Open in Web Editor NEW
35.0 4.0 8.0 1.23 MB

With the Tenderly SDK, you can simulate individual transactions or bundles of transactions, manage contracts and wallets, and verify contracts from your code.

Home Page: https://docs.tenderly.co/tenderly-sdk

License: MIT License

JavaScript 0.63% TypeScript 99.23% Shell 0.14%
sdk tenderly web3

tenderly-sdk's Introduction

Tenderly SDK

SDK for working with your favorite Web3 development platform

License npm Twitter Github

Table of contents

Introduction

The Tenderly SDK provides an easy-to-use interface for interacting with the Tenderly platform.

It allows you to simulate transactions, simulate transaction bundles, manage contracts and wallets, and verify smart contracts from your code. The SDK is particularly useful for blockchain developers who want to integrate Tenderly's powerful tools into their dapp or development workflow.

List of supported networks can be found here

Documentation

Full documentation with example snippets here:
Tenderly SDK docs

Quick start

Installation

Available on npm as tenderly-sdk npm

npm i @tenderly/sdk

yarn

yarn add @tenderly/sdk

pnpm

pnpm add @tenderly/sdk

Quick start

Instantiate a new tenderly instance with your project details. We highly recommend using environment variables for sensitive data such as access keys during your local development!

import { Tenderly, Network } from '@tenderly/sdk';

const tenderlyInstance = new Tenderly({
  accessKey: process.env.TENDERLY_ACCESS_KEY,
  accountName: process.env.TENDERLY_ACCOUNT_NAME,
  projectName: process.env.TENDERLY_PROJECT_NAME,
  network: Network.MAINNET,
});

Fetch project contracts

const contracts = await tenderlyInstance.contracts.getAll();

console.log(contracts.map(contract => contract.address).join(', '));
// 0x63456...5689, 0x54j2...23890, 0x211e...289n

Examples

Contributors

License

MIT

tenderly-sdk's People

Contributors

beruda avatar dule-git avatar github-actions[bot] avatar igorpetkovic avatar maleksandar avatar marcusmolchany avatar nvitorovic avatar pajcho avatar saqlain1020 avatar zdenkolini avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

tenderly-sdk's Issues

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

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

TransactionParameters type does not have `save` or `save_if_fails`

We're trying to use the SDK to simulate a transaction bundle and save the results to the dashboard, and it appears that the save and save_if_fails options are not available in the SDK.

TransactionParameters types where I would expect save and save_if_fails: https://github.com/Tenderly/tenderly-sdk/blob/master/lib/executors/Simulator.types.ts#L3-L13

Where I would expect save and save_if_fails for tx simulation bundles: https://github.com/Tenderly/tenderly-sdk/blob/master/lib/executors/Simulator.ts#L128-L138

Where I would expect save and save_if_fails for an individual tx simulation: https://github.com/Tenderly/tenderly-sdk/blob/master/lib/executors/Simulator.ts#L153-L163

We're happy to make this change if these are the right places to update.

Support Taraxa Chain in Tenderly

Hi guys! We at Taraxa are looking into connecting to the most relevant EVM development tools as the first EVM-compatible BlockDAG. Check us out at www.taraxa.io.

I'd be looking for some support material and would be glad to do the hands-on integration if you guys have docs on it.

I reached out via your webpage but got no response yet, so trying my luck here.
Cheers ๐Ÿ‘‹๐Ÿผ

contract add: internal_server_error

Hi, I'm trying to add contracts to my tenderly project, but I keep getting server error:

Tenderly: ApiError: Internal server error
    at Function.handle (contractsnode_modules\@tenderly\sdk\dist\index.js:142:13)
    at contractsnode_modules\@tenderly\sdk\dist\index.js:247:46
    at Array.forEach (<anonymous>)
    at handleError (contractsnode_modules\@tenderly\sdk\dist\index.js:247:17)
    at ContractRepository.<anonymous> (contractsnode_modules\@tenderly\sdk\dist\index.js:347:9)
    at Generator.throw (<anonymous>)
    at rejected (contractsnode_modules\@tenderly\sdk\dist\index.js:74:29)
    at processTicksAndRejections (node:internal/process/task_queues:95:5) {
  id: '50cebf37-28ec-465a-a9d1-b3b5f517df18',
  slug: 'internal_server_error',
  data: undefined,
  status: 500
}
  • "@tenderly/sdk": "^0.2.1"
  • "hardhat": "2.19.4"

Example with OZ / imports

Hello,

Would you be able to provide an example of verifying a contract that has multiple imports, including some OpenZeppelin imports?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.