diff options
| -rw-r--r-- | callback_handler_test.go | 2 | ||||
| -rw-r--r-- | xmrpayclnt.go | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/callback_handler_test.go b/callback_handler_test.go index 50b4ab5..e303a70 100644 --- a/callback_handler_test.go +++ b/callback_handler_test.go @@ -43,7 +43,7 @@ func ExampleCallbackHandler() { // Request a transfer and register a callback for it clnt := xmrpay.New(xmrPaySrvUrl) - resp, cb, err := clnt.ReceiveWithCallback(context.Background(), 123, "lorem ipsum", cbHlr) + resp, cb, err := clnt.NewTxWithCallback(context.Background(), 123, "lorem ipsum", cbHlr) if err != nil { log.Fatal(err) } diff --git a/xmrpayclnt.go b/xmrpayclnt.go index 5d865bf..bb034bb 100644 --- a/xmrpayclnt.go +++ b/xmrpayclnt.go @@ -60,12 +60,13 @@ func (c *Client) Health(ctx context.Context) (bool, error) { return err == nil, err } -// Receive creates a subaddress for incoming transfers. -func (c *Client) Receive(ctx context.Context, amount uint64, description string) (model.ReceivePostResponse, error) { +// NewTx creates a subaddress for incoming transfers. +func (c *Client) NewTx(ctx context.Context, amount uint64, description string) (model.ReceivePostResponse, error) { return c.postReceive(ctx, amount, description, "") } -func (c *Client) ReceiveWithCallback(ctx context.Context, amount uint64, description string, ch *CallbackHandler) (model.ReceivePostResponse, Callback, error) { +// NewTxWithCallback creates a subaddress and a callback to monitor it. +func (c *Client) NewTxWithCallback(ctx context.Context, amount uint64, description string, ch *CallbackHandler) (model.ReceivePostResponse, Callback, error) { cb := ch.listen() if resp, err := c.postReceive(ctx, amount, description, cb.url.String()); err == nil { return resp, cb, nil |