rpc

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2019 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Package rpc is a generated GoMock package.

Package rpc is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAPIs

func GetAPIs(apiBackend Backend) []rpc.API

Types

type AddrLocker

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

func (*AddrLocker) LockAddr

func (l *AddrLocker) LockAddr(address common.Address)

LockAddr locks an account's mutex. This is used to prevent another tx getting the same nonce until the lock is released. The mutex prevents the (an identical nonce) from being read again during the time that the first transaction is being signed.

func (*AddrLocker) UnlockAddr

func (l *AddrLocker) UnlockAddr(address common.Address)

UnlockAddr unlocks the mutex of the given account.

type ApiBackend

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

func NewApiBackend

func NewApiBackend(s *Service) *ApiBackend

func (*ApiBackend) AccountManager

func (b *ApiBackend) AccountManager() *accounts.Manager

func (*ApiBackend) GetWallet

func (b *ApiBackend) GetWallet() Wallet

type Backend

type Backend interface {
	AccountManager() *accounts.Manager
	GetWallet() Wallet
}

Backend interface provides the common API services (that are provided by both full and light clients) with access to necessary functions.

type Context

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

Context RPC context

func NewContext

func NewContext() *Context

func (*Context) GetWallet

func (c *Context) GetWallet() Wallet

func (*Context) SetAccountManager

func (c *Context) SetAccountManager(am *accounts.Manager)

func (*Context) SetLogger

func (c *Context) SetLogger(logger log.Logger)

func (*Context) SetWallet

func (c *Context) SetWallet(w Wallet)

type MockBackend

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

MockBackend is a mock of Backend interface

func NewMockBackend

func NewMockBackend(ctrl *gomock.Controller) *MockBackend

NewMockBackend creates a new mock instance

func (*MockBackend) AccountManager

func (m *MockBackend) AccountManager() *accounts.Manager

AccountManager mocks base method

func (*MockBackend) EXPECT

func (m *MockBackend) EXPECT() *MockBackendMockRecorder

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

func (*MockBackend) GetWallet

func (m *MockBackend) GetWallet() Wallet

GetWallet mocks base method

type MockBackendMockRecorder

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

MockBackendMockRecorder is the mock recorder for MockBackend

func (*MockBackendMockRecorder) AccountManager

func (mr *MockBackendMockRecorder) AccountManager() *gomock.Call

AccountManager indicates an expected call of AccountManager

func (*MockBackendMockRecorder) GetWallet

func (mr *MockBackendMockRecorder) GetWallet() *gomock.Call

GetWallet indicates an expected call of GetWallet

type MockWallet

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

MockWallet is a mock of Wallet interface

func NewMockWallet

func NewMockWallet(ctrl *gomock.Controller) *MockWallet

NewMockWallet creates a new mock instance

func (*MockWallet) AutoRefreshBlockchain

func (m *MockWallet) AutoRefreshBlockchain(arg0 bool, arg1 *common.Address) error

AutoRefreshBlockchain mocks base method

func (*MockWallet) Call added in v0.1.3

func (m *MockWallet) Call(arg0 types1.CallArgs, arg1 string) (*hexutil.Bytes, error)

Call mocks base method

func (*MockWallet) CreateSubAccount

func (m *MockWallet) CreateSubAccount(arg0 uint64, arg1 *common.Address) error

CreateSubAccount mocks base method

func (*MockWallet) CreateUTXOTransaction

func (m *MockWallet) CreateUTXOTransaction(arg0 common.Address, arg1 uint64, arg2 []uint64, arg3 []types0.DestEntry, arg4, arg5 common.Address, arg6 []byte) ([]*types0.UTXOTransaction, error)

CreateUTXOTransaction mocks base method

func (*MockWallet) DelUTXOAddInfo added in v0.1.2

func (m *MockWallet) DelUTXOAddInfo(arg0 common.Hash) error

DelUTXOAddInfo mocks base method

func (*MockWallet) EXPECT

func (m *MockWallet) EXPECT() *MockWalletMockRecorder

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

func (*MockWallet) EthEstimateGas

func (m *MockWallet) EthEstimateGas(arg0 types1.CallArgs) (*hexutil.Uint64, error)

EthEstimateGas mocks base method

