client

package
v0.1.44 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: BSD-3-Clause Imports: 28 Imported by: 0

Documentation

Overview

Package client is a generated GoMock package.

Index

Constants

View Source
const (
	UnknownERC20Symbol  = "ERC20_UNKNOWN"
	UnknownERC721Symbol = "ERC721_UNKNOWN"
)

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.

Functions

This section is empty.

Types

type Asset

type Asset struct {
	ID           string `json:"assetId"`
	Name         string `json:"name"`
	Symbol       string `json:"symbol"`
	Denomination string `json:"denomination"`
}

type Blockchain

type Blockchain struct {
	ID       string `json:"id"`
	SubnetID string `json:"subnetID"`
	Name     string `json:"name"`
	VMID     string `json:"vmId"`
}

type Call

type Call struct {
	Type    string         `json:"type"`
	From    common.Address `json:"from"`
	To      common.Address `json:"to"`
	Value   *hexutil.Big   `json:"value"`
	GasUsed *hexutil.Big   `json:"gasUsed"`
	Revert  bool           `json:"revert"`
	Error   string         `json:"error,omitempty"`
	Calls   []*Call        `json:"calls,omitempty"`
}

type Client

type Client interface {
	// info.Client methods
	InfoClient

	ChainID(context.Context) (*big.Int, error)
	BlockByHash(context.Context, common.Hash) (*types.Block, error)
	BlockByNumber(context.Context, *big.Int) (*types.Block, error)
	HeaderByHash(context.Context, common.Hash) (*types.Header, error)
	HeaderByNumber(context.Context, *big.Int) (*types.Header, error)
	TransactionByHash(context.Context, common.Hash) (*types.Transaction, bool, error)
	TransactionReceipt(context.Context, common.Hash) (*types.Receipt, error)
	TraceTransaction(context.Context, string) (*Call, []*FlatCall, error)
	TraceBlockByHash(context.Context, string) ([]*Call, [][]*FlatCall, error)
	SendTransaction(context.Context, *types.Transaction) error
	BalanceAt(context.Context, common.Address, *big.Int) (*big.Int, error)
	NonceAt(context.Context, common.Address, *big.Int) (uint64, error)
	SuggestGasPrice(context.Context) (*big.Int, error)
	EstimateGas(context.Context, interfaces.CallMsg) (uint64, error)
	TxPoolContent(context.Context) (*TxPoolContent, error)
	GetContractInfo(common.Address, bool) (string, uint8, error)
	CallContract(context.Context, interfaces.CallMsg, *big.Int) ([]byte, error)
	IssueTx(ctx context.Context, txBytes []byte, options ...rpc.Option) (ids.ID, error)
	GetAtomicUTXOs(ctx context.Context, addrs []ids.ShortID, sourceChain string, limit uint32, startAddress ids.ShortID, startUTXOID ids.ID, options ...rpc.Option) ([][]byte, ids.ShortID, ids.ID, error)
	EstimateBaseFee(ctx context.Context) (*big.Int, error)
}

func NewClient

func NewClient(ctx context.Context, endpoint string) (Client, error)

NewClient returns a new client for Avalanche APIs

type ContractClient added in v0.0.26

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

ContractClient is a client for the calling contract information

func NewContractClient added in v0.0.26

func NewContractClient(c ethclient.Client) *ContractClient

NewContractClient returns a new ContractInfo client

func (*ContractClient) GetContractInfo added in v0.1.5

func (c *ContractClient) GetContractInfo(addr common.Address, erc20 bool) (string, uint8, error)

GetContractInfo returns the symbol and decimals for [addr].

type ContractInfo added in v0.0.26

type ContractInfo struct {
	Symbol   string
	Decimals uint8
}

type ContractInfoToken added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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

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

func NewContractInfoTokenCaller added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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

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

func NewContractInfoTokenFilterer added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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

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

func NewContractInfoTokenTransactor added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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 added in v0.0.26

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 EthClient

type EthClient struct {
	ethclient.Client
	// contains filtered or unexported fields
}

EthClient provides access to Coreth API

func NewEthClient

func NewEthClient(ctx context.Context, endpoint string) (*EthClient, error)

NewEthClient returns a new EVM client

func (*EthClient) TraceBlockByHash added in v0.1.1

func (c *EthClient) TraceBlockByHash(ctx context.Context, hash string) ([]*Call, [][]*FlatCall, error)

