client

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: Apache-2.0 Imports: 30 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// DefaultElapsedTime is the default limit on time
	// spent retrying a fetch.
	DefaultElapsedTime = 1 * time.Minute

	// DefaultRetries is the default number of times to
	// attempt a retry on a failed request.
	DefaultRetries = 10

	// DefaultHTTPTimeout is the default timeout for
	// HTTP requests.
	DefaultHTTPTimeout = 10 * time.Second

	// DefaultIdleConnTimeout is the maximum amount of time an idle
	// (keep-alive) connection will remain idle before closing
	// itself.
	DefaultIdleConnTimeout = 30 * time.Second

	// DefaultMaxConnections limits the number of concurrent
	// connections we will attempt to make. Most OS's have a
	// default connection limit of 128, so we set the default
	// below that.
	DefaultMaxConnections = 120
)
View Source
const (

	// Interesting ERC20 log topics
	Erc20TransferLogTopic   = "Transfer(address,address,uint256)"
	Erc20DepositLogTopic    = "Deposit(address,uint256)"
	Erc20WithdrawalLogTopic = "Withdrawal(address,uint256)"

	UnknownERC20Symbol   = "ERC20_UNKNOWN"
	UnknownERC20Decimals = 0

	UnknownERC721Symbol   = "ERC721_UNKNOWN"
	UnknownERC721Decimals = 0

	ContractAddressMetadata = "contractAddress"
)
View Source
const (
	BalanceOfMethodPrefix      = "0x70a08231000000000000000000000000"
	GenericTransferBytesLength = 68

	TransferFnSignature = "transfer(address,uint256)" // do not include spaces in the string
	Milliseconds        = 1000
)

Variables

View Source
var ContractInfoTokenABI = ContractInfoTokenMetaData.ABI

ContractInfoTokenABI is the input ABI used to generate the binding from. Deprecated: Use ContractInfoTokenMetaData.ABI instead.

View Source
var ContractInfoTokenMetaData = &bind.MetaData{
	ABI: "[{\"type\":\"function\",\"stateMutability\":\"view\",\"outputs\":[{\"type\":\"uint8\",\"name\":\"\",\"internalType\":\"uint8\"}],\"name\":\"decimals\",\"inputs\":[]},{\"type\":\"function\",\"stateMutability\":\"view\",\"outputs\":[{\"type\":\"string\",\"name\":\"\",\"internalType\":\"string\"}],\"name\":\"symbol\",\"inputs\":[]}]",
}

ContractInfoTokenMetaData contains all meta data concerning the ContractInfoToken contract.

View Source
var (
	// Mapping log topic to its hash and hex format
	Erc20LogTopicMap = map[string]string{
		Erc20TransferLogTopic:   "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
		Erc20DepositLogTopic:    "0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c",
		Erc20WithdrawalLogTopic: "0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65",
	}
)

Functions

func Account

func Account(address *common.Address) *types.AccountIdentifier

func Amount

func Amount(value *big.Int, currency *types.Currency) *types.Amount

func ChecksumAddress

func ChecksumAddress(address string) (string, bool)

ChecksumAddress ensures an Ethereum hex address is in Checksum Format. If the address cannot be converted, it returns !ok.

func ConvertEVMTopicHashToAddress

func ConvertEVMTopicHashToAddress(hash *common.Hash) *common.Address

ConvertEVMTopicHashToAddress uses the last 20 bytes of a common.Hash to create a common.Address

func EffectiveGasPrice

func EffectiveGasPrice(tx *EthTypes.Transaction, baseFee *big.Int) (*big.Int, error)

EffectiveGasPrice returns the price of gas charged to this Transaction to be included in the block.

func Erc20Amount

func Erc20Amount(
	bytes []byte,
	addr common.Address,
	symbol string,
	decimals int32,
	sender bool) *types.Amount

func Erc20Currency

func Erc20Currency(symbol string, decimals int32, contractAddress string) *types.Currency

func GenerateErc20TransferData

func GenerateErc20TransferData(toAddress string, value *big.Int) []byte

