diff --git a/CHANGELOG.md b/CHANGELOG.md index f2a50f9ac..280972086 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +- added: (XRP) Add destination tag to processed transactions + ## 4.28.0 (2024-11-21) - added: (LLD/LLM) Tx history support diff --git a/src/ripple/RippleEngine.ts b/src/ripple/RippleEngine.ts index 492ce1313..161044401 100644 --- a/src/ripple/RippleEngine.ts +++ b/src/ripple/RippleEngine.ts @@ -23,6 +23,7 @@ import { EdgeEngineActivationOptions, EdgeEngineGetActivationAssetsOptions, EdgeGetActivationAssetsResults, + EdgeMemo, EdgeSpendInfo, EdgeTransaction, EdgeWalletInfo, @@ -466,7 +467,17 @@ export class XrpEngine extends CurrencyEngine< const balances = getBalanceChanges(meta) - const { date, hash, Fee } = xrpTx + const { date, DestinationTag, hash, Fee } = xrpTx + + const memos: EdgeMemo[] = [] + if (DestinationTag != null) { + memos.push({ + type: 'number', + value: DestinationTag.toString(), + memoName: 'destination tag' + }) + } + for (const balance of balances) { const { account } = balance if (account !== publicAddress) { @@ -506,7 +517,7 @@ export class XrpEngine extends CurrencyEngine< currencyCode: currency, date: rippleTimeToUnixTime(date) / 1000, // Returned date is in "ripple time" which is unix time if it had started on Jan 1 2000 isSend, - memos: [], + memos, nativeAmount, networkFee, otherParams: {}, @@ -544,7 +555,7 @@ export class XrpEngine extends CurrencyEngine< currencyCode, date: rippleTimeToUnixTime(date) / 1000, // Returned date is in "ripple time" which is unix time if it had started on Jan 1 2000 isSend, - memos: [], + memos, nativeAmount, networkFee: '0', otherParams: {}, diff --git a/src/ripple/rippleTypes.ts b/src/ripple/rippleTypes.ts index 107118f4d..b2a39aaee 100644 --- a/src/ripple/rippleTypes.ts +++ b/src/ripple/rippleTypes.ts @@ -44,6 +44,7 @@ export type XrpWalletOtherData = ReturnType export const asXrpTransaction = asObject({ date: asNumber, + DestinationTag: asOptional(asNumber), hash: asString, Fee: asOptional(asString), ledger_index: asNumber