TraceBlockByHash returns the transaction traces of all transactions in the block

func (*EthClient) TraceTransaction

func (c *EthClient) TraceTransaction(ctx context.Context, hash string) (*Call, []*FlatCall, error)

TraceTransaction returns a transaction trace

func (*EthClient) TxPoolContent

func (c *EthClient) TxPoolContent(ctx context.Context) (*TxPoolContent, error)

TxPoolContent returns the tx pool content

type EvmClient added in v0.1.26

type EvmClient evm.Client

type FlatCall

type FlatCall struct {
	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           `json:"revert"`
	Error   string         `json:"error,omitempty"`
}

type InfoClient

type InfoClient interface {
	GetBlockchainID(context.Context, string, ...rpc.Option) (ids.ID, error)
	IsBootstrapped(context.Context, string, ...rpc.Option) (bool, error)
	Peers(context.Context, ...rpc.Option) ([]info.Peer, error)
}

InfoClient collects all Avalanchego info.Client methods common to Rosetta Clients

type MockClient added in v0.1.42

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

MockClient is a mock of Client interface.

func NewMockClient added in v0.1.42

func NewMockClient(ctrl *gomock.Controller) *MockClient

NewMockClient creates a new mock instance.

func (*MockClient) BalanceAt added in v0.1.42

func (m *MockClient) BalanceAt(arg0 context.Context, arg1 common.Address, arg2 *big.Int) (*big.Int, error)

BalanceAt mocks base method.

func (*MockClient) BlockByHash added in v0.1.42

func (m *MockClient) BlockByHash(arg0 context.Context, arg1 common.Hash) (*types.Block, error)

BlockByHash mocks base method.

func (*MockClient) BlockByNumber added in v0.1.42

func (m *MockClient) BlockByNumber(arg0 context.Context, arg1 *big.Int) (*types.Block, error)

BlockByNumber mocks base method.

func (*MockClient) CallContract added in v0.1.42

func (m *MockClient) CallContract(arg0 context.Context, arg1 interfaces.CallMsg, arg2 *big.Int) ([]byte, error)

CallContract mocks base method.

func (*MockClient) ChainID added in v0.1.42

func (m *MockClient) ChainID(arg0 context.Context) (*big.Int, error)

ChainID mocks base method.

func (*MockClient) EXPECT added in v0.1.42

func (m *MockClient) EXPECT() *MockClientMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockClient) EstimateBaseFee added in v0.1.42

func (m *MockClient) EstimateBaseFee(arg0 context.Context) (*big.Int, error)

EstimateBaseFee mocks base method.

func (*MockClient) EstimateGas added in v0.1.42

func (m *MockClient) EstimateGas(arg0 context.Context, arg1 interfaces.CallMsg) (uint64, error)

EstimateGas mocks base method.

func (*MockClient) GetAtomicUTXOs added in v0.1.42

func (m *MockClient) GetAtomicUTXOs(arg0 context.Context, arg1 []ids.ShortID, arg2 string, arg3 uint32, arg4 ids.ShortID, arg5 ids.ID, arg6 ...rpc.Option) ([][]byte, ids.ShortID, ids.ID, error)

GetAtomicUTXOs mocks base method.

func (*MockClient) GetBlockchainID added in v0.1.42

func (m *MockClient) GetBlockchainID(arg0 context.Context, arg1 string, arg2 ...rpc.Option) (ids.ID, error)

GetBlockchainID mocks base method.

func (*MockClient) GetContractInfo added in v0.1.42

func (m *MockClient) GetContractInfo(arg0 common.Address, arg1 bool) (string, byte, error)

GetContractInfo mocks base method.

func (*MockClient) HeaderByHash added in v0.1.42

func (m *MockClient) HeaderByHash(arg0 context.Context, arg1 common.Hash) (*types.Header, error)

HeaderByHash mocks base method.

func (*MockClient) HeaderByNumber added in v0.1.42

func (m *MockClient) HeaderByNumber(arg0 context.Context, arg1 *big.Int) (*types.Header, error)

HeaderByNumber mocks base method.

func (*MockClient) IsBootstrapped added in v0.1.42

func (m *MockClient) IsBootstrapped(arg0 context.Context, arg1 string, arg2 ...rpc.Option) (bool, error)

IsBootstrapped mocks base method.

