rpc

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: MIT Imports: 14 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PopInvokeStacks added in v1.2.0

func PopInvokeStacks(response InvokeResultResponse) ([]models.InvokeStack, error)

Types

type CalculateNetworkFeeResponse

type CalculateNetworkFeeResponse struct {
	RpcResponse
	ErrorResponse
	Result models.RpcNetworkFee `json:"result"`
}

type CloseWalletResponse

type CloseWalletResponse struct {
	RpcResponse
	ErrorResponse
	Result bool `json:"result"`
}

type DumpPrivKeyResponse

type DumpPrivKeyResponse struct {
	RpcResponse
	ErrorResponse
	Result string `json:"result"`
}

type ErrorResponse

type ErrorResponse struct {
	Error    RpcError `json:"error"`
	NetError error
}

func (*ErrorResponse) GetErrorInfo added in v0.2.2

func (r *ErrorResponse) GetErrorInfo() string

func (*ErrorResponse) HasError

func (r *ErrorResponse) HasError() bool

type GetApplicationLogResponse

type GetApplicationLogResponse struct {
	RpcResponse
	ErrorResponse
	Result models.RpcApplicationLog `json:"result"`
}

type GetBestBlockHashResponse

type GetBestBlockHashResponse struct {
	RpcResponse
	ErrorResponse
	Result string `json:"result"`
}

type GetBlockCountResponse

type GetBlockCountResponse struct {
	RpcResponse
	ErrorResponse
	Result int `json:"result"`
}

type GetBlockHashResponse

type GetBlockHashResponse struct {
	RpcResponse
	ErrorResponse
	Result string `json:"result"`
}

type GetBlockHeaderResponse

type GetBlockHeaderResponse struct {
	RpcResponse
	ErrorResponse
	Result models.RpcBlockHeader `json:"result"`
}

type GetBlockResponse

type GetBlockResponse struct {
	RpcResponse
	ErrorResponse
	Result models.RpcBlock `json:"result"`
}

type GetBlockSysFeeResponse

type GetBlockSysFeeResponse struct {
	RpcResponse
	ErrorResponse
	Result string `json:"result"`
}

type GetCandidatesResponse added in v1.2.0

type GetCandidatesResponse struct {
	RpcResponse
	ErrorResponse
	Result []models.RpcCandidates `json:"result"`
}

type GetCommitteeResponse

type GetCommitteeResponse struct {
	RpcResponse
	ErrorResponse
	Result []string `json:"result"`
}

type GetConnectionCountResponse

type GetConnectionCountResponse struct {
	RpcResponse
	ErrorResponse
	Result int `json:"result"`
}

type GetContractStateResponse

type GetContractStateResponse struct {
	RpcResponse
	ErrorResponse
	Result models.RpcContractState `json:"result"`
}

type GetCrossChainProofResponse

type GetCrossChainProofResponse struct {
	RpcResponse
	ErrorResponse
	CrossChainProof string `json:"result"`
}

type GetNativeContractsResponse added in v0.3.8

type GetNativeContractsResponse struct {
	RpcResponse
	ErrorResponse
	Result []models.RpcNativeContract `json:"result"`
}

type GetNep11BalancesResponse added in v1.2.0

type GetNep11BalancesResponse struct {
	RpcResponse
	ErrorResponse
	Result models.RpcNep11Balances `json:"result"`
}

type GetNep11PropertiesResponse added in v1.2.0

type GetNep11PropertiesResponse struct {
	RpcResponse
	ErrorResponse
	Result map[string]string `json:"result"`
}

type GetNep11TransfersResponse added in v1.2.0

type GetNep11TransfersResponse struct {
	RpcResponse
	ErrorResponse
	Result models.RpcNep11Transfers `json:"result"`
}

type GetNep17BalancesResponse

type GetNep17BalancesResponse struct {
	RpcResponse
	ErrorResponse
	Result models.RpcNep17Balances `json:"result"`
}

type GetNep17TransfersResponse

type GetNep17TransfersResponse struct {
	RpcResponse
	ErrorResponse
	Result models.RpcNep17Transfers `json:"result"`
}

type GetNewAddressResponse

type GetNewAddressResponse struct {
	RpcResponse
	ErrorResponse
	Result string `json:"result"`
}

