Skip to content

Commit

Permalink
remainder of client
Browse files Browse the repository at this point in the history
  • Loading branch information
CreatureDev committed Feb 7, 2024
1 parent 30f5a78 commit b847014
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion client/channels.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
)

type Channel interface {
ChannelAuthorize(req *channel.ChannelAuthorizeRequest) (*channel.ChannelAuthorizeRequest, XRPLResponse, error)
ChannelAuthorize(req *channel.ChannelAuthorizeRequest) (*channel.ChannelAuthorizeResponse, XRPLResponse, error)
ChannelVerify(req *channel.ChannelVerifyRequest) (*channel.ChannelVerifyResponse, XRPLResponse, error)
}

Expand Down
18 changes: 14 additions & 4 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ type Client interface {
}

type XRPLClient struct {
client Client
Account Account
client Client
Account Account
Channel Channel
Ledger Ledger
Path Path
Subscription Subscription
Transaction Transaction
}

type XRPLRequest interface {
Expand All @@ -27,8 +32,13 @@ type XRPLResponseWarning struct {

func NewXRPLClient(cl Client) *XRPLClient {
return &XRPLClient{
client: cl,
Account: &accountImpl{client: cl},
client: cl,
Account: &accountImpl{client: cl},
Channel: &channelImpl{client: cl},
Ledger: &ledgerImpl{client: cl},
Path: &pathImpl{client: cl},
Subscription: &subscriptionImpl{client: cl},
Transaction: &transactionImpl{client: cl},
}
}

Expand Down
10 changes: 5 additions & 5 deletions client/ledgers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
)

type Ledger interface {
LedgerClosed(req *ledger.LedgerClosedRequest) (*ledger.LedgerClosedRequest, XRPLResponse, error)
LedgerCurrent(req *ledger.LedgerCurrentRequest) (*ledger.LedgerCurrentRequest, XRPLResponse, error)
LedgerData(req *ledger.LedgerDataRequest) (*ledger.LedgerDataRequest, XRPLResponse, error)
LedgerEntry(req *ledger.LedgerEntryRequest) (*ledger.LedgerEntryRequest, XRPLResponse, error)
Ledger(req *ledger.LedgerRequest) (*ledger.LedgerRequest, XRPLResponse, error)
LedgerClosed(req *ledger.LedgerClosedRequest) (*ledger.LedgerClosedResponse, XRPLResponse, error)
LedgerCurrent(req *ledger.LedgerCurrentRequest) (*ledger.LedgerCurrentResponse, XRPLResponse, error)
LedgerData(req *ledger.LedgerDataRequest) (*ledger.LedgerDataResponse, XRPLResponse, error)
LedgerEntry(req *ledger.LedgerEntryRequest) (*ledger.LedgerEntryResponse, XRPLResponse, error)
Ledger(req *ledger.LedgerRequest) (*ledger.LedgerResponse, XRPLResponse, error)
}

type ledgerImpl struct {
Expand Down
4 changes: 2 additions & 2 deletions client/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package client

import "github.com/CreatureDev/xrpl-go/model/client/path"

type PathBook interface {
type Path interface {
BookOffers(req *path.BookOffersRequest) (*path.BookOffersResponse, XRPLResponse, error)
DepositAuthorized(req *path.DepositAuthorizedRequest) (*path.DepositAuthorizedResponse, XRPLResponse, error)
NFTokenBuyOffers(req *path.NFTokenBuyOffersRequest) (*path.NFTokenBuyOffersResponse, XRPLResponse, error)
Expand Down Expand Up @@ -41,7 +41,7 @@ func (p *pathImpl) DepositAuthorized(req *path.DepositAuthorizedRequest) (*path.
return &dar, res, nil
}

func (p *pathImpl) NFTBuyOffers(req *path.NFTokenBuyOffersRequest) (*path.NFTokenBuyOffersResponse, XRPLResponse, error) {
func (p *pathImpl) NFTokenBuyOffers(req *path.NFTokenBuyOffersRequest) (*path.NFTokenBuyOffersResponse, XRPLResponse, error) {
res, err := p.client.SendRequest(req)
if err != nil {
return nil, nil, err
Expand Down

0 comments on commit b847014

Please sign in to comment.