func (*MockClient) IssueTx added in v0.1.42

func (m *MockClient) IssueTx(arg0 context.Context, arg1 []byte, arg2 ...rpc.Option) (ids.ID, error)

IssueTx mocks base method.

func (*MockClient) NonceAt added in v0.1.42

func (m *MockClient) NonceAt(arg0 context.Context, arg1 common.Address, arg2 *big.Int) (uint64, error)

NonceAt mocks base method.

func (*MockClient) Peers added in v0.1.42

func (m *MockClient) Peers(arg0 context.Context, arg1 ...rpc.Option) ([]info.Peer, error)

Peers mocks base method.

func (*MockClient) SendTransaction added in v0.1.42

func (m *MockClient) SendTransaction(arg0 context.Context, arg1 *types.Transaction) error

SendTransaction mocks base method.

func (*MockClient) SuggestGasPrice added in v0.1.42

func (m *MockClient) SuggestGasPrice(arg0 context.Context) (*big.Int, error)

SuggestGasPrice mocks base method.

func (*MockClient) TraceBlockByHash added in v0.1.42

func (m *MockClient) TraceBlockByHash(arg0 context.Context, arg1 string) ([]*Call, [][]*FlatCall, error)

TraceBlockByHash mocks base method.

func (*MockClient) TraceTransaction added in v0.1.42

func (m *MockClient) TraceTransaction(arg0 context.Context, arg1 string) (*Call, []*FlatCall, error)

TraceTransaction mocks base method.

func (*MockClient) TransactionByHash added in v0.1.42

func (m *MockClient) TransactionByHash(arg0 context.Context, arg1 common.Hash) (*types.Transaction, bool, error)

TransactionByHash mocks base method.

func (*MockClient) TransactionReceipt added in v0.1.42

func (m *MockClient) TransactionReceipt(arg0 context.Context, arg1 common.Hash) (*types.Receipt, error)

TransactionReceipt mocks base method.

func (*MockClient) TxPoolContent added in v0.1.42

func (m *MockClient) TxPoolContent(arg0 context.Context) (*TxPoolContent, error)

TxPoolContent mocks base method.

type MockClientMockRecorder added in v0.1.42

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

MockClientMockRecorder is the mock recorder for MockClient.

func (*MockClientMockRecorder) BalanceAt added in v0.1.42

func (mr *MockClientMockRecorder) BalanceAt(arg0, arg1, arg2 any) *gomock.Call

BalanceAt indicates an expected call of BalanceAt.

func (*MockClientMockRecorder) BlockByHash added in v0.1.42

func (mr *MockClientMockRecorder) BlockByHash(arg0, arg1 any) *gomock.Call

BlockByHash indicates an expected call of BlockByHash.

func (*MockClientMockRecorder) BlockByNumber added in v0.1.42

func (mr *MockClientMockRecorder) BlockByNumber(arg0, arg1 any) *gomock.Call

BlockByNumber indicates an expected call of BlockByNumber.

func (*MockClientMockRecorder) CallContract added in v0.1.42

func (mr *MockClientMockRecorder) CallContract(arg0, arg1, arg2 any) *gomock.Call

CallContract indicates an expected call of CallContract.

func (*MockClientMockRecorder) ChainID added in v0.1.42

func (mr *MockClientMockRecorder) ChainID(arg0 any) *gomock.Call

ChainID indicates an expected call of ChainID.

func (*MockClientMockRecorder) EstimateBaseFee added in v0.1.42

func (mr *MockClientMockRecorder) EstimateBaseFee(arg0 any) *gomock.Call

EstimateBaseFee indicates an expected call of EstimateBaseFee.

func (*MockClientMockRecorder) EstimateGas added in v0.1.42

func (mr *MockClientMockRecorder) EstimateGas(arg0, arg1 any) *gomock.Call

EstimateGas indicates an expected call of EstimateGas.

func (*MockClientMockRecorder) GetAtomicUTXOs added in v0.1.42

func (mr *MockClientMockRecorder) GetAtomicUTXOs(arg0, arg1, arg2, arg3, arg4, arg5 any, arg6 ...any) *gomock.Call

GetAtomicUTXOs indicates an expected call of GetAtomicUTXOs.

func (*MockClientMockRecorder) GetBlockchainID added in v0.1.42