type GetNextBlockValidatorsResponse

type GetNextBlockValidatorsResponse struct {
	RpcResponse
	ErrorResponse
	Result []models.RpcValidator `json:"result"`
}

type GetPeersResponse

type GetPeersResponse struct {
	RpcResponse
	ErrorResponse
	Result models.RpcPeers `json:"result"`
}

type GetProofResponse

type GetProofResponse struct {
	RpcResponse
	ErrorResponse
	Result string `json:"result"`
}

type GetRawMemPoolResponse

type GetRawMemPoolResponse struct {
	RpcResponse
	ErrorResponse
	Result []string `json:"result"`
}

type GetRawTransactionResponse

type GetRawTransactionResponse struct {
	RpcResponse
	ErrorResponse
	Result models.RpcTransaction `json:"result"`
}

type GetStateHeightResponse

type GetStateHeightResponse struct {
	RpcResponse
	ErrorResponse
	Result models.RpcStateHeight `json:"result"`
}

type GetStateRootResponse

type GetStateRootResponse struct {
	RpcResponse
	ErrorResponse
	Result mpt.StateRoot `json:"result"`
}

type GetStorageResponse

type GetStorageResponse struct {
	RpcResponse
	ErrorResponse
	Result string `json:"result"`
}

type GetTransactionHeightResponse

type GetTransactionHeightResponse struct {
	RpcResponse
	ErrorResponse
	Result int `json:"result"`
}

type GetUnclaimedGasResponse

type GetUnclaimedGasResponse struct {
	RpcResponse
	ErrorResponse
	Result models.UnclaimedGas `json:"result"`
}

type GetVersionResponse

type GetVersionResponse struct {
	RpcResponse
	ErrorResponse
	Result models.RpcVersion `json:"result"`
}

type GetWalletBalanceResponse

type GetWalletBalanceResponse struct {
	RpcResponse
	ErrorResponse
	Result models.RpcWalletBalance `json:"result"`
}

type GetWalletUnclaimedGasResponse

type GetWalletUnclaimedGasResponse struct {
	RpcResponse
	ErrorResponse
	Result string `json:"result"`
}

type IHttpClient

type IHttpClient interface {
	Do(req *http.Request) (*http.Response, error)
}

IHttpClient for mock unit test

type IRpcClient

type IRpcClient interface {
	GetUrl() string

	// Blockchain
	GetBestBlockHash() GetBestBlockHashResponse
	GetBlock(hashOrIndex string) GetBlockResponse
	GetBlockCount() GetBlockCountResponse
	GetBlockHash(index uint32) GetBlockHashResponse
	GetBlockHeader(hashOrIndex string) GetBlockHeaderResponse
	GetBlockHeaderCount() GetBlockCountResponse // todo
	GetContractState(hash string) GetContractStateResponse
	GetRawMemPool() GetRawMemPoolResponse
	GetRawTransaction(hash string) GetRawTransactionResponse
	GetStorage(scriptHash string, key string) GetStorageResponse
	GetTransactionHeight(hash string) GetTransactionHeightResponse
	GetNextBlockValidators() GetNextBlockValidatorsResponse
	GetCandidates() GetCandidatesResponse // todo
	GetCommittee() GetCommitteeResponse
	GetNativeContracts() GetNativeContractsResponse

	// Node
	GetConnectionCount() GetConnectionCountResponse
	GetPeers() GetPeersResponse
	GetVersion() GetVersionResponse
	SendRawTransaction(tx string) SendRawTransactionResponse
	SubmitBlock(block string) SubmitBlockResponse

	// Plugins
	GetApplicationLog(txId string) GetApplicationLogResponse
	GetNep11Balances(address string) GetNep11BalancesResponse
	GetNep11Transfers(address string, startTime *int, endTime *int) GetNep11TransfersResponse
	GetNep11Properties(assetHash string, tokenId string) GetNep11PropertiesResponse
	GetNep17Balances(address string) GetNep17BalancesResponse
	GetNep17Transfers(address string, startTimestamp *int, endTimestamp *int) GetNep17TransfersResponse

	// SmartContract
	InvokeFunction(scriptHash string, method string, args []models.RpcContractParameter, signersOrWitnesses interface{}, useDiagnostic bool) InvokeResultResponse
	InvokeScript(scriptInBase64 string, signersOrWitnesses interface{}, useDiagnostic bool) InvokeResultResponse
	TraverseIterator(sessionId string, iteratorId string, count int32) TraverseIteratorResponse
	TerminateSession(sessionId string) TerminateSessionResponse
	GetUnclaimedGas(address string) GetUnclaimedGasResponse

	// State
	GetProof(rootHash, contractScriptHash, storeKey string) GetProofResponse
	GetStateHeight() GetStateHeightResponse
	GetStateRoot(blockHeight uint32) GetStateRootResponse
	VerifyProof(rootHash string, proofInBase64 string) VerifyProofResponse

	// utilities
	ListPlugins() ListPluginsResponse
	ValidateAddress(address string) ValidateAddressResponse

	// wallet
	CloseWallet() CloseWalletResponse
	DumpPrivKey(address string) DumpPrivKeyResponse
	GetNewAddress() GetNewAddressResponse
	GetWalletBalance(assetId string) GetWalletBalanceResponse
	GetWalletUnclaimedGas() GetWalletUnclaimedGasResponse
	ImportPrivKey(wif string) ImportPrivKeyResponse
	CalculateNetworkFee(tx string) CalculateNetworkFeeResponse
	ListAddress() ListAddressResponse
	OpenWallet(path string, password string) OpenWalletResponse
	SendFrom(assetId string, from string, to string, amount string, signers []string) SendFromResponse
	SendMany(fromAddress string, toAddresses []string, signerAddresses []string) SendManyResponse
	SendToAddress(assetId string, toAddress string, amount string) SendToAddressResponse
	InvokeContractVerify(scriptHash string, args []models.RpcContractParameter, signersOrWitnesses interface{}) InvokeResultResponse
}

