Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions authorize.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
20 changes: 19 additions & 1 deletion authorize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}

Expand All @@ -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) {
Expand Down
Loading