2016-09-11 14:44:14 +03:00
|
|
|
package geth
|
2016-06-22 13:56:27 -05:00
|
|
|
|
2016-07-27 14:47:41 +03:00
|
|
|
import (
|
2016-11-05 20:12:24 +03:00
|
|
|
"github.com/ethereum/go-ethereum/common"
|
2016-08-31 21:02:06 +03:00
|
|
|
"github.com/ethereum/go-ethereum/les/status"
|
2016-07-27 14:47:41 +03:00
|
|
|
)
|
|
|
|
|
2017-05-03 17:24:48 +03:00
|
|
|
// SignalEnvelope is a general signal sent upward from node to RN app
|
2016-12-18 23:36:17 +03:00
|
|
|
type SignalEnvelope struct {
|
|
|
|
Type string `json:"type"`
|
|
|
|
Event interface{} `json:"event"`
|
|
|
|
}
|
|
|
|
|
2017-05-03 17:24:48 +03:00
|
|
|
// AccountInfo represents account's info
|
2016-06-22 13:56:27 -05:00
|
|
|
type AccountInfo struct {
|
2016-08-18 03:15:58 +03:00
|
|
|
Address string `json:"address"`
|
|
|
|
PubKey string `json:"pubkey"`
|
|
|
|
Mnemonic string `json:"mnemonic"`
|
|
|
|
Error string `json:"error"`
|
2016-06-22 13:56:27 -05:00
|
|
|
}
|
|
|
|
|
2017-05-03 17:24:48 +03:00
|
|
|
// JSONError is wrapper around errors, that are sent upwards
|
2016-06-22 13:56:27 -05:00
|
|
|
type JSONError struct {
|
|
|
|
Error string `json:"error"`
|
|
|
|
}
|
2016-07-04 19:00:29 +03:00
|
|
|
|
2017-05-03 17:24:48 +03:00
|
|
|
// NodeCrashEvent is special kind of error, used to report node crashes
|
2017-01-12 20:56:36 +03:00
|
|
|
type NodeCrashEvent struct {
|
|
|
|
Error string `json:"error"`
|
|
|
|
}
|
|
|
|
|
2017-05-03 17:24:48 +03:00
|
|
|
// AddPeerResult is a JSON returned as a response to AddPeer() request
|
2016-07-04 19:00:29 +03:00
|
|
|
type AddPeerResult struct {
|
2016-07-27 14:47:41 +03:00
|
|
|
Success bool `json:"success"`
|
|
|
|
Error string `json:"error"`
|
2016-07-04 19:00:29 +03:00
|
|
|
}
|
2016-07-12 21:10:37 +03:00
|
|
|
|
2017-05-03 17:24:48 +03:00
|
|
|
// WhisperMessageEvent is a signal sent on incoming Whisper message
|
2016-07-12 21:10:37 +03:00
|
|
|
type WhisperMessageEvent struct {
|
2016-07-27 14:47:41 +03:00
|
|
|
Payload string `json:"payload"`
|
|
|
|
To string `json:"to"`
|
|
|
|
From string `json:"from"`
|
|
|
|
Sent int64 `json:"sent"`
|
|
|
|
TTL int64 `json:"ttl"`
|
|
|
|
Hash string `json:"hash"`
|
|
|
|
}
|
|
|
|
|
2017-05-03 17:24:48 +03:00
|
|
|
// SendTransactionEvent is a signal sent on a send transaction request
|
2016-07-27 14:47:41 +03:00
|
|
|
type SendTransactionEvent struct {
|
2017-05-03 17:24:48 +03:00
|
|
|
ID string `json:"id"`
|
2016-10-07 17:48:36 +03:00
|
|
|
Args status.SendTxArgs `json:"args"`
|
2017-05-03 17:24:48 +03:00
|
|
|
MessageID string `json:"message_id"`
|
2016-07-12 21:10:37 +03:00
|
|
|
}
|
|
|
|
|
2017-05-03 17:24:48 +03:00
|
|
|
// ReturnSendTransactionEvent is a JSON returned whenever transaction send is returned
|
2016-10-26 05:51:33 +03:00
|
|
|
type ReturnSendTransactionEvent struct {
|
2017-05-03 17:24:48 +03:00
|
|
|
ID string `json:"id"`
|
2016-10-26 05:51:33 +03:00
|
|
|
Args status.SendTxArgs `json:"args"`
|
2017-05-03 17:24:48 +03:00
|
|
|
MessageID string `json:"message_id"`
|
2016-10-26 05:51:33 +03:00
|
|
|
ErrorMessage string `json:"error_message"`
|
|
|
|
ErrorCode string `json:"error_code"`
|
|
|
|
}
|
|
|
|
|
2017-05-03 17:24:48 +03:00
|
|
|
// CompleteTransactionResult is a JSON returned from transaction complete function (used in exposed method)
|
2016-08-09 19:41:42 +03:00
|
|
|
type CompleteTransactionResult struct {
|
2017-05-03 17:24:48 +03:00
|
|
|
ID string `json:"id"`
|
2016-08-09 19:41:42 +03:00
|
|
|
Hash string `json:"hash"`
|
|
|
|
Error string `json:"error"`
|
|
|
|
}
|
|
|
|
|
2017-05-03 17:24:48 +03:00
|
|
|
// RawCompleteTransactionResult is a JSON returned from transaction complete function (used internally)
|
2016-11-05 20:12:24 +03:00
|
|
|
type RawCompleteTransactionResult struct {
|
|
|
|
Hash common.Hash
|
|
|
|
Error error
|
|
|
|
}
|
|
|
|
|
2017-05-03 17:24:48 +03:00
|
|
|
// CompleteTransactionsResult is list of results from CompleteTransactions() (used in exposed method)
|
2016-11-05 20:12:24 +03:00
|
|
|
type CompleteTransactionsResult struct {
|
|
|
|
Results map[string]CompleteTransactionResult `json:"results"`
|
|
|
|
}
|
|
|
|
|
2017-05-03 17:24:48 +03:00
|
|
|
// RawDiscardTransactionResult is list of results from CompleteTransactions() (used internally)
|
2016-11-05 20:12:24 +03:00
|
|
|
type RawDiscardTransactionResult struct {
|
|
|
|
Error error
|
|
|
|
}
|
|
|
|
|
2017-05-03 17:24:48 +03:00
|
|
|
// DiscardTransactionResult is a JSON returned from transaction discard function
|
2016-10-31 01:35:10 +03:00
|
|
|
type DiscardTransactionResult struct {
|
2017-05-03 17:24:48 +03:00
|
|
|
ID string `json:"id"`
|
2016-10-31 01:35:10 +03:00
|
|
|
Error string `json:"error"`
|
|
|
|
}
|
|
|
|
|
2017-05-03 17:24:48 +03:00
|
|
|
// DiscardTransactionsResult is a list of results from DiscardTransactions()
|
2016-11-05 20:12:24 +03:00
|
|
|
type DiscardTransactionsResult struct {
|
|
|
|
Results map[string]DiscardTransactionResult `json:"results"`
|
|
|
|
}
|
|
|
|
|
2017-05-03 17:24:48 +03:00
|
|
|
// LocalStorageSetEvent is a signal sent whenever local storage Set method is called
|
2016-12-18 23:36:17 +03:00
|
|
|
type LocalStorageSetEvent struct {
|
2017-05-03 17:24:48 +03:00
|
|
|
ChatID string `json:"chat_id"`
|
2016-12-18 23:36:17 +03:00
|
|
|
Data string `json:"data"`
|
2016-07-27 14:47:41 +03:00
|
|
|
}
|
2016-10-07 17:48:36 +03:00
|
|
|
|
2017-05-03 17:24:48 +03:00
|
|
|
// RPCCall represents RPC call parameters
|
2016-10-07 17:48:36 +03:00
|
|
|
type RPCCall struct {
|
2017-05-03 17:24:48 +03:00
|
|
|
ID int64
|
2016-10-07 17:48:36 +03:00
|
|
|
Method string
|
|
|
|
Params []interface{}
|
|
|
|
}
|