func (*MockWallet) GetAccountInfo

func (m *MockWallet) GetAccountInfo(arg0, arg1 *common.Address) (*types1.GetAccountInfoResult, error)

GetAccountInfo mocks base method

func (*MockWallet) GetAddress

func (m *MockWallet) GetAddress(arg0 uint64, arg1 *common.Address) (string, error)

GetAddress mocks base method

func (*MockWallet) GetBalance

func (m *MockWallet) GetBalance(arg0 uint64, arg1, arg2 *common.Address) (*big.Int, error)

GetBalance mocks base method

func (*MockWallet) GetBlockTransactionCountByHash

func (m *MockWallet) GetBlockTransactionCountByHash(arg0 common.Hash) (*hexutil.Uint, error)

GetBlockTransactionCountByHash mocks base method

func (*MockWallet) GetBlockTransactionCountByNumber

func (m *MockWallet) GetBlockTransactionCountByNumber(arg0 rpc.BlockNumber) (*hexutil.Uint, error)

GetBlockTransactionCountByNumber mocks base method

func (*MockWallet) GetHeight

func (m *MockWallet) GetHeight(arg0 *common.Address) (*big.Int, *big.Int)

GetHeight mocks base method

func (*MockWallet) GetLocalOutputs added in v0.1.1

func (m *MockWallet) GetLocalOutputs(arg0 []hexutil.Uint64, arg1 *common.Address) ([]types1.UTXOOutputDetail, error)

GetLocalOutputs mocks base method

func (*MockWallet) GetLocalUTXOTxsByHeight added in v0.1.1

func (m *MockWallet) GetLocalUTXOTxsByHeight(arg0 *big.Int, arg1 *common.Address) (*types1.UTXOBlock, error)

GetLocalUTXOTxsByHeight mocks base method

func (*MockWallet) GetMaxOutput

func (m *MockWallet) GetMaxOutput(arg0 common.Address, arg1 *common.Address) (*hexutil.Uint64, error)

GetMaxOutput mocks base method

func (*MockWallet) GetRawTransactionByBlockHashAndIndex

func (m *MockWallet) GetRawTransactionByBlockHashAndIndex(arg0 common.Hash, arg1 hexutil.Uint) (hexutil.Bytes, error)

GetRawTransactionByBlockHashAndIndex mocks base method

func (*MockWallet) GetRawTransactionByBlockNumberAndIndex

func (m *MockWallet) GetRawTransactionByBlockNumberAndIndex(arg0 rpc.BlockNumber, arg1 hexutil.Uint) (hexutil.Bytes, error)

GetRawTransactionByBlockNumberAndIndex mocks base method

func (*MockWallet) GetRawTransactionByHash

func (m *MockWallet) GetRawTransactionByHash(arg0 common.Hash) (hexutil.Bytes, error)

GetRawTransactionByHash mocks base method

func (*MockWallet) GetTransactionByBlockHashAndIndex

func (m *MockWallet) GetTransactionByBlockHashAndIndex(arg0 common.Hash, arg1 hexutil.Uint) (interface{}, error)

GetTransactionByBlockHashAndIndex mocks base method

func (*MockWallet) GetTransactionByBlockNumberAndIndex

func (m *MockWallet) GetTransactionByBlockNumberAndIndex(arg0 rpc.BlockNumber, arg1 hexutil.Uint) (interface{}, error)

GetTransactionByBlockNumberAndIndex mocks base method

func (*MockWallet) GetTransactionByHash

func (m *MockWallet) GetTransactionByHash(arg0 common.Hash) (interface{}, error)

GetTransactionByHash mocks base method

func (*MockWallet) GetTransactionCount

func (m *MockWallet) GetTransactionCount(arg0 common.Address, arg1 rpc.BlockNumber) (*hexutil.Uint64, error)

GetTransactionCount mocks base method

func (*MockWallet) GetTransactionReceipt

func (m *MockWallet) GetTransactionReceipt(arg0 common.Hash) (map[string]interface{}, error)

GetTransactionReceipt mocks base method

func (*MockWallet) GetTxKey

func (m *MockWallet) GetTxKey(arg0 *common.Hash, arg1 *common.Address) (*types.Key, error)

GetTxKey mocks base method