func GetTraceConfig

func GetTraceConfig(useNative bool) (*tracers.TraceConfig, error)

func IsValidERC20Token

func IsValidERC20Token(whiteList []configuration.Token, address string) bool

EqualFoldContains checks if the array contains the string regardless of casing

func MarshalJSONMap

func MarshalJSONMap(i interface{}) (map[string]interface{}, error)

marshalJSONMap converts an interface into a map[string]interface{}.

func MustChecksum

func MustChecksum(address string) string

MustChecksum ensures an address can be converted into a valid checksum. If it does not, the program will exit.

func ToBlockNumArg

func ToBlockNumArg(number *big.Int) string

func UnmarshalJSONMap

func UnmarshalJSONMap(m map[string]interface{}, i interface{}) error

UnmarshalJSONMap converts map[string]interface{} into a interface{}.

Types

type Call

type Call struct {
	BeforeEVMTransfers []*EVMTransfer `json:"beforeEVMTransfers"`
	AfterEVMTransfers  []*EVMTransfer `json:"afterEVMTransfers"`
	Type               string         `json:"type"`
	From               common.Address `json:"from"`
	To                 common.Address `json:"to"`
	Value              *big.Int       `json:"value"`
	GasUsed            *big.Int       `json:"gasUsed"`
	Revert             bool
	ErrorMessage       string  `json:"error"`
	Calls              []*Call `json:"calls"`
}

Call is an Ethereum debug trace.

func (*Call) UnmarshalJSON

func (t *Call) UnmarshalJSON(input []byte) error

UnmarshalJSON is a custom unmarshaler for Call.

type ContractCurrency

type ContractCurrency struct {
	Symbol   string `json:"symbol"`
	Decimals int32  `json:"decimals"`
}

type ContractInfoToken

type ContractInfoToken struct {
	ContractInfoTokenCaller     // Read-only binding to the contract
	ContractInfoTokenTransactor // Write-only binding to the contract
	ContractInfoTokenFilterer   // Log filterer for contract events
}

ContractInfoToken is an auto generated Go binding around an Ethereum contract.

func NewContractInfoToken

func NewContractInfoToken(address common.Address, backend bind.ContractBackend) (*ContractInfoToken, error)

NewContractInfoToken creates a new instance of ContractInfoToken, bound to a specific deployed contract.

type ContractInfoTokenCaller

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

ContractInfoTokenCaller is an auto generated read-only Go binding around an Ethereum contract.

func NewContractInfoTokenCaller

func NewContractInfoTokenCaller(address common.Address, caller bind.ContractCaller) (*ContractInfoTokenCaller, error)

NewContractInfoTokenCaller creates a new read-only instance of ContractInfoToken, bound to a specific deployed contract.

func (*ContractInfoTokenCaller) Decimals

func (_ContractInfoToken *ContractInfoTokenCaller) Decimals(opts *bind.CallOpts) (uint8, error)

Decimals is a free data retrieval call binding the contract method 0x313ce567.

Solidity: function decimals() view returns(uint8)

func (*ContractInfoTokenCaller) Symbol

func (_ContractInfoToken *ContractInfoTokenCaller) Symbol(opts *bind.CallOpts) (string, error)

Symbol is a free data retrieval call binding the contract method 0x95d89b41.

Solidity: function symbol() view returns(string)

type ContractInfoTokenCallerRaw

type ContractInfoTokenCallerRaw struct {
	Contract *ContractInfoTokenCaller // Generic read-only contract binding to access the raw methods on
}

ContractInfoTokenCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.

func (*ContractInfoTokenCallerRaw) Call