func (mr *MockClientMockRecorder) GetBlockchainID(arg0, arg1 any, arg2 ...any) *gomock.Call

GetBlockchainID indicates an expected call of GetBlockchainID.

func (*MockClientMockRecorder) GetContractInfo added in v0.1.42

func (mr *MockClientMockRecorder) GetContractInfo(arg0, arg1 any) *gomock.Call

GetContractInfo indicates an expected call of GetContractInfo.

func (*MockClientMockRecorder) HeaderByHash added in v0.1.42

func (mr *MockClientMockRecorder) HeaderByHash(arg0, arg1 any) *gomock.Call

HeaderByHash indicates an expected call of HeaderByHash.

func (*MockClientMockRecorder) HeaderByNumber added in v0.1.42

func (mr *MockClientMockRecorder) HeaderByNumber(arg0, arg1 any) *gomock.Call

HeaderByNumber indicates an expected call of HeaderByNumber.

func (*MockClientMockRecorder) IsBootstrapped added in v0.1.42

func (mr *MockClientMockRecorder) IsBootstrapped(arg0, arg1 any, arg2 ...any) *gomock.Call

IsBootstrapped indicates an expected call of IsBootstrapped.

func (*MockClientMockRecorder) IssueTx added in v0.1.42

func (mr *MockClientMockRecorder) IssueTx(arg0, arg1 any, arg2 ...any) *gomock.Call

IssueTx indicates an expected call of IssueTx.

func (*MockClientMockRecorder) NonceAt added in v0.1.42

func (mr *MockClientMockRecorder) NonceAt(arg0, arg1, arg2 any) *gomock.Call

NonceAt indicates an expected call of NonceAt.

func (*MockClientMockRecorder) Peers added in v0.1.42

func (mr *MockClientMockRecorder) Peers(arg0 any, arg1 ...any) *gomock.Call

Peers indicates an expected call of Peers.

func (*MockClientMockRecorder) SendTransaction added in v0.1.42

func (mr *MockClientMockRecorder) SendTransaction(arg0, arg1 any) *gomock.Call

SendTransaction indicates an expected call of SendTransaction.

func (*MockClientMockRecorder) SuggestGasPrice added in v0.1.42

func (mr *MockClientMockRecorder) SuggestGasPrice(arg0 any) *gomock.Call

SuggestGasPrice indicates an expected call of SuggestGasPrice.

func (*MockClientMockRecorder) TraceBlockByHash added in v0.1.42

func (mr *MockClientMockRecorder) TraceBlockByHash(arg0, arg1 any) *gomock.Call

TraceBlockByHash indicates an expected call of TraceBlockByHash.

func (*MockClientMockRecorder) TraceTransaction added in v0.1.42

func (mr *MockClientMockRecorder) TraceTransaction(arg0, arg1 any) *gomock.Call

TraceTransaction indicates an expected call of TraceTransaction.

func (*MockClientMockRecorder) TransactionByHash added in v0.1.42

func (mr *MockClientMockRecorder) TransactionByHash(arg0, arg1 any) *gomock.Call

TransactionByHash indicates an expected call of TransactionByHash.

func (*MockClientMockRecorder) TransactionReceipt added in v0.1.42

func (mr *MockClientMockRecorder) TransactionReceipt(arg0, arg1 any) *gomock.Call

TransactionReceipt indicates an expected call of TransactionReceipt.

func (*MockClientMockRecorder) TxPoolContent added in v0.1.42

func (mr *MockClientMockRecorder) TxPoolContent(arg0 any) *gomock.Call

TxPoolContent indicates an expected call of TxPoolContent.

type MockPChainClient added in v0.1.42

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

MockPChainClient is a mock of PChainClient interface.

func NewMockPChainClient added in v0.1.42

func NewMockPChainClient(ctrl *gomock.Controller) *MockPChainClient

NewMockPChainClient creates a new mock instance.

func (*MockPChainClient) EXPECT added in v0.1.42

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockPChainClient) GetAssetDescription added in v0.1.42

func (m *MockPChainClient) GetAssetDescription(arg0 context.Context, arg1 string, arg2 ...rpc.Option) (*avm.GetAssetDescriptionReply, error)

GetAssetDescription mocks base method.

func (*MockPChainClient) GetAtomicUTXOs added in v0.1.42