func (*MockWallet) GetUTXOAddInfo added in v0.1.2

func (m *MockWallet) GetUTXOAddInfo(arg0 common.Hash) (*types1.UTXOAddInfo, error)

GetUTXOAddInfo mocks base method

func (*MockWallet) GetUTXOTx

func (m *MockWallet) GetUTXOTx(arg0 common.Hash, arg1 *common.Address) (*types0.UTXOTransaction, error)

GetUTXOTx mocks base method

func (*MockWallet) GetWalletEthAddress

func (m *MockWallet) GetWalletEthAddress() (*common.Address, error)

GetWalletEthAddress mocks base method

func (*MockWallet) LockAccount

func (m *MockWallet) LockAccount(arg0 common.Address) error

LockAccount mocks base method

func (*MockWallet) OpenWallet

func (m *MockWallet) OpenWallet(arg0, arg1 string) error

OpenWallet mocks base method

func (*MockWallet) RescanBlockchain

func (m *MockWallet) RescanBlockchain(arg0 *common.Address) error

RescanBlockchain mocks base method

func (*MockWallet) SelectAddress

func (m *MockWallet) SelectAddress(arg0 common.Address) error

SelectAddress mocks base method

func (*MockWallet) SendRawTransaction

func (m *MockWallet) SendRawTransaction(arg0 hexutil.Bytes) (common.Hash, error)

SendRawTransaction mocks base method

func (*MockWallet) SendRawUTXOTransaction added in v0.1.1

func (m *MockWallet) SendRawUTXOTransaction(arg0 hexutil.Bytes) (common.Hash, error)

SendRawUTXOTransaction mocks base method

func (*MockWallet) SetRefreshBlockInterval

func (m *MockWallet) SetRefreshBlockInterval(arg0 time.Duration, arg1 *common.Address) error

SetRefreshBlockInterval mocks base method

func (*MockWallet) Status

func (m *MockWallet) Status(arg0 *common.Address) *types1.StatusResult

Status mocks base method

func (*MockWallet) Transfer

func (m *MockWallet) Transfer(arg0 []string) []types1.SendTxRet

Transfer mocks base method

type MockWalletMockRecorder

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

MockWalletMockRecorder is the mock recorder for MockWallet

func (*MockWalletMockRecorder) AutoRefreshBlockchain

func (mr *MockWalletMockRecorder) AutoRefreshBlockchain(arg0, arg1 interface{}) *gomock.Call

AutoRefreshBlockchain indicates an expected call of AutoRefreshBlockchain

func (*MockWalletMockRecorder) Call added in v0.1.3

func (mr *MockWalletMockRecorder) Call(arg0, arg1 interface{}) *gomock.Call

Call indicates an expected call of Call

func (*MockWalletMockRecorder) CreateSubAccount

func (mr *MockWalletMockRecorder) CreateSubAccount(arg0, arg1 interface{}) *gomock.Call

CreateSubAccount indicates an expected call of CreateSubAccount

func (*MockWalletMockRecorder) CreateUTXOTransaction

func (mr *MockWalletMockRecorder) CreateUTXOTransaction(arg0, arg1, arg2, arg3, arg4, arg5, arg6 interface{}) *gomock.Call

CreateUTXOTransaction indicates an expected call of CreateUTXOTransaction

func (*MockWalletMockRecorder) DelUTXOAddInfo added in v0.1.2

func (mr *MockWalletMockRecorder) DelUTXOAddInfo(arg0 interface{}) *gomock.Call

DelUTXOAddInfo indicates an expected call of DelUTXOAddInfo

func (*MockWalletMockRecorder) EthEstimateGas

func (mr *MockWalletMockRecorder) EthEstimateGas(arg0 interface{}) *gomock.Call

EthEstimateGas indicates an expected call of EthEstimateGas

func (*MockWalletMockRecorder) GetAccountInfo

func (mr *MockWalletMockRecorder) GetAccountInfo(arg0, arg1 interface{}) *gomock.Call

GetAccountInfo indicates an expected call of GetAccountInfo

func (*MockWalletMockRecorder) GetAddress

func (mr *MockWalletMockRecorder) GetAddress(arg0, arg1 interface{}) *gomock.Call

GetAddress indicates an expected call of GetAddress