IRpcClient is used for mock UT

type ImportPrivKeyResponse

type ImportPrivKeyResponse struct {
	RpcResponse
	ErrorResponse
	Result models.RpcAddress `json:"result"`
}

type InvokeResultResponse

type InvokeResultResponse struct {
	RpcResponse
	ErrorResponse
	Result models.InvokeResult `json:"result"`
}

type ListAddressResponse

type ListAddressResponse struct {
	RpcResponse
	ErrorResponse
	Result []models.RpcAddress `json:"result"`
}

type ListPluginsResponse

type ListPluginsResponse struct {
	RpcResponse
	ErrorResponse
	Result []models.RpcListPlugin `json:"result"`
}

type OpenWalletResponse

type OpenWalletResponse struct {
	RpcResponse
	ErrorResponse
	Result bool `json:"result"`
}

type RpcClient

type RpcClient struct {
	Endpoint *url.URL
	// contains filtered or unexported fields
}

func NewClient

func NewClient(endpoint string) *RpcClient

func (*RpcClient) CalculateNetworkFee

func (n *RpcClient) CalculateNetworkFee(tx string) CalculateNetworkFeeResponse

func (*RpcClient) CloseWallet

func (n *RpcClient) CloseWallet() CloseWalletResponse

func (*RpcClient) DumpPrivKey

func (n *RpcClient) DumpPrivKey(address string) DumpPrivKeyResponse

func (*RpcClient) GetApplicationLog

func (n *RpcClient) GetApplicationLog(txId string) GetApplicationLogResponse

GetApplicationLog needs the ApplicationLogs plugin

func (*RpcClient) GetBestBlockHash

func (n *RpcClient) GetBestBlockHash() GetBestBlockHashResponse

func (*RpcClient) GetBlock

func (n *RpcClient) GetBlock(hashOrIndex string) GetBlockResponse

func (*RpcClient) GetBlockCount

func (n *RpcClient) GetBlockCount() GetBlockCountResponse

func (*RpcClient) GetBlockHash

func (n *RpcClient) GetBlockHash(index uint32) GetBlockHashResponse

func (*RpcClient) GetBlockHeader

func (n *RpcClient) GetBlockHeader(hashOrIndex string) GetBlockHeaderResponse

func (*RpcClient) GetBlockHeaderCount added in v1.2.0

func (n *RpcClient) GetBlockHeaderCount() GetBlockCountResponse

