@stellar-expert/ui-framework 1.12.3 → 1.12.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
- import {formatWithPrecision} from '@stellar-expert/formatter'
1
+ import React from 'react'
2
+ import {formatWithAutoPrecision, formatWithPrecision} from '@stellar-expert/formatter'
2
3
  import './soroban-tx-metrics.scss'
3
4
 
4
5
  export default function SorobanTxMetricsView({metrics}) {
@@ -18,6 +19,8 @@ const MetricValue = React.memo(function ({value}) {
18
19
  return <>{value}</>
19
20
  })
20
21
 
22
+ //TODO: add descriptions (see https://github.com/stellar/stellar-core/blob/master/docs/metrics.md)
23
+
21
24
  function parseMetrics(metrics) {
22
25
  const res = {}
23
26
  for (const [key, value] of Object.entries(metrics)) {
@@ -31,7 +34,7 @@ function parseMetrics(metrics) {
31
34
  }
32
35
  break
33
36
  case 'invoke_time_nsecs':
34
- res['Invoke time'] = formatWithPrecision(value / 1000, 3) + 'µs'
37
+ res['Invoke time'] = formatWithAutoPrecision(value / 1000) + 'µs'
35
38
  break
36
39
  case 'mem_byte':
37
40
  res['Memory usage'] = formatBytes(value)
@@ -104,5 +107,5 @@ function parseMetrics(metrics) {
104
107
  }
105
108
 
106
109
  function formatBytes(value) {
107
- return formatWithPrecision(value, 3) + 'B'
110
+ return formatWithPrecision(value, 0) + 'B'
108
111
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stellar-expert/ui-framework",
3
- "version": "1.12.3",
3
+ "version": "1.12.5",
4
4
  "description": "StellarExpert shared UI components library",
5
5
  "main": "index.js",
6
6
  "module": "./index.js",
@@ -133,7 +133,7 @@ function PathPaymentDescriptionView({op, compact}) {
133
133
  const changeEffect = effects.find(e => e.source === source && e.asset === destAssetId && (e.type === 'accountCredited' || e.type === 'accountDebited'))
134
134
  if (changeEffect) { //arbitrage successful, otherwise src = dst and no account changes happened
135
135
  const change = BigInt(changeEffect.amount)
136
- dst = fromStroops(toStroops(destAmount) + (changeEffect.type === 'accountCredited' ? change : -change))
136
+ dst = fromStroops(toStroops(sendAmount) + (changeEffect.type === 'accountCredited' ? change : -change))
137
137
  }
138
138
  } else {
139
139
  const creditedEffect = effects.find(e => e.source === destination && e.type === 'accountCredited' && e.asset === destAssetId)