aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2026-07-09 17:46:36 -0230
committerSam Anthony <sam@samanthony.xyz>2026-07-09 17:46:36 -0230
commit6b87616fdd259c3669cd8de88ccb0136aa1d7f00 (patch)
tree7d52de378c57f017f1261d9075db8011cd8b2657
parent0db3af48c9bd5dfaf2b689672cf315f11c0126c4 (diff)
downloadxmrpayclnt-6b87616fdd259c3669cd8de88ccb0136aa1d7f00.zip
rename Receive to NewTx
-rw-r--r--callback_handler_test.go2
-rw-r--r--xmrpayclnt.go7
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