func (*MockWalletMockRecorder) GetBalance

func (mr *MockWalletMockRecorder) GetBalance(arg0, arg1, arg2 interface{}) *gomock.Call

GetBalance indicates an expected call of GetBalance

func (*MockWalletMockRecorder) GetBlockTransactionCountByHash

func (mr *MockWalletMockRecorder) GetBlockTransactionCountByHash(arg0 interface{}) *gomock.Call

GetBlockTransactionCountByHash indicates an expected call of GetBlockTransactionCountByHash

func (*MockWalletMockRecorder) GetBlockTransactionCountByNumber

func (mr *MockWalletMockRecorder) GetBlockTransactionCountByNumber(arg0 interface{}) *gomock.Call

GetBlockTransactionCountByNumber indicates an expected call of GetBlockTransactionCountByNumber

func (*MockWalletMockRecorder) GetHeight

func (mr *MockWalletMockRecorder) GetHeight(arg0 interface{}) *gomock.Call

GetHeight indicates an expected call of GetHeight

func (*MockWalletMockRecorder) GetLocalOutputs added in v0.1.1

func (mr *MockWalletMockRecorder) GetLocalOutputs(arg0, arg1 interface{}) *gomock.Call

GetLocalOutputs indicates an expected call of GetLocalOutputs

func (*MockWalletMockRecorder) GetLocalUTXOTxsByHeight added in v0.1.1

func (mr *MockWalletMockRecorder) GetLocalUTXOTxsByHeight(arg0, arg1 interface{}) *gomock.Call

GetLocalUTXOTxsByHeight indicates an expected call of GetLocalUTXOTxsByHeight

func (*MockWalletMockRecorder) GetMaxOutput

func (mr *MockWalletMockRecorder) GetMaxOutput(arg0, arg1 interface{}) *gomock.Call

GetMaxOutput indicates an expected call of GetMaxOutput

func (*MockWalletMockRecorder) GetRawTransactionByBlockHashAndIndex

func (mr *MockWalletMockRecorder) GetRawTransactionByBlockHashAndIndex(arg0, arg1 interface{}) *gomock.Call

GetRawTransactionByBlockHashAndIndex indicates an expected call of GetRawTransactionByBlockHashAndIndex

func (*MockWalletMockRecorder) GetRawTransactionByBlockNumberAndIndex

func (mr *MockWalletMockRecorder) GetRawTransactionByBlockNumberAndIndex(arg0, arg1 interface{}) *gomock.Call

GetRawTransactionByBlockNumberAndIndex indicates an expected call of GetRawTransactionByBlockNumberAndIndex

func (*MockWalletMockRecorder) GetRawTransactionByHash

func (mr *MockWalletMockRecorder) GetRawTransactionByHash(arg0 interface{}) *gomock.Call

GetRawTransactionByHash indicates an expected call of GetRawTransactionByHash

func (*MockWalletMockRecorder) GetTransactionByBlockHashAndIndex

func (mr *MockWalletMockRecorder) GetTransactionByBlockHashAndIndex(arg0, arg1 interface{}) *gomock.Call

GetTransactionByBlockHashAndIndex indicates an expected call of GetTransactionByBlockHashAndIndex

func (*MockWalletMockRecorder) GetTransactionByBlockNumberAndIndex

func (mr *MockWalletMockRecorder) GetTransactionByBlockNumberAndIndex(arg0, arg1 interface{}) *gomock.Call

GetTransactionByBlockNumberAndIndex indicates an expected call of GetTransactionByBlockNumberAndIndex

func (*MockWalletMockRecorder) GetTransactionByHash

func (mr *MockWalletMockRecorder) GetTransactionByHash(arg0 interface{}) *gomock.Call

GetTransactionByHash indicates an expected call of GetTransactionByHash

func (*MockWalletMockRecorder) GetTransactionCount

func (mr *MockWalletMockRecorder) GetTransactionCount(arg0, arg1 interface{}) *gomock.Call

GetTransactionCount indicates an expected call of GetTransactionCount

func (*MockWalletMockRecorder) GetTransactionReceipt

func (mr *MockWalletMockRecorder) GetTransactionReceipt(arg0 interface{}) *gomock.Call

