merkle

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeDel added in v0.20.0

func MakeDel(ctx context.Context, url string, apiKey string, body interface{}, resp interface{}) error

func MakeGet added in v0.20.0

func MakeGet(ctx context.Context, url string, apiKey string, resp interface{}) error

func MakePost added in v0.20.0

func MakePost(ctx context.Context, url string, apiKey string, body interface{}, resp interface{}) error

func SendRawBid added in v0.29.0

func SendRawBid(hash string, txs []string) (string, error)

Types

type AccountParameters added in v0.20.0

type AccountParameters struct {
	Nonce   *int `json:"nonce,omitempty"`
	Balance *int `json:"balance,omitempty"`
}

type Auction

type Auction struct {
	Id           string
	FeeRecipient string
	ClosesAt     time.Time
	ChainId      int64
	CreatedAt    time.Time
	Connection   *websocket.Conn

	Transaction *AuctionTransaction
}

func (*Auction) SendBid

func (a *Auction) SendBid(tx types.Transaction) (string, error)

type AuctionTransaction

type AuctionTransaction struct {
	Hash  common.Hash
	From  common.Address
	To    common.Address
	Value *big.Int
	Data  []byte
	Gas   uint64
}

type BigInt added in v0.20.0

type BigInt struct {
	big.Int
}

func (BigInt) MarshalJSON added in v0.20.0

func (b BigInt) MarshalJSON() ([]byte, error)

func (*BigInt) UnmarshalJSON added in v0.20.0

func (b *BigInt) UnmarshalJSON(p []byte) error

type BuilderSDK

type BuilderSDK struct {
	// contains filtered or unexported fields
}

func NewBuilderSDK

func NewBuilderSDK(sdk *MerkleSDK) *BuilderSDK

type BundleCall added in v0.20.0

type BundleCall struct {
	From      string                   `json:"from,omitempty"`
	To        string                   `json:"to,omitempty"`
	Value     string                   `json:"value,omitempty"`
	Nonce     int64                    `json:"nonce,omitempty"`
	Data      string                   `json:"data,omitempty"`
	GasLimit  int64                    `json:"gasLimit,omitempty"`
	Overrides *StateOverrideParameters `json:"overrides,omitempty"`
}

type BundleParams

type BundleParams struct {
	Txs         []string `json:"txs"`
	BlockNumber string   `json:"blockNumber"`
}

type ErrorDetails added in v0.20.0

type ErrorDetails struct {
	Type    string `json:"type"`
	Message string `json:"message"`
}

type InternalTransfer added in v0.20.0

type InternalTransfer struct {
	From   string  `json:"from"`
	To     string  `json:"to"`
	Amount *BigInt `json:"amount"`
}

type Log added in v0.20.0

type Log struct {
	Address string   `json:"address"`
	Topics  []string `json:"topics"`
	Data    string   `json:"data"`
}

type MerkleChainId

type MerkleChainId int32
const (
	EthereumMainnet MerkleChainId = 1
	PolygonMainnet  MerkleChainId = 137
	BnbMainnet      MerkleChainId = 56
)

type MerkleSDK

type MerkleSDK struct {
	ApiKey string
	// contains filtered or unexported fields
}

func New

func New() *MerkleSDK

func (*MerkleSDK) Builder

func (m *MerkleSDK) Builder() *BuilderSDK

func (*MerkleSDK) GetApiKey

func (m *MerkleSDK) GetApiKey() string

get the api key

func (*MerkleSDK) Overwatch added in v0.20.0

func (m *MerkleSDK) Overwatch() *OverwatchAPI

func (*MerkleSDK) Pool

func (m *MerkleSDK) Pool() *PrivatePool

func (*MerkleSDK) SetApiKey

func (m *MerkleSDK) SetApiKey(apiKey string)

func (*MerkleSDK) Simulation added in v0.20.0

func (m *MerkleSDK) Simulation() *SimulationAPI

func (*MerkleSDK) Transactions

func (m *MerkleSDK) Transactions() *TransactionStream

type MerkleTrace added in v0.18.0

type MerkleTrace struct {
	Hash        string        `json:"hash"`
	FirstSeenAt time.Time     `json:"firstSeenAt"`
	ChainId     MerkleChainId `json:"chainId"`
	Trace       []Observation `json:"trace"`
	TxData      string        `json:"txData"`
}

type NewTransactionOptions added in v0.19.0

type NewTransactionOptions struct {
	Transaction  *types.Transaction
	FeeRecipient common.Address

	// optionally, a source
	Source string

	// prevent reverts
	PreventRevert bool

	// hints
	Hints []string

	// privacy profile
	PrivacyProfile string
}

type Observation added in v0.18.0

type Observation struct {
	Time   time.Time
	Origin string
}

type OverwatchAPI added in v0.20.0

