Documentation
¶
Overview ¶
Whitelist for smart contract functions that never need protection.
OFAC banned addresses ¶
Request represents an incoming client request
Index ¶
- Variables
- func GetIP(r *http.Request) string
- func GetSenderFromRawTx(tx *types.Transaction) (string, error)
- func GetSenderFromTx(tx *types.Transaction) (string, error)
- func GetTx(rawTxHex string) (*types.Transaction, error)
- func IsBlacklisted(ip string) bool
- func IsMetamask(r *http.Request) bool
- func IsMetamaskMoz(r *http.Request) bool
- func NewMetaMaskFixer() metaMaskFixer
- func ProxyRequest(proxyUrl string, body []byte) (*http.Response, error)
- func TruncateText(s string, max int) string
- type GetBundleStatusByTransactionHashResponse
- type HealthResponse
- type JsonRpcError
- type JsonRpcRequest
- type JsonRpcResponse
- func NewJsonRpcResponse(id interface{}, result json.RawMessage) *JsonRpcResponse
- func SendRpcAndParseResponseTo(url string, req *JsonRpcRequest) (*JsonRpcResponse, error)
- func SendRpcWithSignatureAndParseResponse(url string, privKey *ecdsa.PrivateKey, jsonRpcReq *JsonRpcRequest) (jsonRpcResponse *JsonRpcResponse, responseBytes *[]byte, err error)
- type PrivateTxApiResponse
- type RpcEndPointServer
- type RpcRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var MetaMaskFix = NewMetaMaskFixer()
Metamask fix helper
View Source
var Now = time.Now // used to mock time in tests
Functions ¶
func GetSenderFromRawTx ¶
func GetSenderFromRawTx(tx *types.Transaction) (string, error)
func GetSenderFromTx ¶
func GetSenderFromTx(tx *types.Transaction) (string, error)
func IsBlacklisted ¶
func NewMetaMaskFixer ¶
func NewMetaMaskFixer() metaMaskFixer
func TruncateText ¶
Types ¶
type GetBundleStatusByTransactionHashResponse ¶
type GetBundleStatusByTransactionHashResponse struct {
TxHash string `json:"txHash"` // "0x0aeb9c61b342f7fc94a10d41c5d30a049a9cfa9ab764c6dd02204a19960ee567"
Status string `json:"status"` // "FAILED_BUNDLE"
Message string `json:"message"` // "Expired - The base fee was to low to execute this transaction, please try again"
Error string `json:"error"` // "max fee per gas less than block base fee"
BlocksCount int `json:"blocksCount"` // 2
ReceivedTimestamp int `json:"receivedTimestamp"` // 1634568851003
StatusTimestamp int `json:"statusTimestamp"` // 1634568873862
}
type HealthResponse ¶ added in v1.2.0
type JsonRpcError ¶
RpcError: https://www.jsonrpc.org/specification#error_object
func (JsonRpcError) Error ¶
func (err JsonRpcError) Error() string
type JsonRpcRequest ¶
type JsonRpcRequest struct {
Id interface{} `json:"id"`
Method string `json:"method"`
Params []interface{} `json:"params"`
Version string `json:"jsonrpc,omitempty"`
}
func NewJsonRpcRequest ¶
func NewJsonRpcRequest(id interface{}, method string, params []interface{}) *JsonRpcRequest
func NewJsonRpcRequest1 ¶
func NewJsonRpcRequest1(id interface{}, method string, param interface{}) *JsonRpcRequest
type JsonRpcResponse ¶
type JsonRpcResponse struct {
Id interface{} `json:"id"`
Result json.RawMessage `json:"result"`
Error *JsonRpcError `json:"error,omitempty"`
Version string `json:"jsonrpc"`
}
func NewJsonRpcResponse ¶
func NewJsonRpcResponse(id interface{}, result json.RawMessage) *JsonRpcResponse
func SendRpcAndParseResponseTo ¶
func SendRpcAndParseResponseTo(url string, req *JsonRpcRequest) (*JsonRpcResponse, error)
func SendRpcWithSignatureAndParseResponse ¶ added in v1.1.0
func SendRpcWithSignatureAndParseResponse(url string, privKey *ecdsa.PrivateKey, jsonRpcReq *JsonRpcRequest) (jsonRpcResponse *JsonRpcResponse, responseBytes *[]byte, err error)
type PrivateTxApiResponse ¶ added in v1.1.0
type RpcEndPointServer ¶
type RpcEndPointServer struct {
// contains filtered or unexported fields
}
func NewRpcEndPointServer ¶
func NewRpcEndPointServer(version string, listenAddress, proxyUrl, txManagerUrl string, relayUrl string, useRelay bool, relaySigningKey *ecdsa.PrivateKey) *RpcEndPointServer
func (*RpcEndPointServer) HandleHttpRequest ¶
func (s *RpcEndPointServer) HandleHttpRequest(respw http.ResponseWriter, req *http.Request)
func (*RpcEndPointServer) Start ¶
func (s *RpcEndPointServer) Start()
type RpcRequest ¶
type RpcRequest struct {
// contains filtered or unexported fields
}
RPC request for a single client JSON-RPC request
func NewRpcRequest ¶
func NewRpcRequest(respw *http.ResponseWriter, req *http.Request, proxyUrl string, txManagerUrl string, relayUrl string, useRelay bool, relaySigningKey *ecdsa.PrivateKey) *RpcRequest
Click to show internal directories.
Click to hide internal directories.