GQL API for getStorageAt and getLogs #69
@ -4,18 +4,12 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||||
gqlclient "github.com/machinebox/graphql"
|
gqlclient "github.com/machinebox/graphql"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Client struct {
|
|
||||||
client *gqlclient.Client
|
|
||||||
timeout time.Duration
|
|
||||||
}
|
|
||||||
|
|
||||||
type StorageResponse struct {
|
type StorageResponse struct {
|
||||||
Cid string `json:"cid"`
|
Cid string `json:"cid"`
|
||||||
IpldBlock hexutil.Bytes `json:"ipldBlock"`
|
IpldBlock hexutil.Bytes `json:"ipldBlock"`
|
||||||
@ -35,6 +29,10 @@ type GetLogs struct {
|
|||||||
Responses []LogResponse `json:"getLogs"`
|
Responses []LogResponse `json:"getLogs"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Client struct {
|
||||||
|
client *gqlclient.Client
|
||||||
|
}
|
||||||
|
|
||||||
func NewClient(endpoint string) *Client {
|
func NewClient(endpoint string) *Client {
|
||||||
client := gqlclient.NewClient(endpoint)
|
client := gqlclient.NewClient(endpoint)
|
||||||
return &Client{client: client}
|
return &Client{client: client}
|
||||||
|
Loading…
Reference in New Issue
Block a user