GetTransactionReceipt indicates an expected call of GetTransactionReceipt

func (*MockWalletMockRecorder) GetTxKey

func (mr *MockWalletMockRecorder) GetTxKey(arg0, arg1 interface{}) *gomock.Call

GetTxKey indicates an expected call of GetTxKey

func (*MockWalletMockRecorder) GetUTXOAddInfo added in v0.1.2

func (mr *MockWalletMockRecorder) GetUTXOAddInfo(arg0 interface{}) *gomock.Call

GetUTXOAddInfo indicates an expected call of GetUTXOAddInfo

func (*MockWalletMockRecorder) GetUTXOTx

func (mr *MockWalletMockRecorder) GetUTXOTx(arg0, arg1 interface{}) *gomock.Call

GetUTXOTx indicates an expected call of GetUTXOTx

func (*MockWalletMockRecorder) GetWalletEthAddress

func (mr *MockWalletMockRecorder) GetWalletEthAddress() *gomock.Call

GetWalletEthAddress indicates an expected call of GetWalletEthAddress

func (*MockWalletMockRecorder) LockAccount

func (mr *MockWalletMockRecorder) LockAccount(arg0 interface{}) *gomock.Call

LockAccount indicates an expected call of LockAccount

func (*MockWalletMockRecorder) OpenWallet

func (mr *MockWalletMockRecorder) OpenWallet(arg0, arg1 interface{}) *gomock.Call

OpenWallet indicates an expected call of OpenWallet

func (*MockWalletMockRecorder) RescanBlockchain

func (mr *MockWalletMockRecorder) RescanBlockchain(arg0 interface{}) *gomock.Call

RescanBlockchain indicates an expected call of RescanBlockchain

func (*MockWalletMockRecorder) SelectAddress

func (mr *MockWalletMockRecorder) SelectAddress(arg0 interface{}) *gomock.Call

SelectAddress indicates an expected call of SelectAddress

func (*MockWalletMockRecorder) SendRawTransaction

func (mr *MockWalletMockRecorder) SendRawTransaction(arg0 interface{}) *gomock.Call

SendRawTransaction indicates an expected call of SendRawTransaction

func (*MockWalletMockRecorder) SendRawUTXOTransaction added in v0.1.1

func (mr *MockWalletMockRecorder) SendRawUTXOTransaction(arg0 interface{}) *gomock.Call

SendRawUTXOTransaction indicates an expected call of SendRawUTXOTransaction

func (*MockWalletMockRecorder) SetRefreshBlockInterval

func (mr *MockWalletMockRecorder) SetRefreshBlockInterval(arg0, arg1 interface{}) *gomock.Call

SetRefreshBlockInterval indicates an expected call of SetRefreshBlockInterval

func (*MockWalletMockRecorder) Status

func (mr *MockWalletMockRecorder) Status(arg0 interface{}) *gomock.Call

Status indicates an expected call of Status

func (*MockWalletMockRecorder) Transfer

func (mr *MockWalletMockRecorder) Transfer(arg0 interface{}) *gomock.Call

Transfer indicates an expected call of Transfer

type PrivateAccountAPI

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

PrivateAccountAPI provides an API to access accounts managed by this node. It offers methods to create, (un)lock en list accounts. Some methods accept passwords and are therefore considered private by default.

func NewPrivateAccountAPI

func NewPrivateAccountAPI(b Backend, nonceLock *AddrLocker) *PrivateAccountAPI

NewPrivateAccountAPI create a new PrivateAccountAPI.

func (*PrivateAccountAPI) GetCue

func (s *PrivateAccountAPI) GetCue(addr common.Address) (string, error)

GetCue will return address cue.

func (*PrivateAccountAPI) ListAccounts

func (s *PrivateAccountAPI) ListAccounts() []common.Address

ListAccounts will return a list of addresses for accounts this node manages.

func (*PrivateAccountAPI) LockAccount

func (s *PrivateAccountAPI) LockAccount(addr common.Address) bool

LockAccount will lock the account associated with the given address when it's unlocked.

func (*PrivateAccountAPI) NewAccount

func (s *PrivateAccountAPI) NewAccount(password string, cue string) (common.Address, error)

NewAccount will create a new account and returns the address for the new account.