func (*RpcClient) GetCandidates added in v1.2.0

func (n *RpcClient) GetCandidates() GetCandidatesResponse

func (*RpcClient) GetCommittee

func (n *RpcClient) GetCommittee() GetCommitteeResponse

func (*RpcClient) GetConnectionCount

func (n *RpcClient) GetConnectionCount() GetConnectionCountResponse

func (*RpcClient) GetContractState

func (n *RpcClient) GetContractState(scriptHash string) GetContractStateResponse

func (*RpcClient) GetCrossChainProof

func (n *RpcClient) GetCrossChainProof(blockIndex int, txID string) GetCrossChainProofResponse

func (*RpcClient) GetNativeContracts added in v0.3.8

func (n *RpcClient) GetNativeContracts() GetNativeContractsResponse

func (*RpcClient) GetNep11Balances added in v1.2.0

func (n *RpcClient) GetNep11Balances(address string) GetNep11BalancesResponse

GetNep11Balances needs the TokensTracker plugin

func (*RpcClient) GetNep11Properties added in v1.2.0

func (n *RpcClient) GetNep11Properties(assetHash string, tokenId string) GetNep11PropertiesResponse

GetNep11Properties needs the TokensTracker plugin

func (*RpcClient) GetNep11Transfers added in v1.2.0

func (n *RpcClient) GetNep11Transfers(address string, startTime *int, endTime *int) GetNep11TransfersResponse

GetNep11Transfers needs the TokensTracker plugin

func (*RpcClient) GetNep17Balances

func (n *RpcClient) GetNep17Balances(address string) GetNep17BalancesResponse

GetNep17Balances needs the TokensTracker plugin

func (*RpcClient) GetNep17Transfers

func (n *RpcClient) GetNep17Transfers(address string, startTime *int, endTime *int) GetNep17TransfersResponse

GetNep17Transfers needs the TokensTracker plugin

func (*RpcClient) GetNewAddress

func (n *RpcClient) GetNewAddress() GetNewAddressResponse

func (*RpcClient) GetNextBlockValidators

func (n *RpcClient) GetNextBlockValidators() GetNextBlockValidatorsResponse

func (*RpcClient) GetPeers

func (n *RpcClient) GetPeers() GetPeersResponse

func (*RpcClient) GetProof

func (n *RpcClient) GetProof(rootHash, contractScriptHash, storeKey string) GetProofResponse

func (*RpcClient) GetRawMemPool

func (n *RpcClient) GetRawMemPool() GetRawMemPoolResponse

func (*RpcClient) GetRawTransaction

func (n *RpcClient) GetRawTransaction(txid string) GetRawTransactionResponse

func (*RpcClient) GetStateHeight

func (n *RpcClient) GetStateHeight() GetStateHeightResponse

func (*RpcClient) GetStateRoot

func (n *RpcClient) GetStateRoot(blockHeight uint32) GetStateRootResponse

func (*RpcClient) GetStorage

func (n *RpcClient) GetStorage(scripthash string, key string) GetStorageResponse

func (*RpcClient) GetTransactionHeight

func (n *RpcClient) GetTransactionHeight(txid string) GetTransactionHeightResponse

func (*RpcClient) GetUnclaimedGas

func (n *RpcClient) GetUnclaimedGas(address string) GetUnclaimedGasResponse

func (*RpcClient) GetUrl

func (n *RpcClient) GetUrl() string

func (*RpcClient) GetVersion

func (n *RpcClient) GetVersion() GetVersionResponse

func (*RpcClient) GetWalletBalance

func (n *RpcClient) GetWalletBalance(assetId string) GetWalletBalanceResponse

func (*RpcClient) GetWalletUnclaimedGas

func (n *RpcClient) GetWalletUnclaimedGas() GetWalletUnclaimedGasResponse

func (*RpcClient) ImportPrivKey

func (n *RpcClient) ImportPrivKey(wif string) ImportPrivKeyResponse

func (*RpcClient) InvokeContractVerify

func (n *RpcClient) InvokeContractVerify(scriptHash string, args []models.RpcContractParameter,
	signersOrWitnesses interface{}) InvokeResultResponse

func (*RpcClient) InvokeFunction