func (m *MockPChainClient) GetAtomicUTXOs(arg0 context.Context, arg1 []ids.ShortID, arg2 string, arg3 uint32, arg4 ids.ShortID, arg5 ids.ID, arg6 ...rpc.Option) ([][]byte, ids.ShortID, ids.ID, error)

GetAtomicUTXOs mocks base method.

func (*MockPChainClient) GetBalance added in v0.1.42

func (m *MockPChainClient) GetBalance(arg0 context.Context, arg1 []ids.ShortID, arg2 ...rpc.Option) (*platformvm.GetBalanceResponse, error)

GetBalance mocks base method.

func (*MockPChainClient) GetBlock added in v0.1.42

func (m *MockPChainClient) GetBlock(arg0 context.Context, arg1 ids.ID, arg2 ...rpc.Option) ([]byte, error)

GetBlock mocks base method.

func (*MockPChainClient) GetBlockchainID added in v0.1.42

func (m *MockPChainClient) GetBlockchainID(arg0 context.Context, arg1 string, arg2 ...rpc.Option) (ids.ID, error)

GetBlockchainID mocks base method.

func (*MockPChainClient) GetContainerByIndex added in v0.1.42

func (m *MockPChainClient) GetContainerByIndex(arg0 context.Context, arg1 uint64, arg2 ...rpc.Option) (indexer.Container, error)

GetContainerByIndex mocks base method.

func (*MockPChainClient) GetCurrentValidators added in v0.1.42

func (m *MockPChainClient) GetCurrentValidators(arg0 context.Context, arg1 ids.ID, arg2 []ids.NodeID, arg3 ...rpc.Option) ([]platformvm.ClientPermissionlessValidator, error)

GetCurrentValidators mocks base method.

func (*MockPChainClient) GetHeight added in v0.1.42

func (m *MockPChainClient) GetHeight(arg0 context.Context, arg1 ...rpc.Option) (uint64, error)

GetHeight mocks base method.

func (*MockPChainClient) GetLastAccepted added in v0.1.42

func (m *MockPChainClient) GetLastAccepted(arg0 context.Context, arg1 ...rpc.Option) (indexer.Container, uint64, error)

GetLastAccepted mocks base method.

func (*MockPChainClient) GetNodeID added in v0.1.42

func (m *MockPChainClient) GetNodeID(arg0 context.Context, arg1 ...rpc.Option) (ids.NodeID, *signer.ProofOfPossession, error)

GetNodeID mocks base method.

func (*MockPChainClient) GetRewardUTXOs added in v0.1.42

func (m *MockPChainClient) GetRewardUTXOs(arg0 context.Context, arg1 *api.GetTxArgs, arg2 ...rpc.Option) ([][]byte, error)

GetRewardUTXOs mocks base method.

func (*MockPChainClient) GetStake added in v0.1.42

func (m *MockPChainClient) GetStake(arg0 context.Context, arg1 []ids.ShortID, arg2 bool, arg3 ...rpc.Option) (map[ids.ID]uint64, [][]byte, error)

GetStake mocks base method.

func (*MockPChainClient) GetTx added in v0.1.42

func (m *MockPChainClient) GetTx(arg0 context.Context, arg1 ids.ID, arg2 ...rpc.Option) ([]byte, error)

GetTx mocks base method.

func (*MockPChainClient) GetTxFee added in v0.1.42

func (m *MockPChainClient) GetTxFee(arg0 context.Context, arg1 ...rpc.Option) (*info.GetTxFeeResponse, error)

GetTxFee mocks base method.

func (*MockPChainClient) GetUTXOs added in v0.1.42

func (m *MockPChainClient) GetUTXOs(arg0 context.Context, arg1 []ids.ShortID, arg2 uint32, arg3 ids.ShortID, arg4 ids.ID, arg5 ...rpc.Option) ([][]byte, ids.ShortID, ids.ID, error)

GetUTXOs mocks base method.

func (*MockPChainClient) IsBootstrapped added in v0.1.42

func (m *MockPChainClient) IsBootstrapped(arg0 context.Context, arg1 string, arg2 ...rpc.Option) (bool, error)

IsBootstrapped mocks base method.

func (*MockPChainClient) IssueTx added in v0.1.42

func (m *MockPChainClient) IssueTx(arg0 context.Context, arg1 []byte, arg2 ...rpc.Option) (ids.ID, error)

IssueTx mocks base method.

