diff --git a/extras/jsonrpc/daemon.go b/extras/jsonrpc/daemon.go index 815c87f..1aef5ea 100644 --- a/extras/jsonrpc/daemon.go +++ b/extras/jsonrpc/daemon.go @@ -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, + }) +} diff --git a/extras/jsonrpc/daemon_test.go b/extras/jsonrpc/daemon_test.go index b072925..50bc5e5 100644 --- a/extras/jsonrpc/daemon_test.go +++ b/extras/jsonrpc/daemon_test.go @@ -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) +} diff --git a/extras/jsonrpc/daemon_types.go b/extras/jsonrpc/daemon_types.go index a40df56..1d34444 100644 --- a/extras/jsonrpc/daemon_types.go +++ b/extras/jsonrpc/daemon_types.go @@ -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"`