func (n *RpcClient) InvokeFunction(scriptHash string, method string, args []models.RpcContractParameter,
	signersOrWitnesses interface{}, useDiagnostic bool) InvokeResultResponse

InvokeFunction params: scriptHash and method are necessary, set args = nil, signersOrWitnesses = nil, useDiagnostic = false if not necessary

func (*RpcClient) InvokeFunctionAndIterate added in v1.2.0

func (n *RpcClient) InvokeFunctionAndIterate(scriptHash string, method string, args []models.RpcContractParameter,
	signersOrWitnesses interface{}, useDiagnostic bool, count int32) ([][]models.InvokeStack, error)

func (*RpcClient) InvokeScript

func (n *RpcClient) InvokeScript(scriptInBase64 string, signersOrWitnesses interface{}, useDiagnostic bool) InvokeResultResponse

InvokeScript params: scriptInBase64 is necessary, set signersOrWitnesses = nil, useDiagnostic = false if not necessary

func (*RpcClient) InvokeScriptAndIterate added in v1.2.0

func (n *RpcClient) InvokeScriptAndIterate(scriptInBase64 string, signersOrWitnesses interface{}, useDiagnostic bool,
	count int32) ([][]models.InvokeStack, error)

func (*RpcClient) ListAddress

func (n *RpcClient) ListAddress() ListAddressResponse

func (*RpcClient) ListPlugins

func (n *RpcClient) ListPlugins() ListPluginsResponse

func (*RpcClient) OpenWallet

func (n *RpcClient) OpenWallet(path string, password string) OpenWalletResponse

func (*RpcClient) SendFrom

func (n *RpcClient) SendFrom(assetId string, fromAddress string, toAddress string, amount string, signerAddresses []string) SendFromResponse

func (*RpcClient) SendMany

func (n *RpcClient) SendMany(fromAddress string, toAddresses []string, signerAddresses []string) SendManyResponse

func (*RpcClient) SendRawTransaction

func (n *RpcClient) SendRawTransaction(rawTransactionInHex string) SendRawTransactionResponse

func (*RpcClient) SendToAddress

func (n *RpcClient) SendToAddress(assetId string, toAddress string, amount string) SendToAddressResponse

func (*RpcClient) SetBasicAuth

func (n *RpcClient) SetBasicAuth(user string, pass string)

func (*RpcClient) SubmitBlock

func (n *RpcClient) SubmitBlock(blockHex string) SubmitBlockResponse

func (*RpcClient) TerminateSession added in v1.2.0

func (n *RpcClient) TerminateSession(sessionId string) TerminateSessionResponse

func (*RpcClient) TraverseIterator added in v1.2.0

func (n *RpcClient) TraverseIterator(sessionId string, iteratorId string, count int32) TraverseIteratorResponse

func (*RpcClient) ValidateAddress

func (n *RpcClient) ValidateAddress(address string) ValidateAddressResponse

func (*RpcClient) VerifyProof

func (n *RpcClient) VerifyProof(rootHash string, proofInBase64 string) VerifyProofResponse

type RpcClientMock

type RpcClientMock struct {
	mock.Mock
}

func (*RpcClientMock) CalculateNetworkFee

func (r *RpcClientMock) CalculateNetworkFee(s string) CalculateNetworkFeeResponse

func (*RpcClientMock) CloseWallet

func (r *RpcClientMock) CloseWallet() CloseWalletResponse

func (*RpcClientMock) DumpPrivKey

func (r *RpcClientMock) DumpPrivKey(s string) DumpPrivKeyResponse

func (*RpcClientMock) GetApplicationLog

func (r *RpcClientMock) GetApplicationLog(s string) GetApplicationLogResponse

func (*RpcClientMock) GetBestBlockHash

func (r *RpcClientMock) GetBestBlockHash() GetBestBlockHashResponse

func (*RpcClientMock) GetBlock

func (r *RpcClientMock) GetBlock(hashOrIndex string) GetBlockResponse

func (*RpcClientMock) GetBlockCount

func (r *RpcClientMock) GetBlockCount() GetBlockCountResponse

func (*RpcClientMock) GetBlockHash

func (r *RpcClientMock) GetBlockHash(n uint32) GetBlockHashResponse

