@stellar-expert/ui-framework 1.9.9 → 1.9.11

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stellar-expert/ui-framework",
3
- "version": "1.9.9",
3
+ "version": "1.9.11",
4
4
  "description": "StellarExpert shared UI components library",
5
5
  "main": "index.js",
6
6
  "module": "./index.js",
@@ -13,7 +13,7 @@ export function OpAccountingChanges({op}) {
13
13
  {changes.map((ch, i) => <div key={op.txHash + op.order + i}
14
14
  className={ch.type === 'accountDebited' ? 'dimmed' : 'color-success'}>
15
15
  {ch.type === 'accountDebited' ? '-' : '+'}
16
- <Amount amount={ch.amount} asset={ch.asset} issuer={false} icon={false}/>
16
+ <Amount amount={ch.amount} asset={ch.asset} issuer={false} icon={false} adjust/>
17
17
  </div>)}
18
18
  </div>
19
19
  }
@@ -21,7 +21,7 @@ export function OpAccountingChanges({op}) {
21
21
  export function TxFeeAccountingChanges({amount}) {
22
22
  return <div className="accounting-effects condensed">
23
23
  <div className="dimmed">
24
- -<Amount amount={amount} asset="XLM" issuer={false} icon={false}/>
24
+ -<Amount amount={amount} asset="XLM" issuer={false} icon={false} adjust/>
25
25
  </div>
26
26
  </div>
27
27
  }
@@ -3,11 +3,14 @@ const manageOfferOpTypes = ['manageSellOffer', 'manageBuyOffer', 'createPassiveS
3
3
  /**
4
4
  * Calculate operation resulting balance changes
5
5
  * @param {{}} op - Operation descriptor
6
- * @return {[{amount: *, source, type: string, asset},{amount: *, source, type: string, asset}]|{length}|*|*[]}
6
+ * @return {{amount: String, source: String, type: String, asset: String}[]}
7
7
  */
8
8
  export function retrieveOpBalanceChanges(op) {
9
+ const account = op.tx?.context?.account
10
+ if (typeof account !== 'string')
11
+ return []
9
12
  const {effects} = op.operation
10
- const changes = effects.filter(e => e.source === op.context && (e.type === 'accountDebited' || e.type === 'accountCredited'))
13
+ const changes = effects.filter(e => e.source === account && (e.type === 'accountDebited' || e.type === 'accountCredited'))
11
14
  if (changes.length) {
12
15
  changes.sort((a, b) => a.type - b.type)
13
16
  return changes
@@ -55,6 +58,7 @@ export function retrieveOpBalanceChanges(op) {
55
58
  }*/
56
59
  return []
57
60
  }
61
+
58
62
  /*
59
63
 
60
64
  function sumAmounts(amounts) {