Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ripple - Add destination tag processing #857

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 14 additions & 3 deletions src/ripple/RippleEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
EdgeEngineActivationOptions,
EdgeEngineGetActivationAssetsOptions,
EdgeGetActivationAssetsResults,
EdgeMemo,
EdgeSpendInfo,
EdgeTransaction,
EdgeWalletInfo,
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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: {},
Expand Down Expand Up @@ -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: {},
Expand Down
1 change: 1 addition & 0 deletions src/ripple/rippleTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export type XrpWalletOtherData = ReturnType<typeof asXrpWalletOtherData>

export const asXrpTransaction = asObject({
date: asNumber,
DestinationTag: asOptional(asNumber),
hash: asString,
Fee: asOptional(asString),
ledger_index: asNumber
Expand Down
Loading