func (*RpcClientMock) GetBlockHeader

func (r *RpcClientMock) GetBlockHeader(hashOrIndex string) GetBlockHeaderResponse

func (*RpcClientMock) GetBlockHeaderCount added in v1.2.0

func (r *RpcClientMock) GetBlockHeaderCount() GetBlockCountResponse

func (*RpcClientMock) GetBlockSysFee

func (r *RpcClientMock) GetBlockSysFee(height int) GetBlockSysFeeResponse

func (*RpcClientMock) GetCandidates added in v1.2.0

func (r *RpcClientMock) GetCandidates() GetCandidatesResponse

func (*RpcClientMock) GetCommittee

func (r *RpcClientMock) GetCommittee() GetCommitteeResponse

func (*RpcClientMock) GetConnectionCount

func (r *RpcClientMock) GetConnectionCount() GetConnectionCountResponse

func (*RpcClientMock) GetContractState

func (r *RpcClientMock) GetContractState(s string) GetContractStateResponse

func (*RpcClientMock) GetNativeContracts added in v0.3.8

func (r *RpcClientMock) GetNativeContracts() GetNativeContractsResponse

func (*RpcClientMock) GetNep11Balances added in v1.2.0

func (r *RpcClientMock) GetNep11Balances(s string) GetNep11BalancesResponse

func (*RpcClientMock) GetNep11Properties added in v1.2.0

func (r *RpcClientMock) GetNep11Properties(s1 string, s2 string) GetNep11PropertiesResponse

func (*RpcClientMock) GetNep11Transfers added in v1.2.0

func (r *RpcClientMock) GetNep11Transfers(s string, t1 *int, t2 *int) GetNep11TransfersResponse

func (*RpcClientMock) GetNep17Balances

func (r *RpcClientMock) GetNep17Balances(s string) GetNep17BalancesResponse

func (*RpcClientMock) GetNep17Transfers

func (r *RpcClientMock) GetNep17Transfers(s string, t1 *int, t2 *int) GetNep17TransfersResponse

func (*RpcClientMock) GetNewAddress

func (r *RpcClientMock) GetNewAddress() GetNewAddressResponse

func (*RpcClientMock) GetNextBlockValidators

func (r *RpcClientMock) GetNextBlockValidators() GetNextBlockValidatorsResponse

func (*RpcClientMock) GetPeers

func (r *RpcClientMock) GetPeers() GetPeersResponse

func (*RpcClientMock) GetProof

func (r *RpcClientMock) GetProof(s1, s2, s3 string) GetProofResponse

func (*RpcClientMock) GetRawMemPool

func (r *RpcClientMock) GetRawMemPool() GetRawMemPoolResponse

func (*RpcClientMock) GetRawTransaction

func (r *RpcClientMock) GetRawTransaction(s string) GetRawTransactionResponse

func (*RpcClientMock) GetStateHeight

func (r *RpcClientMock) GetStateHeight() GetStateHeightResponse

func (*RpcClientMock) GetStateRoot

func (r *RpcClientMock) GetStateRoot(u uint32) GetStateRootResponse

func (*RpcClientMock) GetStorage

func (r *RpcClientMock) GetStorage(s1 string, s2 string) GetStorageResponse

func (*RpcClientMock) GetTransactionHeight

func (r *RpcClientMock) GetTransactionHeight(s string) GetTransactionHeightResponse

func (*RpcClientMock) GetUnclaimedGas

func (r *RpcClientMock) GetUnclaimedGas(s string) GetUnclaimedGasResponse

func (*RpcClientMock) GetUrl

func (r *RpcClientMock) GetUrl() string

func (*RpcClientMock) GetVersion

func (r *RpcClientMock) GetVersion() GetVersionResponse

func (*RpcClientMock) GetWalletBalance

func (r *RpcClientMock) GetWalletBalance(s string) GetWalletBalanceResponse

func (*RpcClientMock) GetWalletUnclaimedGas

func (r *RpcClientMock) GetWalletUnclaimedGas() GetWalletUnclaimedGasResponse

func (*RpcClientMock) ImportPrivKey

func (r *RpcClientMock) ImportPrivKey(s string) ImportPrivKeyResponse

func (*RpcClientMock) InvokeContractVerify