func (*MockPChainClient) Peers added in v0.1.42

func (m *MockPChainClient) Peers(arg0 context.Context, arg1 ...rpc.Option) ([]info.Peer, error)

Peers mocks base method.

type MockPChainClientMockRecorder added in v0.1.42

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

MockPChainClientMockRecorder is the mock recorder for MockPChainClient.

func (*MockPChainClientMockRecorder) GetAssetDescription added in v0.1.42

func (mr *MockPChainClientMockRecorder) GetAssetDescription(arg0, arg1 any, arg2 ...any) *gomock.Call

GetAssetDescription indicates an expected call of GetAssetDescription.

func (*MockPChainClientMockRecorder) GetAtomicUTXOs added in v0.1.42

func (mr *MockPChainClientMockRecorder) GetAtomicUTXOs(arg0, arg1, arg2, arg3, arg4, arg5 any, arg6 ...any) *gomock.Call

GetAtomicUTXOs indicates an expected call of GetAtomicUTXOs.

func (*MockPChainClientMockRecorder) GetBalance added in v0.1.42

func (mr *MockPChainClientMockRecorder) GetBalance(arg0, arg1 any, arg2 ...any) *gomock.Call

GetBalance indicates an expected call of GetBalance.

func (*MockPChainClientMockRecorder) GetBlock added in v0.1.42

func (mr *MockPChainClientMockRecorder) GetBlock(arg0, arg1 any, arg2 ...any) *gomock.Call

GetBlock indicates an expected call of GetBlock.

func (*MockPChainClientMockRecorder) GetBlockchainID added in v0.1.42

func (mr *MockPChainClientMockRecorder) GetBlockchainID(arg0, arg1 any, arg2 ...any) *gomock.Call

GetBlockchainID indicates an expected call of GetBlockchainID.

func (*MockPChainClientMockRecorder) GetContainerByIndex added in v0.1.42

func (mr *MockPChainClientMockRecorder) GetContainerByIndex(arg0, arg1 any, arg2 ...any) *gomock.Call

GetContainerByIndex indicates an expected call of GetContainerByIndex.

func (*MockPChainClientMockRecorder) GetCurrentValidators added in v0.1.42

