From dcf6e20bcdece3db96834766d00ddac42fc4410d Mon Sep 17 00:00:00 2001 From: tomasz Date: Thu, 23 Jul 2026 13:04:25 +0200 Subject: [PATCH 1/2] feat(authorize): memoTag field as fallback carriage for settlement memo tags --- authorize.go | 1 + authorize_test.go | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/authorize.go b/authorize.go index bc89670..95c1405 100644 --- a/authorize.go +++ b/authorize.go @@ -14,6 +14,7 @@ type AuthorizeBody struct { Type string `json:"@type"` SettlementAddress string `json:"settlementAddress,omitempty"` SettlementAsset string `json:"settlementAsset,omitempty"` + MemoTag string `json:"memoTag,omitempty"` Amount string `json:"amount,omitempty"` Expiry string `json:"expiry,omitempty"` ApprovedTypes []string `json:"approvedTypes,omitempty"` diff --git a/authorize_test.go b/authorize_test.go index 128fcdb..995499a 100644 --- a/authorize_test.go +++ b/authorize_test.go @@ -43,7 +43,8 @@ func TestAuthorizeBody_JSONRoundTrip(t *testing.T) { body := AuthorizeBody{ Context: TAPContext, Type: TypeAuthorize, - SettlementAddress: "eip155:1:0x1234", + SettlementAddress: "xrpl:0:rN7n3473SaZBCG4dFL83w7a1RXtXtbk2D8", + MemoTag: "998877", Amount: "100.00", } @@ -59,6 +60,23 @@ func TestAuthorizeBody_JSONRoundTrip(t *testing.T) { if got.SettlementAddress != body.SettlementAddress { t.Errorf("mismatch: %+v", got) } + if got.MemoTag != body.MemoTag { + t.Errorf("MemoTag mismatch: %+v", got) + } +} + +func TestAuthorizeBody_MemoTagOmittedWhenEmpty(t *testing.T) { + data, err := json.Marshal(AuthorizeBody{Context: TAPContext, Type: TypeAuthorize}) + if err != nil { + t.Fatalf("marshal: %v", err) + } + var raw map[string]json.RawMessage + if err := json.Unmarshal(data, &raw); err != nil { + t.Fatalf("unmarshal: %v", err) + } + if _, ok := raw["memoTag"]; ok { + t.Errorf("memoTag should be omitted when empty: %s", data) + } } func TestAuthorize_TestVectorValid(t *testing.T) { From 6754d933bbf39c4d9ccf0750f0da07e14e073103 Mon Sep 17 00:00:00 2001 From: tomasz Date: Thu, 23 Jul 2026 13:17:06 +0200 Subject: [PATCH 2/2] docs(changelog): record AuthorizeBody.MemoTag under Unreleased --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05c8e54..9202656 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +### Added + +- `AuthorizeBody` gains `MemoTag` (`memoTag`) — a Notabene extension (TAIP-4 + defines no memo-tag carriage) for the settlement memo/destination tag, as a + fallback to embedding it as a `:tag` suffix on `settlementAddress`. + ## [0.6.0] - 2026-07-08 ### Added