func (*PrivateAccountAPI) UnlockAccount

func (s *PrivateAccountAPI) UnlockAccount(addr common.Address, password string, duration *uint64) (bool, error)

UnlockAccount will unlock the account associated with the given address with the given password for duration seconds. If duration is nil it will use a default of 300 seconds. It returns an indication if the account was unlocked.

type PublicTransactionPoolAPI

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

PublicTransactionPoolAPI exposes methods for the RPC interface

func NewPublicTransactionPoolAPI

func NewPublicTransactionPoolAPI(b Backend, nonceLock *AddrLocker) *PublicTransactionPoolAPI

NewPublicTransactionPoolAPI creates a new RPC service with methods specific for the transaction pool.

func (*PublicTransactionPoolAPI) AutoRefreshBlockchain

func (s *PublicTransactionPoolAPI) AutoRefreshBlockchain(ctx context.Context, autoRefresh bool, addr *common.Address) (bool, error)

Balance get account Balance

func (*PublicTransactionPoolAPI) Balance

Balance get account Balance

func (*PublicTransactionPoolAPI) BlockHeight

BlockHeight get block height

func (*PublicTransactionPoolAPI) Call added in v0.1.3

Call executes the given transaction on the state for the given block number. It doesn't make and changes in the state/blockchain and is useful to execute and retrieve values.

func (*PublicTransactionPoolAPI) CheckProofKey

CheckProofKey verify proof key

func (*PublicTransactionPoolAPI) CreateSubAccount

func (s *PublicTransactionPoolAPI) CreateSubAccount(ctx context.Context, maxSub hexutil.Uint64, addr *common.Address) (bool, error)

CreateSubAccount create sub account to max sub index

func (*PublicTransactionPoolAPI) EstimateGas

EstimateGas return gas

func (*PublicTransactionPoolAPI) GetAccountInfo

GetAccountInfo get all sub accounts Balance

func (*PublicTransactionPoolAPI) GetBlockTransactionCountByHash

func (s *PublicTransactionPoolAPI) GetBlockTransactionCountByHash(ctx context.Context, blockHash common.Hash) (*hexutil.Uint, error)

GetBlockTransactionCountByHash returns the number of transactions in the block with the given hash.

func (*PublicTransactionPoolAPI) GetBlockTransactionCountByNumber

func (s *PublicTransactionPoolAPI) GetBlockTransactionCountByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*hexutil.Uint, error)

GetBlockTransactionCountByNumber returns the number of transactions in the block with the given block number.

func (*PublicTransactionPoolAPI) GetLocalOutputs added in v0.1.1

GetLocalOutputs return

func (*PublicTransactionPoolAPI) GetLocalUTXOTxsByHeight added in v0.1.1

func (s *PublicTransactionPoolAPI) GetLocalUTXOTxsByHeight(ctx context.Context, height *hexutil.Big, addr *common.Address) (*wtypes.UTXOBlock, error)

GetLocalUTXOTxsByHeight return

func (*PublicTransactionPoolAPI) GetMaxOutput

func (s *PublicTransactionPoolAPI) GetMaxOutput(ctx context.Context, tokenID common.Address, addr *common.Address) (*hexutil.Uint64, error)

GetMaxOutput return max output

func (*PublicTransactionPoolAPI) GetProofKey

GetProofKey return proof key

func (*PublicTransactionPoolAPI) GetRawTransactionByBlockHashAndIndex

func (s *PublicTransactionPoolAPI) GetRawTransactionByBlockHashAndIndex(ctx context.Context, blockHash common.Hash, index hexutil.Uint) (hexutil.Bytes, error)

GetRawTransactionByBlockHashAndIndex returns the bytes of the transaction for the given block hash and index.

func (*PublicTransactionPoolAPI) GetRawTransactionByBlockNumberAndIndex

func (s *PublicTransactionPoolAPI) GetRawTransactionByBlockNumberAndIndex(ctx context.Context, blockNr rpc.BlockNumber, index hexutil.Uint) (hexutil.Bytes, error)

GetRawTransactionByBlockNumberAndIndex returns the bytes of the transaction for the given block number and index.

func (*PublicTransactionPoolAPI) GetRawTransactionByHash

