Add channel export call
This commit is contained in:
parent
ada0ce0484
commit
560858ba0a
3 changed files with 23 additions and 0 deletions
|
@ -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,
|
||||
})
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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"`
|
||||
|
|
Loading…
Reference in a new issue