@stellar-expert/ui-framework 1.12.4 → 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,5 +1,5 @@
1
1
  import React from 'react'
2
- import {formatWithPrecision} from '@stellar-expert/formatter'
2
+ import {formatWithAutoPrecision, formatWithPrecision} from '@stellar-expert/formatter'
3
3
  import './soroban-tx-metrics.scss'
4
4
 
5
5
  export default function SorobanTxMetricsView({metrics}) {
@@ -19,6 +19,8 @@ const MetricValue = React.memo(function ({value}) {
19
19
  return <>{value}</>
20
20
  })
21
21
 
22
+ //TODO: add descriptions (see https://github.com/stellar/stellar-core/blob/master/docs/metrics.md)
23
+
22
24
  function parseMetrics(metrics) {
23
25
  const res = {}
24
26
  for (const [key, value] of Object.entries(metrics)) {
@@ -32,7 +34,7 @@ function parseMetrics(metrics) {
32
34
  }
33
35
  break
34
36
  case 'invoke_time_nsecs':
35
- res['Invoke time'] = formatWithPrecision(value / 1000, 3) + 'µs'
37
+ res['Invoke time'] = formatWithAutoPrecision(value / 1000) + 'µs'
36
38
  break
37
39
  case 'mem_byte':
38
40
  res['Memory usage'] = formatBytes(value)
@@ -105,5 +107,5 @@ function parseMetrics(metrics) {
105
107
  }
106
108
 
107
109
  function formatBytes(value) {
108
- return formatWithPrecision(value, 3) + 'B'
110
+ return formatWithPrecision(value, 0) + 'B'
109
111
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stellar-expert/ui-framework",
3
- "version": "1.12.4",
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)