func (s *PublicTransactionPoolAPI) GetRawTransactionByHash(ctx context.Context, hash common.Hash) (hexutil.Bytes, error)

GetRawTransactionByHash returns the bytes of the transaction for the given hash.

func (*PublicTransactionPoolAPI) GetTransactionByBlockHashAndIndex

func (s *PublicTransactionPoolAPI) GetTransactionByBlockHashAndIndex(ctx context.Context, blockHash common.Hash, index hexutil.Uint) (interface{}, error)

GetTransactionByBlockHashAndIndex returns the transaction for the given block hash and index.

func (*PublicTransactionPoolAPI) GetTransactionByBlockNumberAndIndex

func (s *PublicTransactionPoolAPI) GetTransactionByBlockNumberAndIndex(ctx context.Context, blockNr rpc.BlockNumber, index hexutil.Uint) (interface{}, error)

GetTransactionByBlockNumberAndIndex returns the transaction for the given block number and index.

func (*PublicTransactionPoolAPI) GetTransactionByHash

func (s *PublicTransactionPoolAPI) GetTransactionByHash(ctx context.Context, hash common.Hash) (interface{}, error)

GetTransactionByHash returns the transaction for the given hash

func (*PublicTransactionPoolAPI) GetTransactionCount

func (s *PublicTransactionPoolAPI) GetTransactionCount(ctx context.Context, address common.Address, blockNr rpc.BlockNumber) (*hexutil.Uint64, error)

GetTransactionCount returns the number of transactions the given address has sent for the given block number

func (*PublicTransactionPoolAPI) GetTransactionReceipt

func (s *PublicTransactionPoolAPI) GetTransactionReceipt(ctx context.Context, hash common.Hash) (map[string]interface{}, error)

GetTransactionReceipt returns the transaction receipt for the given transaction hash.

func (*PublicTransactionPoolAPI) GetTxKey

func (s *PublicTransactionPoolAPI) GetTxKey(ctx context.Context, hash common.Hash, addr *common.Address) (*lkctypes.Key, error)

GetTxKey return tx key

func (*PublicTransactionPoolAPI) RescanBlockchain

func (s *PublicTransactionPoolAPI) RescanBlockchain(ctx context.Context, addr *common.Address) (bool, error)

RescanBlockchain reset wallet block and transfer info

func (*PublicTransactionPoolAPI) SelectAddress

func (s *PublicTransactionPoolAPI) SelectAddress(ctx context.Context, addr common.Address) (bool, error)

SelectAddress set wallet curr account

func (*PublicTransactionPoolAPI) SendRawTransaction

func (s *PublicTransactionPoolAPI) SendRawTransaction(ctx context.Context, encodedTx hexutil.Bytes) (common.Hash, error)

func (*PublicTransactionPoolAPI) SendRawUTXOTransaction added in v0.1.1

func (s *PublicTransactionPoolAPI) SendRawUTXOTransaction(ctx context.Context, encodedTx hexutil.Bytes) (common.Hash, error)

func (*PublicTransactionPoolAPI) SendUTXOTransaction

SendUTXOTransaction send utxo tx

func (*PublicTransactionPoolAPI) SendUTXOTransactionSplit

SendUTXOTransactionSplit send utxo tx

func (*PublicTransactionPoolAPI) SetRefreshBlockInterval

func (s *PublicTransactionPoolAPI) SetRefreshBlockInterval(ctx context.Context, interval time.Duration, addr *common.Address) (bool, error)

SetRefreshBlockInterval set wallet curr account

func (*PublicTransactionPoolAPI) SignHash added in v0.1.3

func (s *PublicTransactionPoolAPI) SignHash(addr common.Address, hash common.Hash) (hexutil.Bytes, error)

SignHash is a rpc function that signs a hash with the private key of the given address.

func (*PublicTransactionPoolAPI) SignTransaction

func (*PublicTransactionPoolAPI) SignUTXOTransaction

SignUTXOTransaction will sign the given transaction with the from account. The node needs to have the private key of the account corresponding with the given from address and it needs to be unlocked.

func (*PublicTransactionPoolAPI) Status

Status return wallet status

func (*PublicTransactionPoolAPI) TokenCall added in v0.1.3

