tenderly

package
v0.0.0-...-948650a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package tenderly provides convenience wrappers to work with Tenderly's REST API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	APIKey string
	APIURL string
}

Config contains the configuration for the Tenderly wrapper.

func NewFromSecret

func NewFromSecret(ctx context.Context, apiKey *secrets.Secret) (*Config, error)

NewFromSecret creates a new Tenderly config from a secret API key.

func (*Config) DeleteFork

func (cfg *Config) DeleteFork(ctx context.Context, projectSlug, forkID string) error

DeleteFork deletes a fork on Tenderly.

func (*Config) NewFork

func (cfg *Config) NewFork(ctx context.Context, params NewForkParams) (*Fork, error)

NewFork creates a new fork on Tenderly.

func (*Config) NewForkClient

func (cfg *Config) NewForkClient(ctx context.Context, params NewForkParams) (*ethclient.Client, func() error, *Fork, error)

NewForkClientWithCleanup is a convenience wrapper that creates a new fork on Tenderly and returns an ethclient.Client connected to it together with a cleanup function to remove the fork again.

type Fork

type Fork struct {
	ID          string      `json:"id"`
	Name        string      `json:"name"`
	Description string      `json:"description"`
	NetworkID   string      `json:"network_id"`
	BlockNumber string      `json:"block_number"`
	Details     ForkDetails `json:"details"`
	// hex string of private keys for pre-funded accounts
	Accounts map[common.Address]string `json:"accounts"`
	NodeURL  string                    `json:"json_rpc_url"`
}

Fork is the fork created by the Tenderly API.

type ForkDetails

type ForkDetails struct {
	ChainConfig ForkDetailsChainConfig `json:"chain_config"`
}

ForkDetails is the details of the fork created by the Tenderly API.

type ForkDetailsChainConfig

type ForkDetailsChainConfig struct {
	ChainID string `json:"chain_id"`
}

ForkDetailsChainConfig is the chain config of the fork created by the Tenderly API.

type NewForkParams

type NewForkParams struct {
	// ProjectSlug is the slug of the project to create the fork in.
	ProjectSlug string `json:"-"`
	// Name is the name of the fork.
	Name string `json:"name"`
	// Description is the description of the fork.
	Description string `json:"description"`
	// NetworkID identifies the network to be forked.
	NetworkID uint64 `json:"network_id"`
	// BlockNumber is the block number at which the network is forked.
	BlockNumber uint64 `json:"block_number"`
}

NewForkParams are the parameters to create a new Tenderly fork using `Config.NewFork`.

type NewForkResponse

type NewForkResponse struct {
	Fork Fork `json:"fork"`
}

NewForkResponse is the response from the Tenderly API when a new fork is created.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL