-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add datalayer service in client
- Loading branch information
1 parent
6b4cfb6
commit b59c299
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package rpc | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/chia-network/go-chia-libs/pkg/rpcinterface" | ||
) | ||
|
||
// DataLayerService encapsulates data layer RPC methods | ||
type DataLayerService struct { | ||
client *Client | ||
} | ||
|
||
// NewRequest returns a new request specific to the wallet service | ||
func (s *DataLayerService) NewRequest(rpcEndpoint rpcinterface.Endpoint, opt interface{}) (*rpcinterface.Request, error) { | ||
return s.client.NewRequest(rpcinterface.ServiceFullNode, rpcEndpoint, opt) | ||
} | ||
|
||
// Do is just a shortcut to the client's Do method | ||
func (s *DataLayerService) Do(req *rpcinterface.Request, v interface{}) (*http.Response, error) { | ||
return s.client.Do(req, v) | ||
} |