TokenCall executes the given tokenTransaction on the state for the given block number. It doesn't make and changes in the state/blockchain and is useful to execute and retrieve values.

type Service

type Service struct {
	cmn.BaseService
	// contains filtered or unexported fields
}

Service RPC service

func NewService

func NewService(cfg *config.Config, ctx *Context) (*Service, error)

NewService create new RPC service

func (*Service) Start

func (s *Service) Start() error

Start rpc service

func (*Service) Stop

func (s *Service) Stop() error

Stop rpc service

type Wallet

type Wallet interface {
	CreateUTXOTransaction(from common.Address, nonce uint64, subaddrs []uint64, dests []types.DestEntry,
		tokenID common.Address, refundAddr common.Address, extra []byte) ([]*types.UTXOTransaction, error)
	GetBalance(index uint64, token *common.Address, addr *common.Address) (*big.Int, error)
	GetHeight(addr *common.Address) (localHeight *big.Int, remoteHeight *big.Int)
	GetAddress(index uint64, addr *common.Address) (string, error)
	Transfer(txs []string) (ret []wtypes.SendTxRet)
	OpenWallet(walletfile string, password string) error
	CreateSubAccount(maxSub uint64, addr *common.Address) error
	AutoRefreshBlockchain(autoRefresh bool, addr *common.Address) error
	GetAccountInfo(tokenID *common.Address, addr *common.Address) (*wtypes.GetAccountInfoResult, error)
	RescanBlockchain(addr *common.Address) error
	GetWalletEthAddress() (*common.Address, error)
	Status(addr *common.Address) *wtypes.StatusResult
	GetTxKey(hash *common.Hash, addr *common.Address) (*lkctypes.Key, error)
	GetMaxOutput(tokenID common.Address, addr *common.Address) (*hexutil.Uint64, error)
	GetUTXOTx(hash common.Hash, addr *common.Address) (*types.UTXOTransaction, error)
	SelectAddress(addr common.Address) error
	SetRefreshBlockInterval(interval time.Duration, addr *common.Address) error
	LockAccount(addr common.Address) error
	// CheckTxKey(hash *common.Hash, txKey *lkctypes.Key, destAddr string) (*hexutil.Uint64, *hexutil.Big, error)
	//
	GetBlockTransactionCountByNumber(blockNr rpc.BlockNumber) (*hexutil.Uint, error)
	GetBlockTransactionCountByHash(blockHash common.Hash) (*hexutil.Uint, error)
	GetTransactionByBlockNumberAndIndex(blockNr rpc.BlockNumber, index hexutil.Uint) (r interface{}, err error)
	GetTransactionByBlockHashAndIndex(blockHash common.Hash, index hexutil.Uint) (r interface{}, err error)
	GetRawTransactionByBlockNumberAndIndex(blockNr rpc.BlockNumber, index hexutil.Uint) (r hexutil.Bytes, err error)
	GetRawTransactionByBlockHashAndIndex(blockHash common.Hash, index hexutil.Uint) (r hexutil.Bytes, err error)
	GetTransactionCount(address common.Address, blockNr rpc.BlockNumber) (*hexutil.Uint64, error)
	GetTransactionByHash(hash common.Hash) (r interface{}, err error)
	GetRawTransactionByHash(hash common.Hash) (r hexutil.Bytes, err error)
	GetTransactionReceipt(hash common.Hash) (r map[string]interface{}, err error)
	Call(args wtypes.CallArgs, blockNr string) (*hexutil.Bytes, error)
	//
	EthEstimateGas(args wtypes.CallArgs) (*hexutil.Uint64, error)
	SendRawTransaction(encodedTx hexutil.Bytes) (common.Hash, error)
	SendRawUTXOTransaction(encodedTx hexutil.Bytes) (common.Hash, error)
	GetLocalUTXOTxsByHeight(height *big.Int, addr *common.Address) (*wtypes.UTXOBlock, error)
	GetLocalOutputs(ids []hexutil.Uint64, addr *common.Address) ([]wtypes.UTXOOutputDetail, error)
	GetUTXOAddInfo(hash common.Hash) (*wtypes.UTXOAddInfo, error)
	DelUTXOAddInfo(hash common.Hash) error
}

Wallet wallet

Jump to

Keyboard shortcuts

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