GQL API for getStorageAt and getLogs #69

Closed
ashwinphatak wants to merge 5 commits from ashwinp-gql-get-storage into master
Showing only changes of commit ed053f536a - Show all commits

View File

@ -4,18 +4,12 @@ import (
"context"
"encoding/json"
"fmt"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
gqlclient "github.com/machinebox/graphql"
)
type Client struct {
client *gqlclient.Client
timeout time.Duration
}
type StorageResponse struct {
Cid string `json:"cid"`
IpldBlock hexutil.Bytes `json:"ipldBlock"`
@ -35,6 +29,10 @@ type GetLogs struct {
Responses []LogResponse `json:"getLogs"`
}
type Client struct {
client *gqlclient.Client
}
func NewClient(endpoint string) *Client {
client := gqlclient.NewClient(endpoint)
return &Client{client: client}