Skip to content

Commit a17fa3a

Browse files
authored
Merge pull request #64 from lbryio/channelexport
Add channel export call
2 parents ada0ce0 + 560858b commit a17fa3a

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

extras/jsonrpc/daemon.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,3 +505,12 @@ func (d *Client) ClaimSearch(claimName, claimID, txid *string, nout *uint) (*Cla
505505
"name": claimName,
506506
})
507507
}
508+
509+
func (d *Client) ChannelExport(channelClaimID string, channelName, accountID *string) (*ChannelExportResponse, error) {
510+
response := new(ChannelExportResponse)
511+
return response, d.call(response, "channel_export", map[string]interface{}{
512+
"channel_id": channelClaimID,
513+
"channel_name": channelName,
514+
"account_id": accountID,
515+
})
516+
}

extras/jsonrpc/daemon_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,3 +402,16 @@ func TestClient_AccountRemove(t *testing.T) {
402402
t.Error("account was not removed")
403403
prettyPrint(*account)
404404
}
405+
406+
func TestClient_ChannelExport(t *testing.T) {
407+
d := NewClient("")
408+
channelClaimID := "f1ad0d72eae6b471cfd72b7956768c0c191b22d7"
409+
response, err := d.ChannelExport(channelClaimID, nil, nil)
410+
if err != nil {
411+
t.Error(err)
412+
}
413+
if response == nil || len(*response) == 0 {
414+
t.Error("nothing returned!")
415+
}
416+
t.Log("Export:", *response)
417+
}

extras/jsonrpc/daemon_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ type AccountFundResponse TransactionSummary
266266
type Address string
267267
type AddressUnusedResponse Address
268268
type AddressListResponse []Address
269+
type ChannelExportResponse string
269270

270271
type ChannelListResponse struct {
271272
Items []Transaction `json:"items"`

0 commit comments

Comments
 (0)