func (mr *MockPChainClientMockRecorder) GetCurrentValidators(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call

GetCurrentValidators indicates an expected call of GetCurrentValidators.

func (*MockPChainClientMockRecorder) GetHeight added in v0.1.42

func (mr *MockPChainClientMockRecorder) GetHeight(arg0 any, arg1 ...any) *gomock.Call

GetHeight indicates an expected call of GetHeight.

func (*MockPChainClientMockRecorder) GetLastAccepted added in v0.1.42

func (mr *MockPChainClientMockRecorder) GetLastAccepted(arg0 any, arg1 ...any) *gomock.Call

GetLastAccepted indicates an expected call of GetLastAccepted.

func (*MockPChainClientMockRecorder) GetNodeID added in v0.1.42

func (mr *MockPChainClientMockRecorder) GetNodeID(arg0 any, arg1 ...any) *gomock.Call

GetNodeID indicates an expected call of GetNodeID.

func (*MockPChainClientMockRecorder) GetRewardUTXOs added in v0.1.42

func (mr *MockPChainClientMockRecorder) GetRewardUTXOs(arg0, arg1 any, arg2 ...any) *gomock.Call

GetRewardUTXOs indicates an expected call of GetRewardUTXOs.

func (*MockPChainClientMockRecorder) GetStake added in v0.1.42

func (mr *MockPChainClientMockRecorder) GetStake(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call

GetStake indicates an expected call of GetStake.

func (*MockPChainClientMockRecorder) GetTx added in v0.1.42

func (mr *MockPChainClientMockRecorder) GetTx(arg0, arg1 any, arg2 ...any) *gomock.Call

GetTx indicates an expected call of GetTx.

func (*MockPChainClientMockRecorder) GetTxFee added in v0.1.42

func (mr *MockPChainClientMockRecorder) GetTxFee(arg0 any, arg1 ...any) *gomock.Call

GetTxFee indicates an expected call of GetTxFee.

func (*MockPChainClientMockRecorder) GetUTXOs added in v0.1.42

func (mr *MockPChainClientMockRecorder) GetUTXOs(arg0, arg1, arg2, arg3, arg4 any, arg5 ...any) *gomock.Call

GetUTXOs indicates an expected call of GetUTXOs.

func (*MockPChainClientMockRecorder) IsBootstrapped added in v0.1.42

func (mr *MockPChainClientMockRecorder) IsBootstrapped(arg0, arg1 any, arg2 ...any) *gomock.Call

IsBootstrapped indicates an expected call of IsBootstrapped.

func (*MockPChainClientMockRecorder) IssueTx added in v0.1.42

func (mr *MockPChainClientMockRecorder) IssueTx(arg0, arg1 any, arg2 ...any) *gomock.Call

IssueTx indicates an expected call of IssueTx.

func (*MockPChainClientMockRecorder) Peers added in v0.1.42

func (mr *MockPChainClientMockRecorder) Peers(arg0 any, arg1 ...any) *gomock.Call

Peers indicates an expected call of Peers.

type PChainClient added in v0.1.26

type PChainClient interface {
	// info.Client methods
	InfoClient
	GetNodeID(context.Context, ...rpc.Option) (ids.NodeID, *signer.ProofOfPossession, error)
	GetTxFee(context.Context, ...rpc.Option) (*info.GetTxFeeResponse, error)

	// indexer.Client methods
	// Note: we use indexer only to be able to retrieve blocks by height.
	// Blocks by ID are retrieved via platformVM.GetBlock, thus ignoring the proposerVM part
	// and using Pchain Block ID rather than encompassing Snowman++ block ID
	GetContainerByIndex(ctx context.Context, index uint64, options ...rpc.Option) (indexer.Container, error)
	GetLastAccepted(context.Context, ...rpc.Option) (indexer.Container, uint64, error)

	// platformvm.Client methods
	GetUTXOs(
		ctx context.Context,
		addrs []ids.ShortID,
		limit uint32,
		startAddress ids.ShortID,
		startUTXOID ids.ID,
		options ...rpc.Option,
	) ([][]byte, ids.ShortID, ids.ID, error)
	GetAtomicUTXOs(
		ctx context.Context,
		addrs []ids.ShortID,
		sourceChain string,
		limit uint32,
		startAddress ids.ShortID,
		startUTXOID ids.ID,
		options ...rpc.Option,
	) ([][]byte, ids.ShortID, ids.ID, error)
	GetRewardUTXOs(context.Context, *api.GetTxArgs, ...rpc.Option) ([][]byte, error)
	GetHeight(ctx context.Context, options ...rpc.Option) (uint64, error)
	GetBalance(ctx context.Context, addrs []ids.ShortID, options ...rpc.Option) (*platformvm.GetBalanceResponse, error)
	GetTx(ctx context.Context, txID ids.ID, options ...rpc.Option) ([]byte, error)
	GetBlock(ctx context.Context, blockID ids.ID, options ...rpc.Option) ([]byte, error)
	IssueTx(ctx context.Context, tx []byte, options ...rpc.Option) (ids.ID, error)
	GetStake(ctx context.Context, addrs []ids.ShortID, validatorsOnly bool, options ...rpc.Option) (map[ids.ID]uint64, [][]byte, error)
	GetCurrentValidators(ctx context.Context, subnetID ids.ID, nodeIDs []ids.NodeID, options ...rpc.Option) ([]platformvm.ClientPermissionlessValidator, error)

	// avm.Client methods
	GetAssetDescription(ctx context.Context, assetID string, options ...rpc.Option) (*avm.GetAssetDescriptionReply, error)
}

PChainClient contains all client methods used to interact with avalanchego in order to support P-chain operations in Rosetta.

These methods are cloned from the underlying avalanchego client interfaces, following the example of Client interface used to support C-chain operations.

func NewPChainClient added in v0.1.26

func NewPChainClient(_ context.Context, rpcBaseURL, indexerBaseURL string) PChainClient

NewPChainClient returns a new client for Avalanche APIs related to P-chain

type TxAccountMap

type TxAccountMap map[string]TxNonceMap

type TxNonceMap

type TxNonceMap map[string]string

type TxPoolContent

type TxPoolContent struct {
	Pending TxAccountMap `json:"pending"`
	Queued  TxAccountMap `json:"queued"`
}

type TxPoolStatus

type TxPoolStatus struct {
	PendingCount int `json:"pending"`
	QueuedCount  int `json:"queued"`
}

Jump to

Keyboard shortcuts

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