type OverwatchAPI struct {
	// contains filtered or unexported fields
}

func NewOverwatchAPI added in v0.20.0

func NewOverwatchAPI(sdk *MerkleSDK) *OverwatchAPI

func (*OverwatchAPI) Declare added in v0.20.0

func (o *OverwatchAPI) Declare(ctx context.Context, chainId MerkleChainId, hash string) error

declare hash

func (*OverwatchAPI) UnwatchAddress added in v0.20.0

func (o *OverwatchAPI) UnwatchAddress(ctx context.Context, address string) error

func (*OverwatchAPI) WatchAddress added in v0.20.0

func (o *OverwatchAPI) WatchAddress(ctx context.Context, address string) error

type PrivatePool

type PrivatePool struct {
	// contains filtered or unexported fields
}

func NewPrivatePool

func NewPrivatePool(sdk *MerkleSDK) *PrivatePool

func (*PrivatePool) Auctions

func (p *PrivatePool) Auctions() (chan *Auction, chan error)

func (*PrivatePool) Send added in v0.19.0

func (p *PrivatePool) Send(options *NewTransactionOptions) error

func (*PrivatePool) SendBid added in v0.29.0

func (p *PrivatePool) SendBid(txHash string, tx *types.Transaction) (string, error)

type RawAuction

type RawAuction struct {
	Id           string `json:"id"`
	FeeRecipient string `json:"fee_recipient"`
	ClosesAtUnix int64  `json:"closes_at_unix"`
	ChainId      int64  `json:"chain_id"`
	CreatedAt    int64  `json:"created_at_unix"`
	Transaction  struct {
		Data  string `json:"data"`
		From  string `json:"from"`
		Gas   int64  `json:"gas"`
		Hash  string `json:"hash"`
		To    string `json:"to"`
		Value string `json:"value"`
	} `json:"transaction"`
}

type RawRpcResponse added in v0.20.0

type RawRpcResponse struct {
	Jsonrpc string `json:"jsonrpc"`
	Result  string `json:"result"`
}

type RelaySubmitRequest

type RelaySubmitRequest struct {
	Method  string         `json:"method"`
	Params  []BundleParams `json:"params"`
	Jsonrpc string         `json:"jsonrpc"`
}

type SimulationAPI added in v0.20.0

type SimulationAPI struct {
	// contains filtered or unexported fields
}

func NewSimulationAPI added in v0.20.0

func NewSimulationAPI(sdk *MerkleSDK) *SimulationAPI

func (*SimulationAPI) SimulateBundle added in v0.20.0

func (s *SimulationAPI) SimulateBundle(ctx context.Context, bundle *SimulationBundle) (*SimulationResult, error)

type SimulationBundle added in v0.20.0

type SimulationBundle struct {
	ChainId     MerkleChainId            `json:"chainId"`
	Calls       []BundleCall             `json:"calls"`
	BlockNumber *int                     `json:"blockNumber,omitempty"`
	Overrides   *StateOverrideParameters `json:"overrides,omitempty"`
}

type SimulationCallResult added in v0.20.0

type SimulationCallResult struct {
	Logs              []Log              `json:"logs"`
	GasUsed           *BigInt            `json:"gasUsed"`
	Result            string             `json:"result"`
	AddressCreated    *string            `json:"addressCreated,omitempty"`
	Status            int                `json:"status"`
	Error             *ErrorDetails      `json:"error,omitempty"`
	InternalTransfers []InternalTransfer `json:"internalTransfers,omitempty"`
}

type SimulationResult added in v0.20.0

type SimulationResult struct {
	ChainId     int                    `json:"chainId"`
	BlockNumber *BigInt                `json:"blockNumber"`
	ProcessTime int                    `json:"processTime"`
	Calls       []SimulationCallResult `json:"calls"`
}

type StateOverrideParameters added in v0.20.0

type StateOverrideParameters struct {
	Accounts      map[string]*AccountParameters `json:"accounts,omitempty"`
	ContractCodes map[string]string             `json:"contractCodes,omitempty"`
	Storage       map[string]map[string]string  `json:"storage,omitempty"`
}

type TransactionStream

type TransactionStream struct {
	// contains filtered or unexported fields
}

func NewTransactionStream

func NewTransactionStream(sdk *MerkleSDK) *TransactionStream

func (*TransactionStream) Inject added in v0.25.0

func (t *TransactionStream) Inject(chainId MerkleChainId, tx *types.Transaction) error

inject a tx

func (*TransactionStream) Stream

func (t *TransactionStream) Stream(chainId MerkleChainId) (chan *types.Transaction, chan error)

func (*TransactionStream) Trace added in v0.18.0

func (t *TransactionStream) Trace(hash string) (*MerkleTrace, error)

trace a transaction

Jump to

Keyboard shortcuts

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