Add channel export call

This commit is contained in:
Mark Beamer Jr 2019-07-25 23:33:52 -04:00
parent ada0ce0484
commit 560858ba0a
No known key found for this signature in database
GPG key ID: 1C314FB89AD76973
3 changed files with 23 additions and 0 deletions

View file

@ -505,3 +505,12 @@ func (d *Client) ClaimSearch(claimName, claimID, txid *string, nout *uint) (*Cla
"name": claimName,
})
}
func (d *Client) ChannelExport(channelClaimID string, channelName, accountID *string) (*ChannelExportResponse, error) {
response := new(ChannelExportResponse)
return response, d.call(response, "channel_export", map[string]interface{}{
"channel_id": channelClaimID,
"channel_name": channelName,
"account_id": accountID,
})
}

View file

@ -402,3 +402,16 @@ func TestClient_AccountRemove(t *testing.T) {
t.Error("account was not removed")
prettyPrint(*account)
}
func TestClient_ChannelExport(t *testing.T) {
d := NewClient("")
channelClaimID := "f1ad0d72eae6b471cfd72b7956768c0c191b22d7"
response, err := d.ChannelExport(channelClaimID, nil, nil)
if err != nil {
t.Error(err)
}
if response == nil || len(*response) == 0 {
t.Error("nothing returned!")
}
t.Log("Export:", *response)
}

View file

@ -266,6 +266,7 @@ type AccountFundResponse TransactionSummary
type Address string
type AddressUnusedResponse Address
type AddressListResponse []Address
type ChannelExportResponse string
type ChannelListResponse struct {
Items []Transaction `json:"items"`