func (r *RpcClientMock) InvokeContractVerify(s string, a []models.RpcContractParameter, sw interface{}) InvokeResultResponse

func (*RpcClientMock) InvokeFunction

func (r *RpcClientMock) InvokeFunction(s1 string, s2 string, a []models.RpcContractParameter,
	signersOrWitnesses interface{}, b bool) InvokeResultResponse

func (*RpcClientMock) InvokeScript

func (r *RpcClientMock) InvokeScript(s string, signersOrWitnesses interface{}, b bool) InvokeResultResponse

func (*RpcClientMock) ListAddress

func (r *RpcClientMock) ListAddress() ListAddressResponse

func (*RpcClientMock) ListPlugins

func (r *RpcClientMock) ListPlugins() ListPluginsResponse

func (*RpcClientMock) OpenWallet

func (r *RpcClientMock) OpenWallet(s1 string, s2 string) OpenWalletResponse

func (*RpcClientMock) SendFrom

func (r *RpcClientMock) SendFrom(s1, s2, s3, s4 string, ss []string) SendFromResponse

func (*RpcClientMock) SendMany

func (r *RpcClientMock) SendMany(s string, ss []string, sn []string) SendManyResponse

func (*RpcClientMock) SendRawTransaction

func (r *RpcClientMock) SendRawTransaction(s string) SendRawTransactionResponse

func (*RpcClientMock) SendToAddress

func (r *RpcClientMock) SendToAddress(s1, s2, s3 string) SendToAddressResponse

func (*RpcClientMock) SubmitBlock

func (r *RpcClientMock) SubmitBlock(s string) SubmitBlockResponse

func (*RpcClientMock) TerminateSession added in v1.2.0

func (r *RpcClientMock) TerminateSession(s string) TerminateSessionResponse

func (*RpcClientMock) TraverseIterator added in v1.2.0

func (r *RpcClientMock) TraverseIterator(s1 string, s2 string, c int32) TraverseIteratorResponse

func (*RpcClientMock) ValidateAddress

func (r *RpcClientMock) ValidateAddress(s string) ValidateAddressResponse

func (*RpcClientMock) VerifyProof

func (r *RpcClientMock) VerifyProof(s string, p string) VerifyProofResponse

type RpcError

type RpcError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type RpcRequest

type RpcRequest struct {
	JsonRpc string        `json:"jsonrpc"`
	Method  string        `json:"method"`
	Params  []interface{} `json:"params"`
	ID      int           `json:"id"`
}

func NewRequest

func NewRequest(method string, params []interface{}) RpcRequest

type RpcResponse

type RpcResponse struct {
	JsonRpc string `json:"jsonrpc"`
	ID      int    `json:"id"`
}

type SendFromResponse

type SendFromResponse struct {
	RpcResponse
	ErrorResponse
	Result models.RpcTransaction `json:"result"`
}

type SendManyResponse

type SendManyResponse struct {
	RpcResponse
	ErrorResponse
	Result models.RpcTransaction `json:"result"`
}

type SendRawTransactionResponse

type SendRawTransactionResponse struct {
	RpcResponse
	ErrorResponse
	Result struct {
		Hash string `json:"hash"`
	} `json:"result"`
}

type SendToAddressResponse

type SendToAddressResponse struct {
	RpcResponse
	ErrorResponse
	Result models.RpcTransaction `json:"result"`
}

type SubmitBlockResponse

type SubmitBlockResponse struct {
	RpcResponse
	ErrorResponse
	Result struct {
		Hash string `json:"hash"`
	} `json:"result"`
}

type TerminateSessionResponse added in v1.2.0

type TerminateSessionResponse struct {
	RpcResponse
	ErrorResponse
	Result bool `json:"result"`
}

type TraverseIteratorResponse added in v1.2.0

type TraverseIteratorResponse struct {
	RpcResponse
	ErrorResponse
	Result []models.InvokeStack `json:"result"`
}

type ValidateAddressResponse

type ValidateAddressResponse struct {
	RpcResponse
	ErrorResponse
	Result models.ValidateAddress `json:"result"`
}

type VerifyProofResponse

type VerifyProofResponse struct {
	RpcResponse
	ErrorResponse
	Result string `json:"result"` // base64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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