diff --git a/package-lock.json b/package-lock.json index dedb0fffb..adbfe3710 100644 --- a/package-lock.json +++ b/package-lock.json @@ -59,7 +59,8 @@ "vite-plugin-html": "^3.2.0", "vite-plugin-svgr": "^4.2.0", "vite-tsconfig-paths": "^4.2.0", - "xrpl-client": "^2.1.0" + "xrpl-client": "^2.1.0", + "xrpl-tx-path-parser": "^1.0.5" }, "devDependencies": { "@babel/eslint-parser": "^7.22.6", @@ -5351,7 +5352,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", - "dev": true, "dependencies": { "@noble/hashes": "1.3.2" }, @@ -5521,7 +5521,6 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.3.2.tgz", "integrity": "sha512-N1ZhksgwD3OBlwTv3R6KFEcPojl/W4ElJOeCZdi+vuI5QmTFwLq3OFf2zd2ROpKvxFdgZ6hUpb0dx9bVNEwYCA==", - "dev": true, "dependencies": { "@noble/curves": "~1.2.0", "@noble/hashes": "~1.3.2", @@ -5535,7 +5534,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.2.1.tgz", "integrity": "sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==", - "dev": true, "dependencies": { "@noble/hashes": "~1.3.0", "@scure/base": "~1.1.0" @@ -6878,12 +6876,33 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/@xrplf/secret-numbers/-/secret-numbers-1.0.0.tgz", "integrity": "sha512-qsCLGyqe1zaq9j7PZJopK+iGTGRbk6akkg6iZXJJgxKwck0C5x5Gnwlb1HKYGOwPKyrXWpV6a2YmcpNpUFctGg==", - "dev": true, "dependencies": { "@xrplf/isomorphic": "^1.0.0", "ripple-keypairs": "^2.0.0" } }, + "node_modules/@xrplkit/amount": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@xrplkit/amount/-/amount-1.2.3.tgz", + "integrity": "sha512-poV7ym7EhjAlEGym9Kc3AHuy3uuhVW3qnl2KDr8D4zk7hANj7aG6l1XdtWIAGAgBpHnvPEaOG7+llPRRv1irZw==", + "dependencies": { + "@xrplkit/xfl": "2.0.2" + } + }, + "node_modules/@xrplkit/txmeta": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@xrplkit/txmeta/-/txmeta-1.3.1.tgz", + "integrity": "sha512-iJNtLgXTpbuYBI0VDsXJhi3MHxmsCdWsI3OumETk+21HjxDw1AmPGmVHWu8q8turFth1qzRIAtHjxLHDl307sg==", + "dependencies": { + "@xrplkit/amount": "1.2.3", + "@xrplkit/xfl": "2.0.2" + } + }, + "node_modules/@xrplkit/xfl": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@xrplkit/xfl/-/xfl-2.0.2.tgz", + "integrity": "sha512-OUZZzSoXSxYxuhBcz08Wb9Xme71PkFYejk3vq4jPzdXreVhF71ZrM6nSObHFgasC8/srWKoqiS37CnB2Ht3k/g==" + }, "node_modules/abab": { "version": "2.0.5", "dev": true, @@ -9825,10 +9844,9 @@ } }, "node_modules/decimal.js": { - "version": "10.3.1", - "dev": true, - "license": "MIT", - "peer": true + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", + "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==" }, "node_modules/decimal.js-light": { "version": "2.5.1", @@ -23893,7 +23911,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ripple-binary-codec/-/ripple-binary-codec-2.0.0.tgz", "integrity": "sha512-zakENc9A5dlW85uzrmQHrJehymhL59ftggboRNrjxFDJdlNJ6DSE210P3ys/9kL0oVtOzFnTrOPFfxHZeOsA/Q==", - "dev": true, "dependencies": { "@xrplf/isomorphic": "^1.0.0", "bignumber.js": "^9.0.0", @@ -23907,7 +23924,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ripple-keypairs/-/ripple-keypairs-2.0.0.tgz", "integrity": "sha512-b5rfL2EZiffmklqZk1W+dvSy97v3V/C7936WxCCgDynaGPp7GE6R2XO7EU9O2LlM/z95rj870IylYnOQs+1Rag==", - "dev": true, "dependencies": { "@noble/curves": "^1.0.0", "@xrplf/isomorphic": "^1.0.0", @@ -27964,7 +27980,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/xrpl/-/xrpl-3.0.0.tgz", "integrity": "sha512-QC+dNx3tvMEn9IrxcXFFa0rWwvBwACkGFNKl+W2miMGYnlgSiIsnjdqwtG2WRs0Pyxs5dd9nBTQHyQ1BPxZ78A==", - "dev": true, "dependencies": { "@scure/bip32": "^1.3.1", "@scure/bip39": "^1.2.1", @@ -27990,11 +28005,20 @@ "websocket": "^1.0.34" } }, + "node_modules/xrpl-tx-path-parser": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/xrpl-tx-path-parser/-/xrpl-tx-path-parser-1.0.5.tgz", + "integrity": "sha512-eQTdv/OKe5MIjOuiYB6FseUtiD8WOqYTmAGfOkHn4DWn233ES/970Yr10QPTrQoWtoA5forroXSiXBse6xxvow==", + "dependencies": { + "@xrplkit/txmeta": "^1.3.1", + "decimal.js": "^10.4.3", + "xrpl": "^3.0.0" + } + }, "node_modules/xrpl/node_modules/cross-fetch": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", - "dev": true, "dependencies": { "node-fetch": "^2.6.12" } @@ -28002,8 +28026,7 @@ "node_modules/xrpl/node_modules/eventemitter3": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", - "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", - "dev": true + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" }, "node_modules/y18n": { "version": "4.0.3", @@ -31558,7 +31581,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", - "dev": true, "requires": { "@noble/hashes": "1.3.2" } @@ -31665,7 +31687,6 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.3.2.tgz", "integrity": "sha512-N1ZhksgwD3OBlwTv3R6KFEcPojl/W4ElJOeCZdi+vuI5QmTFwLq3OFf2zd2ROpKvxFdgZ6hUpb0dx9bVNEwYCA==", - "dev": true, "requires": { "@noble/curves": "~1.2.0", "@noble/hashes": "~1.3.2", @@ -31676,7 +31697,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.2.1.tgz", "integrity": "sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==", - "dev": true, "requires": { "@noble/hashes": "~1.3.0", "@scure/base": "~1.1.0" @@ -32576,12 +32596,33 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/@xrplf/secret-numbers/-/secret-numbers-1.0.0.tgz", "integrity": "sha512-qsCLGyqe1zaq9j7PZJopK+iGTGRbk6akkg6iZXJJgxKwck0C5x5Gnwlb1HKYGOwPKyrXWpV6a2YmcpNpUFctGg==", - "dev": true, "requires": { "@xrplf/isomorphic": "^1.0.0", "ripple-keypairs": "^2.0.0" } }, + "@xrplkit/amount": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@xrplkit/amount/-/amount-1.2.3.tgz", + "integrity": "sha512-poV7ym7EhjAlEGym9Kc3AHuy3uuhVW3qnl2KDr8D4zk7hANj7aG6l1XdtWIAGAgBpHnvPEaOG7+llPRRv1irZw==", + "requires": { + "@xrplkit/xfl": "2.0.2" + } + }, + "@xrplkit/txmeta": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@xrplkit/txmeta/-/txmeta-1.3.1.tgz", + "integrity": "sha512-iJNtLgXTpbuYBI0VDsXJhi3MHxmsCdWsI3OumETk+21HjxDw1AmPGmVHWu8q8turFth1qzRIAtHjxLHDl307sg==", + "requires": { + "@xrplkit/amount": "1.2.3", + "@xrplkit/xfl": "2.0.2" + } + }, + "@xrplkit/xfl": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@xrplkit/xfl/-/xfl-2.0.2.tgz", + "integrity": "sha512-OUZZzSoXSxYxuhBcz08Wb9Xme71PkFYejk3vq4jPzdXreVhF71ZrM6nSObHFgasC8/srWKoqiS37CnB2Ht3k/g==" + }, "abab": { "version": "2.0.5", "dev": true @@ -34648,9 +34689,9 @@ } }, "decimal.js": { - "version": "10.3.1", - "dev": true, - "peer": true + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", + "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==" }, "decimal.js-light": { "version": "2.5.1" @@ -44266,7 +44307,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ripple-binary-codec/-/ripple-binary-codec-2.0.0.tgz", "integrity": "sha512-zakENc9A5dlW85uzrmQHrJehymhL59ftggboRNrjxFDJdlNJ6DSE210P3ys/9kL0oVtOzFnTrOPFfxHZeOsA/Q==", - "dev": true, "requires": { "@xrplf/isomorphic": "^1.0.0", "bignumber.js": "^9.0.0", @@ -44277,7 +44317,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ripple-keypairs/-/ripple-keypairs-2.0.0.tgz", "integrity": "sha512-b5rfL2EZiffmklqZk1W+dvSy97v3V/C7936WxCCgDynaGPp7GE6R2XO7EU9O2LlM/z95rj870IylYnOQs+1Rag==", - "dev": true, "requires": { "@noble/curves": "^1.0.0", "@xrplf/isomorphic": "^1.0.0", @@ -46953,7 +46992,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/xrpl/-/xrpl-3.0.0.tgz", "integrity": "sha512-QC+dNx3tvMEn9IrxcXFFa0rWwvBwACkGFNKl+W2miMGYnlgSiIsnjdqwtG2WRs0Pyxs5dd9nBTQHyQ1BPxZ78A==", - "dev": true, "requires": { "@scure/bip32": "^1.3.1", "@scure/bip39": "^1.2.1", @@ -46971,7 +47009,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", - "dev": true, "requires": { "node-fetch": "^2.6.12" } @@ -46979,8 +47016,7 @@ "eventemitter3": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", - "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", - "dev": true + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" } } }, @@ -46993,6 +47029,16 @@ "websocket": "^1.0.34" } }, + "xrpl-tx-path-parser": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/xrpl-tx-path-parser/-/xrpl-tx-path-parser-1.0.5.tgz", + "integrity": "sha512-eQTdv/OKe5MIjOuiYB6FseUtiD8WOqYTmAGfOkHn4DWn233ES/970Yr10QPTrQoWtoA5forroXSiXBse6xxvow==", + "requires": { + "@xrplkit/txmeta": "^1.3.1", + "decimal.js": "^10.4.3", + "xrpl": "^3.0.0" + } + }, "y18n": { "version": "4.0.3", "dev": true, diff --git a/package.json b/package.json index 83aec7b08..c465ea0da 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,8 @@ "vite-plugin-html": "^3.2.0", "vite-plugin-svgr": "^4.2.0", "vite-tsconfig-paths": "^4.2.0", - "xrpl-client": "^2.1.0" + "xrpl-client": "^2.1.0", + "xrpl-tx-path-parser": "^1.0.5" }, "devDependencies": { "@babel/eslint-parser": "^7.22.6", diff --git a/public/locales/ca-CA/translations.json b/public/locales/ca-CA/translations.json index a4b62daf5..c321c96cb 100644 --- a/public/locales/ca-CA/translations.json +++ b/public/locales/ca-CA/translations.json @@ -525,6 +525,7 @@ "indicate_unl": "indica un validador en una UNL", "transaction_tokens_involved": " i ", "transaction_tokens_swapped": " per ", + "filled_price": "filled price" "oracle_document_id": null, "provider": null, "last_update_time": null, diff --git a/public/locales/en-US/translations.json b/public/locales/en-US/translations.json index c7e8e0642..7277c8853 100644 --- a/public/locales/en-US/translations.json +++ b/public/locales/en-US/translations.json @@ -525,6 +525,7 @@ "indicate_unl": "indicates a validator on an UNL", "transaction_tokens_involved": " and ", "transaction_tokens_swapped": " for ", + "filled_price": "filled price" "oracle_document_id": "Oracle Document ID", "provider": "Provider", "last_update_time": "Last Update Time", diff --git a/src/containers/shared/components/Transaction/OfferCreate/Simple.tsx b/src/containers/shared/components/Transaction/OfferCreate/Simple.tsx index c220c9b95..7aa767d4d 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/Simple.tsx +++ b/src/containers/shared/components/Transaction/OfferCreate/Simple.tsx @@ -7,40 +7,57 @@ import Currency from '../../Currency' const Simple: TransactionSimpleComponent = (props: TransactionSimpleProps) => { const { t } = useTranslation() const { data } = props - const { price, firstCurrency, secondCurrency, pays, gets, cancel } = + const { deliveredPrice, firstCurrency, secondCurrency, pays, gets, cancel } = data.instructions + const getDeliveredAmount = () => { + let result: string = '' + + if (deliveredPrice !== undefined) { + result = ( + +
+ {`${Number(deliveredPrice)}`} +
+ + / + +
+
+
+ ) + } + return result + } + + const rendetfSell = () => { + const { tfSell } = data.instructions + return tfSell ?
tfSell
: null + } + return ( <> - -
- {`${Number(price)}`} -
- - / - -
-
-
+ {rendetfSell()} {cancel && ( #{cancel} )} + {getDeliveredAmount()} ) } diff --git a/src/containers/shared/components/Transaction/OfferCreate/TableDetail.tsx b/src/containers/shared/components/Transaction/OfferCreate/TableDetail.tsx index c42719ab9..0ed058ee3 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/TableDetail.tsx +++ b/src/containers/shared/components/Transaction/OfferCreate/TableDetail.tsx @@ -5,29 +5,40 @@ import Currency from '../../Currency' export const TableDetail = (props: any) => { const { t } = useTranslation() const { instructions } = props - const { gets, pays, price, firstCurrency, secondCurrency, cancel } = - instructions + const { + gets, + pays, + deliveredPrice, + firstCurrency, + secondCurrency, + cancel, + tfSell, + } = instructions + const rendetfSell = () => + tfSell ?
tfSell
: null return pays && gets ? (
-
- {t('price')}: + {!cancel && deliveredPrice !== undefined && ( +
+ {t('filled_price')}: - - {`${Number(price)} `} - - / - - -
+ + {`${Number(deliveredPrice)} `} + + / + + +
+ )}
{t('buy')} @@ -35,6 +46,7 @@ export const TableDetail = (props: any) => {
{t('sell')} + {rendetfSell()}
{cancel && (
diff --git a/src/containers/shared/components/Transaction/OfferCreate/parser.ts b/src/containers/shared/components/Transaction/OfferCreate/parser.ts index e895c2b5c..3123608e8 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/parser.ts +++ b/src/containers/shared/components/Transaction/OfferCreate/parser.ts @@ -1,7 +1,10 @@ +import pathParser from 'xrpl-tx-path-parser' import { CURRENCY_ORDER } from '../../../transactionUtils' import { formatAmount } from '../../../../../rippled/lib/txSummary/formatAmount' -export function parser(tx: any) { +export const istfSell = (flags: any) => 0x00080000 & flags + +export function parser(tx: any, meta: any) { const gets = formatAmount(tx.TakerGets) const base = tx.TakerGets.currency ? tx.TakerGets : { currency: 'XRP' } const counter = tx.TakerPays.currency ? tx.TakerPays : { currency: 'XRP' } @@ -11,12 +14,26 @@ export function parser(tx: any) { CURRENCY_ORDER.indexOf(counter.currency) > CURRENCY_ORDER.indexOf(base.currency) + tx.meta = meta + const parsed = pathParser(tx) + const deliveredPrice = + parsed.destinationAmount.value > 0 + ? Math.abs(parsed.destinationAmount.value / parsed.sourceAmount.value) + : undefined + + const tfSell = !!istfSell(tx.Flags) + return { gets, pays, price: (invert ? 1 / price : price).toPrecision(6), + deliveredPrice: + deliveredPrice !== undefined + ? (invert ? 1 / deliveredPrice : deliveredPrice).toPrecision(6) + : undefined, firstCurrency: invert ? counter : base, secondCurrency: invert ? base : counter, cancel: tx.OfferSequence, + tfSell, } } diff --git a/src/containers/shared/components/Transaction/Payment/Simple.tsx b/src/containers/shared/components/Transaction/Payment/Simple.tsx index ff24b6391..792aa6fa2 100644 --- a/src/containers/shared/components/Transaction/Payment/Simple.tsx +++ b/src/containers/shared/components/Transaction/Payment/Simple.tsx @@ -4,11 +4,12 @@ import { Amount } from '../../Amount' import { PaymentInstructions } from './types' import { TransactionSimpleProps } from '../types' import { SimpleRow } from '../SimpleRow' +import Currency from '../../Currency' export const Simple = (props: TransactionSimpleProps) => { const { data } = props const { t } = useTranslation() - const { amount, convert } = data.instructions + const { amount, convert, deliveredPrice } = data.instructions const renderPartial = () => { const { partial } = data.instructions @@ -17,6 +18,34 @@ export const Simple = (props: TransactionSimpleProps) => { ) : null } + const getDeliveredAmount = () => { + let result: string = '' + + if (deliveredPrice !== undefined) { + result = ( + +
+ {`${Number(deliveredPrice)}`} +
+ + / + +
+
+
+ ) + } + return result + } + const renderPayment = () => { const { max, destination, sourceTag, partial } = data.instructions @@ -55,6 +84,8 @@ export const Simple = (props: TransactionSimpleProps) => { {renderPartial()} + + {getDeliveredAmount()} ) : ( renderPayment() diff --git a/src/containers/shared/components/Transaction/Payment/TableDetail.tsx b/src/containers/shared/components/Transaction/Payment/TableDetail.tsx index 867566e33..4168b2a93 100644 --- a/src/containers/shared/components/Transaction/Payment/TableDetail.tsx +++ b/src/containers/shared/components/Transaction/Payment/TableDetail.tsx @@ -3,12 +3,14 @@ import { Amount } from '../../Amount' import { TransactionTableDetailProps } from '../types' import { PaymentInstructions } from './types' import { Account } from '../../Account' +import Currency from '../../Currency' export const TableDetail = ({ instructions, }: TransactionTableDetailProps) => { const { t } = useTranslation() - const { convert, amount, destination, partial, sourceTag } = instructions + const { convert, amount, destination, partial, sourceTag, deliveredPrice } = + instructions const renderPartial = () => (
{t('partial_payment_allowed')}
@@ -17,6 +19,24 @@ export const TableDetail = ({ if (convert) { return (
+
+ {t('filled_price')}: + + + {`${Number(deliveredPrice)} `} + + / + + +
{t('convert_maximum')} {t('to')} diff --git a/src/containers/shared/components/Transaction/Payment/parser.ts b/src/containers/shared/components/Transaction/Payment/parser.ts index 743c05367..a4058bf0b 100644 --- a/src/containers/shared/components/Transaction/Payment/parser.ts +++ b/src/containers/shared/components/Transaction/Payment/parser.ts @@ -1,3 +1,4 @@ +import pathParser from 'xrpl-tx-path-parser' import type { Payment } from 'xrpl' import { formatAmount } from '../../../../../rippled/lib/txSummary/formatAmount' import { PaymentInstructions } from './types' @@ -20,12 +21,20 @@ export const parser = (tx: Payment, meta: any): PaymentInstructions => { const dt = tx.DestinationTag !== undefined ? `:${tx.DestinationTag}` : '' const destination = `${tx.Destination}${dt}` + tx.meta = meta + const parsed = pathParser(tx) + const deliveredPrice = + parsed.destinationAmount.value > 0 + ? Math.abs(parsed.destinationAmount.value / parsed.sourceAmount.value) + : undefined + if (tx.Account === tx.Destination) { return { amount, convert: max, destination, partial, + deliveredPrice, } } @@ -35,5 +44,6 @@ export const parser = (tx: Payment, meta: any): PaymentInstructions => { destination: `${tx.Destination}${dt}`, sourceTag: tx.SourceTag, partial, + deliveredPrice, } } diff --git a/src/rippled/lib/txSummary/index.js b/src/rippled/lib/txSummary/index.js index 0dece7f49..858825611 100644 --- a/src/rippled/lib/txSummary/index.js +++ b/src/rippled/lib/txSummary/index.js @@ -27,6 +27,8 @@ const summarizeTransaction = (d, details = false) => { details: details ? { instructions: getInstructions(d.tx, d.meta), + tx: d.tx, + meta: d.meta, } : undefined, }