func (_ContractInfoToken *ContractInfoTokenCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error

Call invokes the (constant) contract method with params as input values and sets the output to result. The result type might be a single field for simple returns, a slice of interfaces for anonymous returns and a struct for named returns.

type ContractInfoTokenCallerSession

type ContractInfoTokenCallerSession struct {
	Contract *ContractInfoTokenCaller // Generic contract caller binding to set the session for
	CallOpts bind.CallOpts            // Call options to use throughout this session
}

ContractInfoTokenCallerSession is an auto generated read-only Go binding around an Ethereum contract, with pre-set call options.

func (*ContractInfoTokenCallerSession) Decimals

func (_ContractInfoToken *ContractInfoTokenCallerSession) Decimals() (uint8, error)

Decimals is a free data retrieval call binding the contract method 0x313ce567.

Solidity: function decimals() view returns(uint8)

func (*ContractInfoTokenCallerSession) Symbol

func (_ContractInfoToken *ContractInfoTokenCallerSession) Symbol() (string, error)

Symbol is a free data retrieval call binding the contract method 0x95d89b41.

Solidity: function symbol() view returns(string)

type ContractInfoTokenFilterer

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

ContractInfoTokenFilterer is an auto generated log filtering Go binding around an Ethereum contract events.

func NewContractInfoTokenFilterer

func NewContractInfoTokenFilterer(address common.Address, filterer bind.ContractFilterer) (*ContractInfoTokenFilterer, error)

NewContractInfoTokenFilterer creates a new log filterer instance of ContractInfoToken, bound to a specific deployed contract.

type ContractInfoTokenRaw

type ContractInfoTokenRaw struct {
	Contract *ContractInfoToken // Generic contract binding to access the raw methods on
}

ContractInfoTokenRaw is an auto generated low-level Go binding around an Ethereum contract.

func (*ContractInfoTokenRaw) Call

func (_ContractInfoToken *ContractInfoTokenRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error

Call invokes the (constant) contract method with params as input values and sets the output to result. The result type might be a single field for simple returns, a slice of interfaces for anonymous returns and a struct for named returns.

func (*ContractInfoTokenRaw) Transact

func (_ContractInfoToken *ContractInfoTokenRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

Transact invokes the (paid) contract method with params as input values.

func (*ContractInfoTokenRaw) Transfer

func (_ContractInfoToken *ContractInfoTokenRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type ContractInfoTokenSession

type ContractInfoTokenSession struct {
	Contract     *ContractInfoToken // Generic contract binding to set the session for
	CallOpts     bind.CallOpts      // Call options to use throughout this session
	TransactOpts bind.TransactOpts  // Transaction auth options to use throughout this session
}

ContractInfoTokenSession is an auto generated Go binding around an Ethereum contract, with pre-set call and transact options.

func (*ContractInfoTokenSession) Decimals

func (_ContractInfoToken *ContractInfoTokenSession) Decimals() (uint8, error)

Decimals is a free data retrieval call binding the contract method 0x313ce567.

Solidity: function decimals() view returns(uint8)

func (*ContractInfoTokenSession) Symbol

func (_ContractInfoToken *ContractInfoTokenSession) Symbol() (string, error)

Symbol is a free data retrieval call binding the contract method 0x95d89b41.

Solidity: function symbol() view returns(string)

type ContractInfoTokenTransactor

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

ContractInfoTokenTransactor is an auto generated write-only Go binding around an Ethereum contract.

func NewContractInfoTokenTransactor

func NewContractInfoTokenTransactor(address common.Address, transactor bind.ContractTransactor) (*ContractInfoTokenTransactor, error)

NewContractInfoTokenTransactor creates a new write-only instance of ContractInfoToken, bound to a specific deployed contract.

type ContractInfoTokenTransactorRaw

type ContractInfoTokenTransactorRaw struct {
	Contract *ContractInfoTokenTransactor // Generic write-only contract binding to access the raw methods on
}

ContractInfoTokenTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.

func (*ContractInfoTokenTransactorRaw) Transact

func (_ContractInfoToken *ContractInfoTokenTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

Transact invokes the (paid) contract method with params as input values.

func (*ContractInfoTokenTransactorRaw) Transfer

func (_ContractInfoToken *ContractInfoTokenTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type ContractInfoTokenTransactorSession

type ContractInfoTokenTransactorSession struct {
	Contract     *ContractInfoTokenTransactor // Generic contract transactor binding to set the session for
	TransactOpts bind.TransactOpts            // Transaction auth options to use throughout this session
}

ContractInfoTokenTransactorSession is an auto generated write-only Go binding around an Ethereum contract, with pre-set transact options.

type EVMTransfer added in v0.0.5

type EVMTransfer struct {
	Purpose string          `json:"purpose"`
	From    *common.Address `json:"from"`
	To      *common.Address `json:"to"`
	Value   *big.Int        `json:"value"`
}

EVMTransfer is an Ethereum debug trace.

func (*EVMTransfer) UnmarshalJSON added in v0.0.5

func (t *EVMTransfer) UnmarshalJSON(input []byte) error

UnmarshalJSON is a custom unmarshaler for Call.

type EthClient

type EthClient struct {
	*ethclient.Client
}

func NewEthClient

func NewEthClient(endpoint string) (*EthClient, error)

NewEthClient connects a SDKClient to the given URL.

func (*EthClient) Close

func (ec *EthClient) Close()

Close shuts down the RPC SDKClient connection.

type FeeSetResult added in v0.0.5

type FeeSetResult struct {
	L1Transaction *hexutil.Big `json:"l1Transaction"`
	L1Calldata    *hexutil.Big `json:"l1Calldata"`
	L2Storage     *hexutil.Big `json:"l2Storage"`
	L2Computation *hexutil.Big `json:"l2Computation"`
}

type FeeStatsResult added in v0.0.5

type FeeStatsResult struct {
	Prices    *FeeSetResult `json:"prices"`
	UnitsUsed *FeeSetResult `json:"unitsUsed"`
	Paid      *FeeSetResult `json:"paid"`
}

type FlatCall

type FlatCall struct {
	BeforeEVMTransfers []*EVMTransfer `json:"beforeEVMTransfers"`
	AfterEVMTransfers  []*EVMTransfer `json:"afterEVMTransfers"`
	Type               string         `json:"type"`
	From               common.Address `json:"from"`
	To                 common.Address `json:"to"`
	Value              *big.Int       `json:"value"`
	GasUsed            *big.Int       `json:"gasUsed"`
	Revert             bool
	ErrorMessage       string `json:"error"`
}

func FlattenOpenEthTraces

func FlattenOpenEthTraces(data *OpenEthTraceCall, flattened []*FlatCall) []*FlatCall

flattenTraces recursively flattens all traces.

func FlattenTraces

func FlattenTraces(data *Call, flattened []*FlatCall) []*FlatCall

flattenTraces recursively flattens all traces.

type GetTransactionReceiptResult added in v0.0.5

type GetTransactionReceiptResult struct {
	TransactionHash   common.Hash     `json:"transactionHash"`
	TransactionIndex  hexutil.Uint64  `json:"transactionIndex"`
	BlockHash         common.Hash     `json:"blockHash"`
	BlockNumber       *hexutil.Big    `json:"blockNumber"`
	From              common.Address  `json:"from"`
	To                *common.Address `json:"to"`
	CumulativeGasUsed hexutil.Uint64  `json:"cumulativeGasUsed"`
	GasUsed           hexutil.Uint64  `json:"gasUsed"`
	EffectiveGasPrice hexutil.Uint64  `json:"effectiveGasPrice"`
	ContractAddress   *common.Address `json:"contractAddress"`
	Logs              []*EthTypes.Log `json:"logs"`
	LogsBloom         hexutil.Bytes   `json:"logsBloom"`
	Status            hexutil.Uint64  `json:"status"`

	// L2 Specific Fields
	ReturnCode       hexutil.Uint64    `json:"returnCode"`
	ReturnData       hexutil.Bytes     `json:"returnData"`
	FeeStats         *FeeStatsResult   `json:"feeStats"`
	L1BlockNumber    *hexutil.Big      `json:"l1BlockNumber"`
	L1InboxBatchInfo *L1InboxBatchInfo `json:"l1InboxBatchInfo"`
	Type             string            `json:"type,omitempty"`
	PostState        []byte            `json:"root"`
}

Receipt represents the results of a transaction.

type GraphQL

type GraphQL interface {
	Query(ctx context.Context, input string) (string, error)
}

GraphQL is the interface for accessing go-ethereum's GraphQL endpoint.

type JSONRPC

type JSONRPC interface {
	CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error
	BatchCallContext(ctx context.Context, b []rpc.BatchElem) error
	Close()
}

JSONRPC is the interface for accessing go-ethereum's JSON RPC endpoint. https://github.com/ethereum/go-ethereum/blob/0169d579d0eed4f6366697985a7b0f0b99402783/rpc/client.go#L308

type L1InboxBatchInfo added in v0.0.5

type L1InboxBatchInfo struct {
	Confirmations *hexutil.Big   `json:"confirmations"`
	BlockNumber   *hexutil.Big   `json:"blockNumber"`
	LogAddress    common.Address `json:"logAddress"`
	LogTopics     []common.Hash  `json:"logTopics"`
	LogData       hexutil.Bytes  `json:"logData"`
}

type LoadedTransaction

type LoadedTransaction struct {
	Transaction *EthTypes.Transaction
	From        *common.Address
	BlockNumber *string
	BlockHash   *common.Hash
	TxHash      *common.Hash // may not equal Transaction.Hash() due to state sync indicator
	FeeAmount   *big.Int
	FeeBurned   *big.Int // nil if no fees were burned
	Miner       string
	Author      string
	Status      bool

	Trace    []*FlatCall
	RawTrace json.RawMessage
	Receipt  *RosettaTxReceipt

	BaseFee      *big.Int
	IsBridgedTxn bool

	Mint string
}

func (*LoadedTransaction) GetMint added in v0.0.6

func (tx *LoadedTransaction) GetMint() *big.Int

type Metadata

type Metadata struct {
	Nonce           uint64   `json:"nonce"`
	GasPrice        *big.Int `json:"gas_price"`
	GasLimit        uint64   `json:"gas_limit"`
	ContractData    string   `json:"data,omitempty"`
	MethodSignature string   `json:"method_signature,omitempty"`
	MethodArgs      []string `json:"method_args,omitempty"`
}

type OpenEthAction

type OpenEthAction struct {
	Type    string         `json:"callType"`
	From    common.Address `json:"from"`
	To      common.Address `json:"to"`
	Value   *big.Int       `json:"value"`
	GasUsed *big.Int       `json:"gas"`
}

func (*OpenEthAction) UnmarshalJSON

func (t *OpenEthAction) UnmarshalJSON(input []byte) error

UnmarshalJSON is a custom unmarshaler for OpenEthAction.

type OpenEthTrace

type OpenEthTrace struct {
	Subtraces       int64         `json:"subtraces"`
	Action          OpenEthAction `json:"action"`
	Type            string        `json:"type"`
	TransactionHash string        `json:"transactionHash"`
}

type OpenEthTraceCall

type OpenEthTraceCall struct {
	Output string         `json:"output"`
	Trace  []OpenEthTrace `json:"trace"`
}

Open Ethereum API traces

type Options

type Options struct {
	From                   string                 `json:"from"`
	To                     string                 `json:"to"`
	TokenAddress           string                 `json:"token_address,omitempty"`
	ContractAddress        string                 `json:"contract_address,omitempty"`
	Value                  string                 `json:"value"`
	SuggestedFeeMultiplier *float64               `json:"suggested_fee_multiplier,omitempty"`
	GasPrice               *big.Int               `json:"gas_price,omitempty"`
	GasLimit               *big.Int               `json:"gas_limit,omitempty"`
	Nonce                  *big.Int               `json:"nonce,omitempty"`
	Currency               *RosettaTypes.Currency `json:"currency,omitempty"`
	MethodSignature        string                 `json:"method_signature,omitempty"`
	MethodArgs             []string               `json:"method_args,omitempty"`
	ContractData           string                 `json:"data,omitempty"`
}

type ParseMetadata

type ParseMetadata struct {
	Nonce    uint64   `json:"nonce"`
	GasPrice *big.Int `json:"gas_price"`
	ChainID  *big.Int `json:"chain_id"`
}

type PayloadsResponse

type PayloadsResponse struct {
	TransferData []byte
	Address      common.Address
	Amount       *big.Int
}

type RPCBlock

type RPCBlock struct {
	Hash         common.Hash      `json:"hash"`
	Transactions []RPCTransaction `json:"transactions"`
	UncleHashes  []common.Hash    `json:"uncles"`
}

type RPCClient

type RPCClient struct {
	JSONRPC
}

func NewRPCClient

func NewRPCClient(endpoint string) (*RPCClient, error)

NewRPCClient connects a SDKClient to the given URL.

func (*RPCClient) Close

func (ec *RPCClient) Close()

Close shuts down the RPC SDKClient connection.

type RPCTransaction

type RPCTransaction struct {
	Tx *EthTypes.Transaction
	TxExtraInfo
}

EthTypes.Transaction contains TxData, which is DynamicFeeTx: https://github.com/ethereum/go-ethereum/blob/980b7682b474db61ecbd78171e7cacfec8214048 /core/types/dynamic_fee_tx.go#L25

func (*RPCTransaction) LoadedTransaction

func (tx *RPCTransaction) LoadedTransaction() *LoadedTransaction

func (*RPCTransaction) UnmarshalJSON

func (tx *RPCTransaction) UnmarshalJSON(msg []byte) error

Custom UnmarshalJSON for RPCTransaction to populate tx, and extra info.

type RosettaTxReceipt

type RosettaTxReceipt struct {
	Type           uint8 `json:"type,omitempty"`
	GasPrice       *big.Int
	GasUsed        *big.Int
	TransactionFee *big.Int
	Logs           []*EthTypes.Log
	RawMessage     json.RawMessage
	Status         uint64 `json:"status"`
}

type SDKClient

type SDKClient struct {
	P *params.ChainConfig

	*RPCClient
	*EthClient
	// contains filtered or unexported fields
}

func NewClient

func NewClient(cfg *configuration.Configuration, rpcClient *RPCClient) (*SDKClient, error)

NewClient creates a client that connects to the network.

func (*SDKClient) BlockAuthor

func (ec *SDKClient) BlockAuthor(ctx context.Context, blockIndex int64) (string, error)

nolint:staticcheck

func (*SDKClient) BlockRewardTransaction

func (ec *SDKClient) BlockRewardTransaction(
	blockIdentifier *RosettaTypes.BlockIdentifier,
	miner string,
	uncles []*EthTypes.Header,
) *RosettaTypes.Transaction

func (*SDKClient) GetBlockReceipts

func (ec *SDKClient) GetBlockReceipts(
	ctx context.Context,
	blockHash common.Hash,
	txs []RPCTransaction,
	baseFee *big.Int,
) ([]*RosettaTxReceipt, error)

func (*SDKClient) GetClient

func (ec *SDKClient) GetClient() *SDKClient

func (*SDKClient) GetContractCallGasLimit

func (ec *SDKClient) GetContractCallGasLimit(
	ctx context.Context,
	toAddress string,
	fromAddress string,
	data []byte,
) (uint64, error)

func (*SDKClient) GetContractCurrency

func (ec *SDKClient) GetContractCurrency(
	addr common.Address,
	erc20 bool,
) (*ContractCurrency, error)

GetContractCurrency returns the currency for a specific address

func (*SDKClient) GetErc20TransferGasLimit

func (ec *SDKClient) GetErc20TransferGasLimit(
	ctx context.Context,
	toAddress string,
	fromAddress string,
	value *big.Int,
	currency *RosettaTypes.Currency,
) (uint64, error)

func (*SDKClient) GetGasPrice

func (ec *SDKClient) GetGasPrice(
	ctx context.Context,
	input Options,
) (*big.Int, error)

func (*SDKClient) GetLoadedTransaction

func (ec *SDKClient) GetLoadedTransaction(
	ctx context.Context,
	request *RosettaTypes.BlockTransactionRequest,
) (*LoadedTransaction, error)

nolint:staticcheck

func (*SDKClient) GetNativeTransferGasLimit

func (ec *SDKClient) GetNativeTransferGasLimit(ctx context.Context, toAddress string,
	fromAddress string, value *big.Int) (uint64, error)

func (*SDKClient) GetNonce

func (ec *SDKClient) GetNonce(
	ctx context.Context,
	input Options,
) (uint64, error)

func (*SDKClient) GetRosettaConfig

func (ec *SDKClient) GetRosettaConfig() configuration.RosettaConfig

func (*SDKClient) GetTransactionReceipt

func (ec *SDKClient) GetTransactionReceipt(
	ctx context.Context,
	tx *LoadedTransaction,
) (*RosettaTxReceipt, error)

func (*SDKClient) GetUncles

func (ec *SDKClient) GetUncles(
	ctx context.Context,
	head *EthTypes.Header,
	body *RPCBlock,
) ([]*EthTypes.Header, error)

func (*SDKClient) ParseOps

func (ec *SDKClient) ParseOps(
	tx *LoadedTransaction,
) ([]*RosettaTypes.Operation, error)

func (*SDKClient) PopulateCrossChainTransactions

func (ec *SDKClient) PopulateCrossChainTransactions(
	*EthTypes.Block,
	[]*LoadedTransaction,
) ([]*RosettaTypes.Transaction, error)

func (*SDKClient) Status

Status returns geth status information for determining node healthiness.

func (*SDKClient) Submit

func (ec *SDKClient) Submit(
	ctx context.Context,
	signedTx *EthTypes.Transaction,
) error

func (*SDKClient) TraceBlockByHash

func (ec *SDKClient) TraceBlockByHash(
	ctx context.Context,
	blockHash common.Hash,
	txs []RPCTransaction,
) (map[string][]*FlatCall, error)

TraceBlockByHash returns the Transaction traces of all transactions in the block

func (*SDKClient) TraceReplayBlockTransactions

func (ec *SDKClient) TraceReplayBlockTransactions(ctx context.Context, hsh string) (
	map[string][]*FlatCall, error,
)

TraceReplayBlockTransactions returns all transactions in a block returning the requested traces for each Transaction.

func (*SDKClient) TraceReplayTransaction

func (ec *SDKClient) TraceReplayTransaction(
	ctx context.Context,
	hsh string,
) (json.RawMessage, []*FlatCall, error)

TraceReplayTransaction returns a Transaction trace

func (*SDKClient) TraceTransaction

func (ec *SDKClient) TraceTransaction(
	ctx context.Context,
	hash common.Hash,
) (json.RawMessage, []*FlatCall, error)

TraceTransaction returns a Transaction trace

type SignedTransactionWrapper

type SignedTransactionWrapper struct {
	SignedTransaction []byte                 `json:"signed_tx"`
	Currency          *RosettaTypes.Currency `json:"currency,omitempty"`
}

type Transaction

type Transaction struct {
	From  string   `json:"from"`
	To    string   `json:"to"`
	Value *big.Int `json:"value"`
	Data  []byte   `json:"data"`
	// ContractData     string          `json:"contractData"`
	Nonce    uint64                 `json:"nonce"`
	GasPrice *big.Int               `json:"gas_price"`
	GasLimit uint64                 `json:"gas"`
	ChainID  *big.Int               `json:"chain_id"`
	Currency *RosettaTypes.Currency `json:"currency,omitempty"`
}

type TxExtraInfo

type TxExtraInfo struct {
	BlockNumber *string         `json:"blockNumber,omitempty"`
	BlockHash   *common.Hash    `json:"blockHash,omitempty"`
	From        *common.Address `json:"from,omitempty"`
	TxHash      *common.Hash    `json:"hash,omitempty"`
	Mint        string          `json:"mint,omitempty"`
}

Jump to

Keyboard shortcuts

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